Commit Graph

23 Commits

Author SHA1 Message Date
Junyu Lai
e539db77c4 [MS49] Remove NetworkStats hidden Api usages
This includes:
1. Remove unused INetworkStatsService and NetworkStatsHistory.
2. Replace NetworkTemplate usages with builder.
3. Replace TrafficStats references to DataUnit.
4. Reimplement NetworkTemplate#normalize.

Test: make RunSettingsRoboTests
Bug: 204830222

  (cherry-picked from ag/16724040)

Change-Id: I8efecda5df403e9ed588daecd169cb3498d213a2
Merged-In: I8efecda5df403e9ed588daecd169cb3498d213a2
2022-01-28 13:08:52 +00: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
282a0d9222 Remove "v2" from the data usage version 2 code.
Change-Id: I8ede82029194d1a9a43d00a3de7ec1a8dd77d978
Fixes: 117420679
Test: make RunSettingsRoboTests
2018-12-04 18:24:37 +00:00
Doris Ling
c11666cc00 Remove data usage v1 code.
- remove all v1 code and the corresponding feature flag switch.

Bug: 117420679
Test: make RunSettingsRoboTests
Change-Id: Ib062c03c671b0f860698f5e5e153ab46d963175a
2018-12-03 11:12:50 -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
Doris Ling
27ee2f0865 Use the new network stats loader to get usage data for all apps.
- change to use the new NetworkStats.Bucket instead of
NetworkStats.Entry when iterating through the detail data.

Bug: 111751694
Test: make RunSettingsRoboTests
Change-Id: I305cc384320e4a72531d80dd9a00a3034ab12837
2018-09-17 15:02:06 -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
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
176ccd0c35 Clean up: fix incorrect @VisibleForTesting imports
Test: rebuild and robotests
Change-Id: I33d7ee1c0622c01f592920baaf01d44ad19d9a13
2018-07-13 13:08:53 -07:00
Doris Ling
73b6e19968 Disable the usage summary when there's no usage data.
- when the preference is initialized, check for the network's overall
total usage. If there is no data available, disable launching the detail
page.

Change-Id: Ie81a5471de134bac63dedd3c39f4afe44201efe5
Fixes: 74451774
Fixes: 35855928
Test: make RunSettingsRoboTests
2018-06-20 15:26:43 -07:00
Fan Zhang
cd21cb8def Remove DataSummaryUsageLegacy.
Change-Id: I8da039530cafe547008b434b6016add5f9383e94
Fixes: 109943959
Test: robotest/atest
2018-06-11 11:05:54 -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
Doris Ling
6784296248 Fix App data usage title not being translated.
- we need to pass the title resource id instead of the actual text in
the launch intent in order for it react to language change properly.

Change-Id: I72ccbe67411c9f4da328dd24671f4e71ab927851
Fixes: 77898325
Test: run i18nscreenshots
2018-04-19 16:09:58 -07:00
Fan Zhang
be30190362 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
Merged-In: I9323beed8bf5126b153fc9a3cdd9591c97ca6fd2
Fixes: 76159924
Test: robotests
2018-04-11 18:22:55 -07:00
Shawn Ding
a4d78e43c2 Fix data usage under Wi-Fi has title "Mobile data usage"
Fix "Wi-Fi data usage" in Wi-Fi section. (Settings -> Network & internet -> Data usage)

Change-Id: I6c4117db321af252a2c3061f554ffbe2f87a714e
Fixes: 76165354
Test: Manual test
2018-03-28 07:32:23 +08:00
Andreas Terzis
b8642b79c3 Rename “Mobile data usage” to “App data usage” & hide summary
In Data usage screen, rename “Mobile data usage” to “App data usage” &
hide summary.

Also, change the title of the new "App data usage" (old "Mobile data
usage") screen to "App data usage".

Test: manual
Test: make RunSettingsRoboTests
Bug: 70950124
Change-Id: Ide9bcb2a4b171edcd088d68275bacda1eb449afe
2018-03-14 11:03:21 -07:00
Fan Zhang
1f6d24a991 Get rid of direct usage of Utils.onBuildStartFragmentIntent
Change-Id: I87eb97d6da4cd4f99be5bcdb1e3e245eb1c7bd1c
Fixes: 73250851
Test: robotests
2018-02-20 09:42:31 -08:00
Doris Ling
4a01283309 Remove the feature flag for using new title.
- remove all code that check for the feature flag, and use the new logic
by default.

Change-Id: I7fbe60da84c1c0f35e7241402a71d2bc4cd300e6
Fixes: 64564191
Test: make RunSettingsRoboTests
2017-11-13 17:58:13 -08:00
Doris Ling
03a3b518de Update preference screen title.
- Add missing title to preference screen xml so that they will be used to
set the activity title when the fragment is launched.
- Also updated some incorrect preference screen titles.
- Overrides getTitle() in preference fragments that do not use the
preference screen xml.

Bug: 64564191
Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots
Change-Id: Id72d5ddf18f0962bc484de8bbd847a2e55d6371e
2017-10-25 11:02:07 -07:00
Rajeev Kumar
bc393be977 Some import cleanups.
1. Get rid of unused import.
2. Fix import order.

Change-Id: I278949d95242682fd277adc2c71bc892e58a8533
2017-07-06 17:19:50 -07:00
Fan Zhang
c6ca314c0b Log source with visibility change
- Add a method in VisibilityLoggerMixin to log visible event using
  LogMaker, which allows logging additional FIELD_CONTEXT field.
- In Utils.startFragment, add current page's metricsCategory as an extra
  to next page.
- In next page's onResume(), extract the previous page's metricsCategory
  and send it to VisibilityLoggerMixin.visible()
- Update all caller with additional paramters

Change-Id: I8e1f2597fa465b7d3aa16fa1d21c052a3219694a
Fix: 35359289
Test: RunSettingsRoboTests
2017-02-15 17:17:19 -08: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