Commit Graph

36 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
3d62032fed [Settings] Query historical data in background
Move the query of historical data into background thread to avoid from
blocking other query operation in UI thread,

Bug: 141833767
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsagePreferenceControllerTest
Change-Id: I61e414d70136a0025ddd7373a4f34a99acb89510
2020-05-04 11:57:44 +08:00
Bonian Chen
38b0d3091d Merge "[Settings] Avoid mobile data usage init in WiFi usage" into rvc-dev 2020-04-28 12:50:18 +00:00
Bonian Chen
225db346b6 [Settings] Avoid mobile data usage init in WiFi usage
Avoid from initial in WiFi usage and update into mobile data usage after
refresh.

Bug: 151751844
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Change-Id: Ic6176952953ded9d47f1fc52c3f311e6568a5b90
2020-04-28 15:47:30 +08:00
Bonian Chen
260ad5c523 [Settings] Align data usage calculation
Align the calculation of data usage between
DataUsageSummaryPreferenceController and DataUsagePrefereneController.

Bug: 143996139
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Change-Id: I73de79b5cc298bf949827eda0a8bb0274089c016
2020-04-27 19:39:01 +08:00
Bonian Chen
87a4577472 [Settings] Support re-init DataUsageSummaryPreferenceController
Support re-init DataUsageSummaryPreferenceController without
re-constructing it.

Bug: 151751844
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Change-Id: If72a521c5fbaec8b8902fb80b13d9d0f07c716af
2020-04-24 11:35:44 +08:00
Bonian Chen
bc10c00149 [Settings] Support the display of data usage when SIM inactive
SIM can be inactive but remain existed within slot.
Therefore, change the design here.

Bug: 143996139
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Change-Id: I24ec529b120b2801f7b9089b07d32bdd1038883f
2020-04-23 19:53:46 +08:00
Bonian Chen
761a13700f [Settings] Code refactor for data usage
Code refactor

Bug: 151751844
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Change-Id: I22b323bae0b18cca26c62d047fdb504c012518b5
2020-04-23 11:01:34 +08:00
Bonian Chen
1a8d501d7d [Settings] Adopt TelephonyBasePreferenceController to data usage
Adopt TelephonyBasePreferenceController in order to better support DSDS.

Bug: 151751844
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Change-Id: I502b93f01b289b72989ad3167131cc0c598b1583
2020-04-22 12:38:11 +08:00
Bonian Chen
61b9714a34 [Settings] Fix DataUsageSummaryPreferenceControllerTest
Fix test case of DataUsageSummaryPreferenceControllerTest

Bug: 154562264
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Change-Id: I0b3366c86b0a621b9dda88bbcde6e118d37995b7
2020-04-22 10:39:42 +08:00
Bonian Chen
dcef423720 [Settings] Refactor test case DataUsageSummaryPreferenceControllerTest
Refactor test case of DataUsageSummaryPreferenceControllerTest

Bug: 141833767
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Change-Id: Ieb551a32d87c53cbd0765e19e710f1f0469da9d5
2020-04-21 15:08:27 +08:00
Bonian Chen
dcd92af0a1 [Settings] Access ProxySubscriptionManager within DataUsage
Redirect some SubscriptionManager access to ProxySubscriptionManager.
This will reduce some access latency.

Bug: 141833767
Test: manual
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Change-Id: I2cb30dd0570a09543a13ca01cf054ba2d18d70d4
2020-02-10 23:49:53 +08:00
changbetty
50d7506103 [Mainline] Removed non-formal API getAllSubscriptionInfoList to used in Settings
Bug: 147206736
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
      make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageUtilsTest
      make RunSettingsRoboTests ROBOTEST_FILTER=SettingsDumpServiceTest
Change-Id: Ie9c01afa2b128f8d296b160d3628ea1fb7176e59
2020-01-20 18:42:22 +08:00
Bonian Chen
31e07211d9 [Settings] Avoid from accessing createManageSubscriptionIntent(int)
Avoid from accessing
SubscriptionManager#createManageSubscriptionIntent(int).
Create a copy of source code into Settings.

Bug: 147334060
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Change-Id: Id44a6b214a8f5d378d7a536fbf984a0512e6a92d
2020-01-08 23:32:30 +08:00
Fan Zhang
71d793cc2a Format app data usage using IEC unit, not SI unit.
Fixes: 131924586
Test: visual
Change-Id: Iedbd15fb9c98a5c93089708e40175cbf5572eeda
2019-05-03 16:53:11 -07:00
cosmohsieh
976995fa36 [Passpointv2] Implement DataUsage header for Wi-Fi detail fragment
Change header to a data usage chart of the specified Wi-Fi network.

Bug: 124700353
Test: make RunSettingsRoboTests -j32 ROBOTEST_FILTER=com.android.settings
Change-Id: Ide08ffd5e97ced5fe54707562690155414598dac
2019-03-14 16:41:08 +08: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
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
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Matthew Fritze
f87a1f3f41 Establish permanently unavailable settings
Distinguish between settings which are permanently unavailable on
the device, and temporarily unavailable. This enables us to restrict
which setting slices are exposed in onSliceGetDescendants.

The primary changes in this CL are renaming:
"DISABLED_UNSUPPORTED" -> "UNSUPPORTED_ON_DEVICE"
to be more clear the the setting will cannot be accessed on the device, and,
adding a new enum to encapsulate settings which are currently unavailable, but
could be enabled in the future.

Also remove UNAVAILABLE_UNKNOWN. Devs should never need this enum.

Bug: 78910582
Bug: 79245656
Test: robotests
Change-Id: I58821a6cfd6134b3b351657b6edf5f74ead00643
2018-05-09 08:36:59 -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
0c36260db1 Merge "Do not use warning or limit to display "X B left" above usage bar" into pi-dev am: 3f59ce67b6
am: eff9d43739

Change-Id: I8af506c4d7be28f8b5a966f2d4f38aeb13994b85
2018-04-05 15:18:18 -07:00
Jan Nordqvist
bdd559a181 Do not use warning or limit to display "X B left" above usage bar
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I46f4f5f1cf6092038e49beaafe5aa6a19ffb0aa1
2018-04-05 13:22:06 -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
Jan Nordqvist
cd3f9e2a5e Fall back to Wi-Fi data display in data usage screen with no SIM.
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I06bf78e54119819be87e15baca7e5b6a241958cb
Merged-In: I06bf78e54119819be87e15baca7e5b6a241958cb
2018-04-04 15:58:53 -07:00
vincentpeng
665b16bbfc Change DataUsageSummaryPreference.setLimitInfo(String text) to take CharSequence
"CharSequence is more correct" than String.
Change method to take in CharSequence parameter and modify callers/tests.

Bug: b/74960034

Test: RunSettingsRoboTests:DataUsageSummaryPreferenceTest and RunSettingsRoboTests:DataUsageSummaryPreferenceControllerTest
Change-Id: Ic83bde57bafff8416c0bd86b1ff2beb44ea12d0e
2018-03-29 07:48:10 +08: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
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
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
Sundeep Ghuman
b673aaadc9 Merge "Change text for data warning and data limit." into pi-dev 2018-03-15 17:08:34 +00:00
Jan Nordqvist
7b352d271e Change text for data warning and data limit.
This change modifies the "data warning" text to show either nothing, only
warning, only limit, or warning and limit, based on which of the values are
set. It also remove the capitalization of the first letter of the texts.

Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest
Change-Id: Ifebb411b906719c6e2f343f48d825f7b6f17af53
2018-03-15 09:49:32 -07:00
Jan Nordqvist
9a65e5fec7 Set color of update line to red if update is older than six hours.
In Data Usage screen, out-of-date state

Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: Icf6fafe9ab61a2c1ac3fba2bebf3bd4407c0ecfe
2018-03-15 00:20:39 -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
Sundeep Ghuman
ea8d866337 Fix the ProgressBar in DataUsageSummaryV2 page.
Bug: 70950124
Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageSummaryPreferenceTest
Change-Id: I83f268c0824d9e3520899725fa572753e1de0814
2018-03-14 16:21:46 -07: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