Commit Graph

71 Commits

Author SHA1 Message Date
Bonian Chen
d40f7f707e [Settings] Move mobile data template out of framework
Move mobile data template out of framework

Bug: 151751844
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageLibTest
Change-Id: I5072cd1e673194d00b3ce82242bf5fbad88d23cd
2020-06-02 17:16:53 +08:00
Bonian Chen
76627e415d [Settings] Fix DataUsageUtilsTest
Fix DataUsageUtilsTest

Bug: 154564365
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageUtilsTest
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryTest
Change-Id: Iff614135dfb0015deb5220fbf7f9338322def507
2020-04-24 10:46:30 +08:00
Bonian Chen
a73cb31f63 [Settings] Fix DataUsageSummaryTest
Fix DataUsageSummaryTest

Bug: 154563784
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryTest
Change-Id: I32f8fc00f01a335950e863d5c9801ee9af0a3f5d
2020-04-23 13:43:27 +08:00
Bonian Chen
90cb45e31c [Settings] Code refactor
1. Fix comments
2. Split test case

Bug: 147338143
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageListTest
Change-Id: I017a3ac8a716e69eb4d9c3e30e20363a215563a2
2020-01-08 14:30:13 +00:00
Bonian Chen
5e65da0c2f [Settings] Apply proxy design to data usage
Enable proxy to subscription manager in data usage UI.

Bug: 141833767
Test: manual
make RunSettingsRoboTests -j ROBOTEST_FILTER=BillingCyclePreferenceTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=CellDataPreferenceTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageListTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageUtilsTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=MobileDataEnabledListenerTest

Change-Id: Id119738dc16ece8767c088b9a0794997e4b0334f
2019-11-11 13:03:03 +08:00
Raff Tsai
129c98bba1 Remove summary loader in some fragments
- Summary Loader only works in injected items, but those fragments
are not injected to Settings UI. The SummaryLoader class them are
useless.

Bug: 141653158
Test: robolectric
Change-Id: I1ca0bf5a1f417b7fe86b28e96aff7d4aee2cf2d3
2019-10-01 10:02:26 +08:00
Lei Yu
ded55a1401 Use new API to build NetworkTemplate
This CL is built to make CBRS show correct data usage, by merging
all subscriberId under same groupuuid.

Bug: 133865338
Test: RunSettingsRoboTests
Change-Id: I3c717d0f1a1b95aa21c2ccefe4d1cefb4d854cb5
2019-05-31 10:19:17 -07:00
Andrew Sapperstein
62a68d6edb Remove "data usage" from search.
Fixes: 131324402
Test: verified manually
Change-Id: Ib72902c3eaa1f2427e9c1c835ba2939f28cf7a0d
2019-04-26 10:23:02 -07:00
Doris Ling
9c2556da09 Query correct subscription id for mobile data.
- On the Data usage settings page, we check for valid subscription id to
determine if we should show the mobile section. However, we are querying
the default subscription id, which will return the 1st id for any
subscription if there's no data subscription. Since this is for mobile
section, we should query the default data subscription id explicitly.

Change-Id: I08c80639d07477e486a2d9a10761e11df4c73b28
Fixes: 119881046
Test: make RunSettingsRoboTests
2019-01-24 14:21:18 -08:00
TreeHugger Robot
ac73d4e721 Merge "Add data usage header to mobile network details page" 2019-01-19 07:17:33 +00:00
Antony Sargent
625787b391 Add data usage header to mobile network details page
As a part of the work for subscriptions UI improvements, we want to show
data usage information at the top of the mobile network details page,
and those details need to be specific to the particular subscription
we're showing details for, even if that SIM isn't the current default
one. This is useful for seeing data usage across your SIMs in dual-SIM
devices.

This CL adapts our already existing DataUsageSummaryPreferenceController
class so that if can be used on any fragment instead of just the
DataUsageSummary one, and changes it to take an explicit subscription
id instead of assuming it should use the default one.

Bug: 122670283
Test: make RunSettingsRoboTests
Change-Id: I41e307b0f32580c73b08adec7cabf01c96d7e835
2019-01-17 21:50:27 -08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Doris Ling
d9663b7822 Fix typo in getHistoriclUsageLevel()
Bug: 111751694
Test: make RunSettingsRoboTests
Change-Id: I523e43f60948e49e78d518a4eeb3ed2bf885f7bd
2018-10-05 14:22:07 -07:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
tmfang
27c84de325 Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors.

Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
2018-07-11 18:24:51 -07:00
Fan Zhang
af1552251f Add some pages to search index.
* Notification access page
* VR Listener page
* Feature flags in dev options
* QS Tile developer options
* User dictionary
* Billing cycle
* Some accessibilty pages

Bug: 70720645
Test: robotests
Change-Id: I4f7d3d65b2803cebf178ac345a79721232df707c
2018-07-11 16:39:29 -07:00
Fan Zhang
4560ab7a35 Add a few pages to search index.
- Data saver
- A few special permission access pages
   - Picture-in-picture
   - Premium sms
   - do not disturb access
- And a unrelated cleanup: move EmptyTextFragment from
  notification/ to widget/

Bug: 70720645
Test: robotests
Change-Id: I6a87f712bf81f9fd32fa9a3826fba851ca748409
2018-07-10 17:02:09 -07:00
Fan Zhang
cd21cb8def Remove DataSummaryUsageLegacy.
Change-Id: I8da039530cafe547008b434b6016add5f9383e94
Fixes: 109943959
Test: robotest/atest
2018-06-11 11:05:54 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Fan Zhang
289677f97f Switch from SI to IEC unit when formatting data usage bytes
- Created a new helper method DataUsageUtils.formatDataUsage() to
  format data usage bytes using IEC formatting.
- Switch from Formatter.formatFileSize() to DataUsageUtils.formatDataUsage()
  everywhere in datausage package.

Change-Id: I9323beed8bf5126b153fc9a3cdd9591c97ca6fd2
Bug: 76159924
Test: robotests
2018-04-12 09:52:35 -07:00
Jan Nordqvist
9eb43ddddf Fall back to Wi-Fi data display in data usage screen with no SIM.
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I06bf78e54119819be87e15baca7e5b6a241958cb
2018-04-05 07:58:23 -07:00
Tony Mantler
0fcd6cbaa8 Autogenerate SearchIndexableResources subclass
Bug: 77148954
Test: RunSettingsLibRoboTests RunSettingsRoboTests RunSettingsGoogleRoboTests RunArcSettingsRoboTests
Change-Id: I842c42c55014c3310070ef22bd4f0d9a70dfd804
2018-04-03 10:26:55 -07:00
TreeHugger Robot
00a2dcb8f9 Merge "Entity header: When screen scrolls, there should be shadow under the header." into pi-dev 2018-03-28 20:12:46 +00:00
Jan Nordqvist
4092b2193c Entity header: When screen scrolls, there should be shadow under the header.
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests

Change-Id: I5c1d9f463a57d48e258d67602fc4d1fbbdfaad60
2018-03-28 11:17:23 -07:00
Fan Zhang
0c8f8a8b46 Use custom drawable for Battery saver condition icon.
- Updated condition interface to use Drawable instead of Icon for icons.
- Converted all conditions to return drawable instead of Icon.
- Created a BatterySaverDrawable to draw a static battery saver icon.

Change-Id: Ie964f3439009c7658603a8ff352a05e964a0a795
Fixes: 76168403
Test: robotests
2018-03-26 17:50:27 -07:00
TreeHugger Robot
ce447d9191 Merge "Add back the data saver preference." into pi-dev 2018-03-22 04:56:35 +00:00
Andreas Terzis
446cd9db73 Add back the data saver preference.
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: Ia39cb62ec021ae568a76fed04776b5e531e63b36
2018-03-21 19:23:05 -07:00
Jan Nordqvist
ba1c53455a Fix entity header to "Hide" shadow of app bar unless scrolled.
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I3d23ac49365873361f23b0c7ab105f208d6a7ed7
2018-03-21 15:15:10 -07:00
TreeHugger Robot
d17e849775 Merge "Only show mobile data usage information when mobile data is enabled." into pi-dev 2018-03-21 18:29:21 +00:00
Jan Nordqvist
19375adb5a Only show mobile data usage information when mobile data is enabled.
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I4eb774120cbcf50f40d22c7c8c3caeb0eacbbed3
2018-03-21 09:13:02 -07:00
TreeHugger Robot
09d1588a07 Merge "Remove the overflow menu from the usage Appbar." into pi-dev 2018-03-21 00:44:09 +00:00
Jan Nordqvist
e22f79139a Remove the overflow menu from the usage Appbar.
In Data Usage screen, Above the data bar, Remove the overflow
menu (3 dots on top right of the screen) from the Appbar.

Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I4e8a5e54b1e5c573496ff2a76a5a80da38650f2b
2018-03-20 14:49:15 -07:00
Jan Nordqvist
637dc29fe9 In Network & internet screen, hide summary under Data usage when there is No SIM
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I4abd401aa9420b2b0090fac76991fe5067acc2e9
2018-03-16 14:29:33 -07:00
Jan Nordqvist
8a241f642e Change text layout of data usage string.
In Data Usage screen, Above the data bar, Change font size of number
In Data Usage screen, Above the data bar, Update text style of “GB used”
In Data Usage screen, Above the data bar, Add “GB left” aligned right of bar (not always shown)

Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I8accb16425283cf148ddb6b6646f92ff51a74b7c
2018-03-14 22:48:46 -07:00
Fan Zhang
f7843adabd More renaming in DashboardFragment
getPreferenceControllers() -> createPreferenceControllers() for the same
reason as in ag/3647936

Bug: 73668763
Test: robotests
Change-Id: I97670a91a2a38d1c844d1b9d37f4222c5e6f45a0
2018-02-23 16:56:30 -08:00
Jan Nordqvist
4fbe0f8354 Update DataUsageSummary to include carrier provided information.
This CL augments the existing data usage display with carrier provided
information about data usage and plans when available from the new
frameworks API.

Test: manual
Test: make RunSettingsRoboTests
Bug: 70950124

Change-Id: Idde1ff786e8c5dbc04e58ffbcc0fd18789682699
2018-02-08 10:13:42 -08:00
jackqdyulei
137ff28d5e Refactor the DataUsageBase
1. Create a new DataUsageBaseFragment extending from DashboadFragment
2. Mark DataUsageBase as obsolete
3. Make DataUsageSummary use DataUsageBaseFragment
4. Deprecated DataPlanUsageSummary since it has been used nowhere.

Bug: 72497434
Test: robotest still pass
Change-Id: Ic67a3c90649ae84086dc60b1457566be8727c54b
2018-01-25 12:33:24 -08:00
Fan Zhang
7a6726ecda Make LinearColorBar support RTL
- Move the class to widget package
- Remove a bunch of useless drawing

Change-Id: I82f840819c89eaf3cf9b7a87e56f1031989e3262
Fixes: 62700884
Test:  robotest
2018-01-17 14:39:06 -08:00
jackqdyulei
261c29c485 Add wifi metered controls in wifi settings.
1. Add it in wifi detail page
2. Add it in wifi dialog
2. Remove it in "Mobile network" page

Bug: 68030417
Test: RunSettingsRoboTests
Change-Id: I2e001c55f3c6c75a660e429732dfbece97b0ca9e
2018-01-09 12:44:51 -08:00
Fan Zhang
e0b0e9f902 Refactor help menu stuff into a controller
This is a clean up to action bar menu item pattern, we will use the same
pattern to build search icon on all pages in a later change.

Bug: 68814716
Test: robotests
Change-Id: Iedd3ec263e8ccb63ed75ec7a95b28c00878b1de4
2017-11-29 15:51:04 -08:00
Fan Zhang
cbc4218b9b Format data usage and data limit consistently.
The usage formatter's format flag is change to match data limt flag.

Change-Id: I37d3c8c7bc67a918c793f4799e060010d269834d
Fixes: 63581756
Test: robotests
2017-10-11 15:01:10 -07:00
Matthew Fritze
621c24861c Fix DataUsageSummary non-indexable keys
Indexing in DataUsage was not conventional, since it
blocked adding XML based on current sim status rather than
indexing everything and changing non-indexabe keys.

Manual merge for: ag/2631595

Change-Id: I7bb3cdb0f11772bbaefb6c21c61eb63bd0b17c7e
Fixes: 64193449
Test: robotests
2017-07-31 14:20:31 -07:00
Rajeev Kumar
e19cd4828e Data plan usage summary fragment.
Change-Id: I2d928d1b5313b723450c8f5a45ff944b99dc3d5d
Note: These changes are required for Data balance UI.
Bug: 62349208
Test: make RunSettingsRoboTests -j40
2017-07-18 14:52:58 -07:00
Rajeev Kumar
9664c1a55e Refactor few public static methods.
Move public static methods from DataUsageSummary to DataUsageBase.

Bug: 62349208
Test: make RunSettingsRoboTests -j40
Change-Id: I632f75f4c4f370fb225a9787267043fec20994e5
2017-07-14 14:01:02 -07:00
Jeff Sharkey
dc09269c81 Move "metered" persistence to WifiConfiguration.
For a long time we've had a nasty tangled dependency between Wi-Fi
and NPMS, since they both persisted different details for configured
networks.  As part of preparing for new carrier data plan APIs, move
the tracking of meteredness over to WifiConfiguration.

We've never really supported "unmetered" mobile networks inside the
framework, so remove the option to configure those flags.

Replace MeteredPreference.notifyChanged() with explicit listener
to avoid confusing an invalidation pass as expression of user intent
to change metered values.

Bug: 63391323
Test: builds, boots, Wi-Fi policy is upgraded
Exempt-From-Owner-Approval: No owner was found for changed files.
Change-Id: If8a6e12650d1d060a729ed1a80f07ebb65e0ffd7
2017-07-14 09:47:03 -06:00
Rajeev Kumar
8f425680ae Some cleanups in DataUsageSummary class:
1. Get rid of unused constants.
2. Fix typo in instance variable name.
3. Convert an instance variable to a local variable.
4. Use Java8 lambda for SummaryProviderFactory instance.

Test: make RunSettingsRoboTests -j40
Change-Id: I6cae055d6efd5e724bdd46e04b7077df610a72e9
2017-07-05 16:18:19 -07:00
Yoshinori Hirano
c55ca0bf56 Tell SIMs apart in Data usage settings in multi-SIM case
In multi-SIM case, multiple "Mobile" categories are shown in Data usage
settings. To fix this issue, SubscriptionInfo#getDisplayName() should be
used instead of "Mobile".

Fixes: 62779261
Test: manual - go to Settings > Network & Internet > Data usage

Author: Wu Qiang <qiang.x.wu@sonymobile.com>
Change-Id: I4d95eceb24efd78ea3f3782d3a613edd2cf37d65
2017-06-21 12:10:11 -07:00
Matthew Fritze
8b0ed39c11 Remove Network Restrictions duplicate from setting search
Bug: 33701673
Test: make RunSettingsRoboTests
Change-Id: I6b1aef6102811a6ad25d2da43993441c6e56006c
2017-05-16 14:35:19 -07:00
Matthew Fritze
2caaa7420d Remove search duplicates for Wifi and Bluetooth
Remove the master switch duplicates between the switch
and their targets. Only show the actual Wifi and Bluetooth
settings as search results.

Bug: 33701673
Test: make RunSettingsRoboTests
Change-Id: I226cc8db40a308bd9bcfacdd4fc6ae709fb809c5
2017-04-27 12:36:16 -07:00
Doris Ling
47ec3857a5 Update preference text for Network & internet screen.
- Add footer info to Hotspot & tethering
- Add summary text for Data usage -> Network restrictions
- Update summary for Hotspot & tethering -> Portable Wi-Fi hotspot
- Remove quotes from Wi-Fi summary

Bug: 36296257
Test: make RunSettingsRoboTests

Change-Id: Ibab61b089521a3339e660e9df0db0cd1b316712b
2017-03-21 18:00:59 -07:00