Commit Graph

39 Commits

Author SHA1 Message Date
Doris Ling
689bb2c27c Fix limit data usage dialog body not being translated.
- need to pass the resource id instead of the text when building the
dialog in order for it to react to language change.
- also remove the unnecessary set/get the body message in the dialog
creation since the msg id can be used directly.

Change-Id: I399dcda54961fac457fc5f0fad9082f2c1e1a2b2
Fixes: 77897157
Test: run i18nscreenshots
2018-04-19 16:35:28 -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
Andreas Terzis
903a92535a "Data Warn & Limits" pref. summary should be empty.
The "Data Warning & Limits" preference in the Data Usage screen
should not have a summary.

Bug: 77300376

Test: manual
Test: make RunSettingsRoboTests
Change-Id: Ic567e7451ac3ea102577ab96ccef3ce7de05d4ad
2018-04-05 15:22:31 -07:00
Sundeep Ghuman
5fc38ecae9 Add Data warning and limit footer text.
Bug: 70550124
Test: XML only change, visual inspection.
Change-Id: Iaea3f100051bb908b13ca6809463db7f01f8d92d
2018-03-13 14:21:36 -07:00
Victor Chang
03358c0cdf Revert "Don't use framework strings for formatting file sizes"
The previous revert ag/3403198/ is incomplete.

I just learned that "git revert" has memory.
"git revert" re-applied my previous incorrect merge conflict resolution
when I reverted the same change again.

Test: adb shell am instrument -w -e class
com.android.settings.utils.FileSizeFormatterTest
com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner
Test: make -j RunSettingsRoboTests
Test: manual. GB is shown in Settings > Network > data usage > tap at top
Bug: 70050030
Bug: 70005649
Bug: 36994779
Change-Id: Ia56f8aaf9b5048c102b4e480da0e84e90ee51360
2018-01-05 12:32:51 +00:00
Doris Ling
de603ea469 Add space around the data usage warning spinner.
Use a custom item layout for the data usage warning unit selection
spinner to make the touch target bigger.

Change-Id: I2d73dc3ab4c99cea8f8c791c8c1346240456d6aa
Fixes: 66414539
Test: visual
2017-10-05 00:12:43 +00:00
Steven Timotius
4ccfa7c163 Fix to show correct value for data limit setting
Bug: 64901297
Test: Manually set a value for data limit in Settings, verify text is correct
Change-Id: Ieec3ce39b55754b54caefd2be923afe9883682b1
(cherry picked from commit 72ebf8fe35)
2017-08-29 16:55:05 +00:00
Pengfei Zhao
7c52e51a9b Merge "Fix Settings crash when setting only decimal point to data usage warning" am: 3a2e327741 am: dfe237f2cf am: d1dbc81145
am: 76b1817685

Change-Id: If62e23d750b55a292852b2bda8ab46299a7e8aea
2017-07-18 20:42:02 +00:00
Pengfei Zhao
76b1817685 Merge "Fix Settings crash when setting only decimal point to data usage warning" am: 3a2e327741 am: dfe237f2cf
am: d1dbc81145

Change-Id: Ia9ac501c7d67bec0465f6019a1ba52ad863b6da0
2017-07-18 20:36:56 +00:00
Pengfei Zhao
dfe237f2cf Merge "Fix Settings crash when setting only decimal point to data usage warning"
am: 3a2e327741

Change-Id: Ic25c64da40b1accb9dce63a63462acd01664e054
2017-07-18 20:31:57 +00:00
Pengfei Zhao
c05a3a0227 Fix Settings crash when setting only decimal point to data usage warning
Settings app crashes when only decimal point (".") is set to
data usage warning because it is not a valid number.
To fix this issue, the decimal point should be converted to 0.

Fixes: 63787824
Test: manual - go to Settings > Data usage > Mobile data usage and then
               set only decimal point to data usage warning.

Change-Id: Iefb6a035ba6f17b8e0c89f79dbd397e2356fb19c
2017-07-18 06:50:18 +00:00
TreeHugger Robot
8a5a1b7419 Merge "Iterate NetworkPolicy towards SubscriptionPlan." 2017-07-15 19:57:01 +00:00
Jeff Sharkey
47f51fac35 Iterate NetworkPolicy towards SubscriptionPlan.
As part of getting Settings ready to roll towards SubscriptionPlan,
reduce references to NetworkPolicy internal fields.  All usage cycle
details are now obtained from an Iterator which converts to
SubscriptionPlan under the hood.

Bug: 63391323
Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Exempt-From-Owner-Approval: Bug 63673347
Change-Id: I0e1357eef092a328c05f6a709aba0f106554631e
2017-07-14 15:17:42 -06:00
Roozbeh Pournader
ded99003c4 Don't use framework strings for formatting file sizes
Modify various formatters to avoid using framework strings for
formatting file sizes.

Also update README instructions for running unit tests.

Bug: 36994779
Test: adb shell am instrument -w -e class com.android.settings.utils.FileSizeFormatterTest com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner
Test: make -j RunSettingsRoboTests
Change-Id: I4035f26d29408b64389892a4a2379b4823f8ac96
2017-07-12 15:58:21 -07:00
Fan Zhang
b2b6f7d20e Misc string updates
- Use BidiFormat wrap dp number
- Update billing cycle starting day string

Change-Id: Ifb57e3bb18ced72f91f30599a2ff7bcfa329630f
Fix: 37353209
Fix: 37657115
Fix: 38005987
Test: visual
2017-05-05 09:31:22 -07:00
Fan Zhang
293556d6b8 Revert "Display and parse numbers properly in all locales"
Bug: 37311645

This reverts commit 8648c5ed3d.

Change-Id: If26d07a59dd9e71813a2b48f3bee25516bfb0b75
2017-04-28 21:06:28 +00:00
Fan Zhang
8648c5ed3d Display and parse numbers properly in all locales
Change-Id: Iddf74fd6ed3139eede27733b69a31ce2fa7d1a92
Fix: 37311645
Test: make RunSettingsRoboTests
2017-04-19 14:30:19 -07:00
Fan Zhang
762c9f2488 Use consistent formatter to convert byte->MB->GB.
In data usage screen, displaying and setting data warning/limit should
use the same value to convert units.

Change-Id: Ic237203dbaf23cb0c99165d0055f259a30fd8cf9
Fix: 34204773
Test: RunSettingsRoboTests
2017-01-24 11:50:27 -08:00
Tamas Berghammer
5a638a6ad1 DO NOT MERGE: Revert "Update package names to work with the proto3 compiler"
This reverts commit fbd5f5fdce.

Change-Id: I769f7a0f509996ccc39fd1c628cad7e5ec1202bf
2017-01-18 19:28:11 +00:00
Tamas Berghammer
fbd5f5fdce Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
(cherry picked from commit 265d3c2a0c)
2017-01-11 11:28:10 +00: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
Stephen Chen
a88733aed8 Fix cancel button behavior when setting data limit.
Bug: 28563526
Change-Id: I574c4051bb19710409ca4cf4eeffef7be1a7d0ec
Fixes: 28563526
Test: make RunSettingsRoboTests
2016-09-27 13:11:46 -07:00
Fan Zhang
1e516287bd Add visibility metrics to dialogs.
Bug: 30681529
Test: adb logcat -b events | egrep "(sysui_|notification_)"
Change-Id: I199d2e1b2cb8588a562b46bb8128d8ece24952f0
2016-09-19 17:34:12 -07:00
Fan Zhang
661248cf3e resolve merge conflicts of 0ee60c0 to master
Change-Id: Id371c6f3687dc35f87c4a93f032bfc5ca87d15ab
2016-09-14 14:14:14 -07:00
Fan Zhang
7bd19b8891 Add ability to disable data warning.
- Add a preference to disable data warning.
- Disable data usage chart in summary page when data warning is turned
  off.

Bug: 26934313
Test: Manually turned on/off data warning and inspected UI.
Test: ag/1440361

Change-Id: I6d5b86b8502647781c52cf940f276e1969251b59
2016-09-14 09:22:43 -07:00
Matthew Fritze
14e9535fc8 resolve merge conflicts of e6431c7 to master
Change-Id: I9d3c5fd5c8b73add93894a21d2f17ed0ae442a32
2016-09-13 19:08:11 -07:00
Matthew Fritze
25437d7c61 Data Usage summary creates a dialog to change data warning level
Clicking the Data usage summary preference will open the same dialog
that billing cycle does to modify data warning level. The Dialog
was abstracted to be used outside of the Billing Cycle settings
fragment.

Test: Robo tests in next cherry-pick.

Change-Id: I70398d4656b6da4233b2bfa0da6ffa7402ead69b
Fixes: 26932938
(cherry picked from commit 9fad289ca9)
2016-09-13 12:56:45 -07:00
jackqdyulei
7a78213776 Make number in dialog highlighted
Bug: 28787910

Change-Id: Idf6767156c0a3dafffb62b9a41ee81f6a9712a2f
(cherry picked from commit c54973b8d8)
2016-08-19 18:49:05 +00:00
TreeHugger Robot
b0e8f67389 Merge "Log visibility change for all fragments." 2016-08-18 21:06:00 +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
Fan Zhang
d945f08aeb Load default data warning value instead of hardcode it. am: 688ad857e8 am: 2ef1750fff
am: ddb3407dd5

Change-Id: If031dc6ffb6fad840d514f16878a3421f358eee8
2016-08-18 00:06:42 +00:00
Fan Zhang
688ad857e8 Load default data warning value instead of hardcode it.
Bug: 30898071
Change-Id: I36f3669ca07862476c778aabb1290f3ceb3afc92
2016-08-16 14:14:21 -07:00
Matthew Fritze
9fad289ca9 Data Usage summary creates a dialog to change data warning level
Clicking the Data usage summary preference will open the same dialog
that billing cycle does to modify data warning level. The Dialog
was abstracted to be used outside of the Billing Cycle settings
fragment.

Change-Id: I70398d4656b6da4233b2bfa0da6ffa7402ead69b
Fixes: 26932938
2016-08-16 09:17:00 -07:00
jackqdyulei
c54973b8d8 Make number in dialog highlighted
Bug: 28787910

Change-Id: Idf6767156c0a3dafffb62b9a41ee81f6a9712a2f
2016-08-12 09:39:33 -07:00
jackqdyulei
f69aa8e6ad Fix the arbitrary limit numbers and number overflow problem.
Bug: 30560513

Change-Id: Ic36381cbf7e03d21e2ef8f9b7c76268386e5f40e
2016-08-10 13:52:10 -07:00
Jason Monk
a058ae0dda Fix cell data limit dialog title
Change-Id: I0303bc74bb7b0e46ed020d255baf2465c7db0fc5
Fixes: 27604216
2016-05-04 15:46:05 -04:00
Jason Monk
3e19fc5600 Move temporary metrics constants to proto
Change-Id: I8fb3ac22df7bdc52039dd640f7696ebd32281f0b
2016-03-08 14:18:30 -05:00
Jason Monk
e4897d939b Convert data usage warning/limit to a edit text + dropdown
Now choose between MB and GB, then type in the number for the limit.

Bug: 27238018
Change-Id: I049be2be3ded52a9ed87e57348ed87b82dbb819c
2016-02-21 11:39:42 -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