Commit Graph

81 Commits

Author SHA1 Message Date
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
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
a321946ac8 Fix help & feedback link in data usage summary screen. am: 9b52836251 am: 7568e120cf
am: dd387b6739

Change-Id: I7e8d85bcc2c599c61b3739f445756681b22a1ea8
2016-10-20 20:41:55 +00:00
Fan Zhang
9b52836251 Fix help & feedback link in data usage summary screen.
The fragment was not providing the correct string for help & feedback
button, causing no result page when user navigates to help article page
from actionbar overflow menu.

Change-Id: I076846c44d4fc95efea743f019a7ad4aab47f214
Fixes: 32291069
Test: manual
2016-10-20 09:13:36 -07:00
Fan Zhang
661248cf3e resolve merge conflicts of 0ee60c0 to master
Change-Id: Id371c6f3687dc35f87c4a93f032bfc5ca87d15ab
2016-09-14 14:14:14 -07:00
Matthew Fritze
932bb2ee02 resolve merge conflicts of a04bf12 to master
Change-Id: Ie8b93666d98832af510e76ec50af964e2460743b
2016-09-14 09:30:01 -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
10d7e4c060 Prevent Data Usage Settings crash on phones without cellular history
Refactored the logic to determine the data usage summary mark which now
correctly tests for null.

Bug: 30946416
Change-Id: Ida1281a771013fd807242f846edb4f2a9c0ccabb
Test: make RunSettingsRoboTests
2016-09-13 22:59:53 +00: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
Matthew Fritze
b42136ec8c Extract and refactor logic to determine the data usage summary mark.
Created a new controller for DataUsageInfo and add appropriate
unit tests.

Bug: 30946416
Change-Id: Ida1281a771013fd807242f846edb4f2a9c0ccabb
Test: Robolectric tests with target RunSettingsRoboTests
2016-08-23 12:15:16 -07: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
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
Roozbeh Pournader
0761a4bf06 Make strings for data usage easier to localize
The strings were complex to localize, especially since they used
formatting that needed to be carefully reconstructed for cases where
the amount of data appears in the middle of a string. Also, we
already had a localization for file sizes, which we should avoid
redoing, to minimize discrepancies.

Finally, we are now bidi wrapping the usage amount, as it may break
in the RTL locales otherwise, since the RTL locales may be using
Latin abbreviations for gigabyte etc that are LTR.

Since formatting needs to be applied to everything except the number
of units in the amount of data used, and markup should be avoided
since it will confuse bidi wrapping, the code carefully constructs
CharSequence templates that are then decorated with spans after
getting filled in.

Bug: 28747101
Change-Id: I18756b4de99eb551a51fe5e74d1c9cf505551f08
2016-06-13 15:34:00 -07:00
Roozbeh Pournader
3697dbeaa3 Use existing localizations for formatting data usage [DO NOT MERGE]
This partially reverts I5be9bb7ce3b11709117da698d6c03610f4e5e40e in
order to use existing localizations and also avoid hard to localize
strings.

Also, we now bidi wrap the usage value, since it may break in the RTL
locales otherwise.

Bug: 28747101
Change-Id: Ibc03632cccfe671164cfbb670a423ada1177db65
2016-06-09 13:25:56 -07:00
Jason Monk
aa5a8a6a4c Fix data usage format strings
Bug: 28747101
Change-Id: I5be9bb7ce3b11709117da698d6c03610f4e5e40e
2016-06-06 16:39:55 -04:00
Jason Monk
3f185ccbde Don't link to MobileNetworkSettings unless admin user
Change-Id: Id497952b48b92dfb834dd9ffbdd4b987dc96e9a2
Fixes: 26881900
2016-04-22 10:24:55 -04:00
Jason Monk
d0682d0363 Clean up CellDataPreference dialog problems
Bug: 26830672
Change-Id: I189f8b2120143ca9829feebd24cf2ee93a33f05b
2016-01-28 13:10:24 -05:00
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
Jason Monk
34de9f6bf8 Protect against missing subscriptions
Bug: 26676464
Change-Id: I428dd60e6774f7ca88423edb7a87e51ee8a7dadd
2016-01-21 09:43:35 -05:00
Jason Monk
71a2a4f89b Fix DataUsageSummary in no sim state.
Bug: 26676464
Change-Id: I7fad5240f1160a2eb38a7cff2ae2f1c9e40bc4d3
2016-01-20 11:33:46 -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