Commit Graph

29 Commits

Author SHA1 Message Date
Doris Ling
d13b50b39e Remove the 2 seconds wait time to sync app data usage list.
- in v2, completely remove the asyn task to force update the network
stats since the network stats apis is actually not used.
- in v1, remove the 2s delay and only update the list when the asyn task
is done.

Change-Id: I10e887022d07fe38504036cbf3f12362eec939b3
Fixes: 119562454
Test: manual
2018-11-29 13:18:21 -08:00
tmfang
6e16b69887 Sync style of filter component in data usage
Settings have new filter component with settings style.
This CL replaced Spinner to SettingsSpinner in data usage page.

Change-Id: I212b6b6ed203f8bffd094c0180873060b93c39cb
Fixes: 117568930
Test: robotests, visual
2018-10-17 05:14:46 +08:00
Doris Ling
8e208c6516 Remove obsolete chart view widgets.
ChartDataUsageView and ChartNetworkSeriesView are no longer being used.
Remove them to avoid the need to maintain obsolete codes.

Bug: 117433810
Test: rebuild and make RunSettingsRoboTests
Change-Id: I0c99725500926083bee693c102a323d563647c3a
2018-10-08 14:18:50 -07:00
Doris Ling
654adf9c9e Use the loader to get usage data for each billing cycle.
Bug: 111751694
Test: make RunSettingsRoboTests
Change-Id: I4242687b404a290e81d43c505b9afbd2a07aafdb
2018-09-26 13:33:10 -07:00
Doris Ling
f7b8505948 Move hasReadyMobileRadio() to DataUsageUtils.
- move the method from DataUsageList to DataUsageUtils where other
utility methods are.

Bug: 111751694
Test: make RunSettingsRoboTests
Change-Id: If7176cb4278d568f890a0c94437c4483bbd472f9
2018-09-18 11:21:59 -07:00
Doris Ling
6127d9de4c Add DataUsageListV2 for showing network stats detail.
Initial step: simply duplicate the existing DataUsageList class.

Bug: 111751694
Test: make RunSettingsRoboTests
Change-Id: I4d48405cd127cccb041ba0457638337f6918ce2e
2018-09-17 10:19:39 -07:00
Doris Ling
22c078c8de Remove the deprecated class DataUsageBase.
- and update all its subclass to extend DataUsageBaseFragment instead.

Bug: 111751694
Test: make RunSettingsRoboTests
Change-Id: Ic5720af43082d8b39642b6a539515f3f20d32694
2018-08-30 14:16:13 -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
Stanley Wang
6fe0330bf7 Icon color of spinner updated
Change-Id: Iea7f5d5ec43360cf6114caf368fa8c93ce4cf95c
Fixes: 109843982
Test: manual
2018-08-02 15:20:51 +08: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
tmfang
99cc23d0da Settings Fragment Migration (Change imports)
This commit *only* changes imports and optimize imports.
We don't do anything else.

This patch can't compile pass and run test case.
We will update other patches to fix these problem.

Change list.

1. import android.app.Fragment; ->
   import androidx.fragment.app.Fragment;
2. import android.app.DialogFragment; ->
   import androidx.fragment.app.DialogFragment;
3. import android.app.ListFragment; ->
   import androidx.fragment.app.ListFragment;
4. import android.app.LoaderManager; ->
   import androidx.loader.app.LoaderManager;
5. import android.content.AsyncTaskLoader; ->
   import androidx.loader.content.AsyncTaskLoader;
6. import android.content.Loader; ->
   import androidx.loader.content.Loader;
7. import android.app.FragmentTransaction; ->
   import androidx.fragment.app.FragmentTransaction;
8. import android.app.FragmentManager; ->
   import androidx.fragment.app.FragmentManager;
9. import android.app.LoaderManager.LoaderCallbacks; ->
    import androidx.loader.app.LoaderManager.LoaderCallbacks;

Bug: 110259478
Test: Can't test it.
Change-Id: I0a3f98fff34a3494a839c3c42aeabcec3df2c8b3
2018-07-11 18:23:51 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
hjchangliao
e86eec0c07 Rename SubSettingLauncher.setTitle, add java doc
For make this method usage more clear,
setTitle(charSequence) rename as setTitleText,
add java doc: it is only for user generated string
setTitle(int) rename as setTitleRes.

Change-Id: I972cb6a8ff90873dfdc25c23f6dc3d68103c8e4e
Fixes: 78347436
Test: make RunSettingsRoboTests
2018-05-09 10:00:05 +08: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
Fan Zhang
681c073fdb Fix crash when launching mobile data usage page via intent.
Need to parse parameters from Intent if argument is empty or has no
parameter.

Change-Id: I23af434e1be794036dc711b72e0d9afa8bd65aa6
Fixes: 74235734
Test: robotests
2018-03-21 16:58:23 -07:00
Fan Zhang
b1d6c76b53 Migrate more settings to SubSettingLauncher
Bug: 73250851
Test: robotest
Change-Id: Ifc27b90d68bf4a907f169e19338e9b52ea5f9922
2018-02-18 21:10:03 -08: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
Fan Zhang
896f1b363c Reduce jank around loading view when opening data usage UI
Change-Id: I3d23d8160b046de8fe125ba0697b7b3d7786453c
Fix: 28181319
Test: robotests
2017-06-26 15:15:30 -07:00
Sanket Padawe
e96db834fb Update SubscriptionManager API by replacing 'id' & 'idx' with 'index'.
Bug: 35767068
Test: No build failure on update.
Change-Id: Ib7211a9d0c10a717bfd5a7b22b8bea2b3973d12f
2017-03-21 11:24:53 -07:00
Fan Zhang
917721c8d6 Listen to mobile data enabled flag change.
The listener is necessary to show/hide the gear icon on top of billing
cycle settings screen as user turn on/off mobile data from QS.

code cleanup: remove dividedCategory

Fix: 28066849
Test: make RunSettinsgRoboTests

Change-Id: I3b7075512042127fd711a8a70a572adfed069502
2017-03-16 15:08:49 -07:00
Lei Yu
59f36994ba Merge "Remove hardcode for textcolor in spinner item." 2016-11-14 19:07:49 +00:00
jackqdyulei
0a209093d1 Remove hardcode for textcolor in spinner item.
Remove the "android:textcolor" because "Android:textAppearance"
will set the textcolor to "?attr/textColorPrimary".
Set adapter has same theme as spinner, so view inside adapter
can be inflatered correctly.

Bug: 32592245
Test: screenshot
Change-Id: If7a78ede0a029aa9fcd8f9b324a423d477c65ad7
2016-11-09 17:57:00 -08:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Fan Zhang
6507613ebc Log visibility change for all fragments.
Bug: 30681771
Test: SettingsUnitTests

Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.

Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
2016-08-18 14:04:13 -07:00
Jason Monk
9dc9a0ebb3 Update data usage graph to use new graph ui
Bug: 27278313
Change-Id: Ia9e8598dcb970540877f7dac7061cfc55ed99d4d
2016-03-09 10:39:57 -05:00
Jason Monk
3e19fc5600 Move temporary metrics constants to proto
Change-Id: I8fb3ac22df7bdc52039dd640f7696ebd32281f0b
2016-03-08 14:18:30 -05:00
Jason Monk
764f45db91 Add data saver to settings
Bug: 22817899

Change-Id: Ic3055aa6a5baae1653db350313366f180c049cc7
2016-01-25 15:24:29 -05:00
Jason Monk
b37e2887d3 Update data usage UX
Update the UX and dig the data usage screen out of a huge whole of
technical debt.  Switch every to use Preferences rather than standard
layouts and ListViews.

Split data usage into several fragments, all separated.

DataUsageSummary:
 - Shows a summary of the 'default' usage at the top, this will be
   the default sim on phones, or wifi if it has it, or ethernet
   as last attempt to show something.
 - Also has individual categories for each network type that has
   data, cell, wifi, and ethernet. Maybe should look into bt though?

DataUsageList:
- Takes a NetworkTemplate as an input, and can only be reached from
  the network specific categories in DataUsageSummary
- Shows a graph of current usage for that network and links to
  app detail page for any app.
- Has gear link to quick get to billing cycle screen if available

BillingCycleSettings:
 - Just a screen with the cycle day and warning/limits separated
   out from the data usage.

AppDataUsage:
 - App specific data usage details
 - May need some UX iteration given lack of clarity in the spec

Bug: 22459566
Change-Id: I0222d8d7ea7b75a9775207a6026ebbdcce8f5e46
2016-01-19 13:55:26 -05:00