Commit Graph

448 Commits

Author SHA1 Message Date
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
Felipe Leme
a1132e9f21 Replaced deprecated calls to INetworkPolicyListener.
Test: manual
BUG: 28791717

Change-Id: I23e08dc472d7d3d37f09e2811bb450e907b7bb1f
2016-09-02 17:52:19 -07:00
Felipe Leme
ce015fce0a Replaced deprecated calls to INetworkPolicyManager.
BUG: 28791717
Test: manual
Change-Id: I3df5214ead3b94f3ffa58e3ffad197a4ec09bef0
2016-09-02 16:28:07 -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
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
TreeHugger Robot
dfeb34c8a8 Merge "Data Usage summary creates a dialog to change data warning level" 2016-08-16 17:36:41 +00: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
Doris Ling
645aecde27 Fix crash when go to Data usage->Cellular data usage->Removed apps and
users.

Ensure that the user info is not null before using it to retrieve user
icon and label. If the user info is null, use the default label.

Change-Id: If402844d472a15f04c812f20c1c761b3a189a638
Fixes: 29619032
2016-08-15 18:27:55 -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
Fan Zhang
5df0fa467b Catch RejectedExecutionException when loading app data. am: c63d245779
am: b512c7a268

Change-Id: I2e47c831ab98a4a2c52c410817b8be12b4a0a250
2016-07-27 01:49:07 +00:00
Fan Zhang
c63d245779 Catch RejectedExecutionException when loading app data.
Default thread pool from AsyncTask can queue up to a certain number of
tasks. We will use a custom pool with enough queue size to load app
data.

Fixes: 30355247

Change-Id: I5ad4c340191c785463011c1698d1d4625aba44ec
2016-07-26 13:30:04 -07:00
Fan Zhang
3f86f04796 Don\\'t allow changing data usage setting if uid is not app. am: 2a84bbcddb
am: 2bf9591d92

Change-Id: I6be689791541d34b426cae577418a3daddf92280
2016-07-22 20:13:43 +00:00
Fan Zhang
2a84bbcddb Don't allow changing data usage setting if uid is not app.
Bug: 30262890

Changing non-app UID's (eg system, firewalld) data usage will just crash.

Change-Id: I1c3f2504aae75f514f962fd54f4dcf240b3bcd81
2016-07-22 10:07:12 -07:00
Jason Monk
14d52fb974 Fix crash in AppDataUsage am: 3763b581a3 am: 55f6f052e4
am: 0795570d00

Change-Id: Ic60b797671606527b1b2dbcc55ae42b8926fd7fb
2016-06-24 20:31:42 +00:00
Jason Monk
3763b581a3 Fix crash in AppDataUsage
Better handling of detecting apps

Change-Id: I15644c8d28f394aeac021af856d0d755d7a986c6
Fixes: 29609311
2016-06-24 10:37:12 -04:00
Felipe Leme
12c5efb645 Don\\\'t toggle Data Saver again until it receives a callback. am: 484caa3035 am: 78756838a7
am: 2180901e30

Change-Id: I9a5621ff61b75970116a5581d52af7d57626f1f8
2016-06-24 01:24:23 +00:00
Felipe Leme
484caa3035 Don't toggle Data Saver again until it receives a callback.
BUG: 29253107
Change-Id: I4371f947086a45be6709d2a560d27d1f5f0e79c4
2016-06-23 16:16:32 -07:00
Zoltan Szatmary-Ban
cf945c47d2 Fix non-app non-user preferences in Settings > Data usage am: afea1cae25 am: 63170fbf7a
am: 3b629c6918

Change-Id: Ib67f9492229f31332dc4b6bb46b3146be2928d17
2016-06-21 15:57:49 +00:00
Zoltan Szatmary-Ban
afea1cae25 Fix non-app non-user preferences in Settings > Data usage
Bug:29466113
Change-Id: Ib7a6d477146a856c0cb9c49143ffbf4fb99e38ed
2016-06-21 12:57:30 +01: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
bc75397385 Merge \\\"Fix data usage format strings\\\" into nyc-dev am: cb1972b908 am: 2c7e1d844f
am: 9667149282

Change-Id: I2dd2cc37911a466fd92811c37e334d6ef106f440
2016-06-08 19:30:49 +00:00
Jason Monk
aa5a8a6a4c Fix data usage format strings
Bug: 28747101
Change-Id: I5be9bb7ce3b11709117da698d6c03610f4e5e40e
2016-06-06 16:39:55 -04:00
Jason Monk
b0e3a1925a Merge "Don\'t allow restricted data usage of system" into nyc-dev am: da52f08b0a am: ef19af788c
am: 54ed02784f

* commit '54ed02784f15d66f9ad6ea67d27d348a167d83fb':
  Don't allow restricted data usage of system

Change-Id: I8b4142f0b395ba3b5bf907ac6181d9135ca3e8cd
2016-05-27 20:48:12 +00:00
Jason Monk
9b926c0bc6 Don't allow restricted data usage of system
Cause it will just crash

Change-Id: I4ee43633eb3fa488816b1d2767073cbe404c2c33
Fixes: 28979013
2016-05-27 10:57:10 -04:00
Felipe Leme
b0ee0f17de Merge "Fixed whitelist stats so it\'s only logged on add." into nyc-dev am: b103f4497d am: ddc0c42464
am: 3fe0957d62

* commit '3fe0957d62180f01b5b017f32808c80545909e2e':
  Fixed whitelist stats so it's only logged on add.

Change-Id: I3251bcbaeaf27a5b3805a8e09cdf421b9824e689
2016-05-23 14:00:07 +00:00
TreeHugger Robot
b103f4497d Merge "Fixed whitelist stats so it's only logged on add." into nyc-dev 2016-05-23 13:45:55 +00:00
Felipe Leme
6af9e6a8b4 Merge "Defined help page for Data Saver." into nyc-dev am: f8265a8f1e am: d21e63fe4b
am: 1d6d3723ba

* commit '1d6d3723bae00d0b6fd3f19dc63b0cb396bbc367':
  Defined help page for Data Saver.

Change-Id: I5061c9969b538ad3e5f08b6ce95ab6d190955866
2016-05-20 22:11:01 +00:00
Felipe Leme
f8265a8f1e Merge "Defined help page for Data Saver." into nyc-dev 2016-05-20 21:27:57 +00:00
Felipe Leme
746b384700 Fixed whitelist stats so it's only logged on add.
BUG: 28166693
Change-Id: If1f91167c21054e78a966670c20c174c3f73d2a5
2016-05-20 14:13:22 -07:00
Jason Monk
d814e2886d Merge "Protect against monkey crash" into nyc-dev am: d3ce331b94 am: cb0e0f9e30
am: 0d9fe2a14b

* commit '0d9fe2a14b515d257de11c042d5584e30374eb64':
  Protect against monkey crash

Change-Id: I382c9d82d6ad30c23c1753d99f6c361c91eb415e
2016-05-20 18:32:33 +00:00
Jason Monk
fd41b42487 Protect against monkey crash
When rebuild comes in after context is no longer valid

Change-Id: Ib64e93372bff4c6b0e1232ac257f3df0e9d0be0a
Fixes: 28875397
2016-05-20 14:15:10 -04:00
Felipe Leme
cf2c0b1b97 Defined help page for Data Saver.
BUG: 28865521
Change-Id: I07930232312df2775ecee5beacee6921f7245847
2016-05-20 09:08:28 -07:00
Julia Reynolds
29b7d0f73a Merge "Null check." into nyc-dev am: fc1bb74186 am: d6575bcee2
am: e16aed4db5

* commit 'e16aed4db52ab55f88bd01436336732c49b19a65':
  Null check.

Change-Id: I8231667d7c3c93d018a72b7f9f60e6f922880470
2016-05-18 14:15:11 +00:00
Julia Reynolds
fc1bb74186 Merge "Null check." into nyc-dev 2016-05-18 14:02:05 +00:00
Julia Reynolds
47beeec10b Null check.
Change-Id: I16dfe2cf265b4254aa69bc6165a8f72fc3954d7a
Fixes: 28531037
2016-05-17 16:14:10 -04:00
Felipe Leme
2d88dd7c42 Merge "Implemented onRestrictBackgroundBlacklistChanged()." into nyc-dev am: c769ddd330 am: 26e2c6bc26
am: fd122829ec

* commit 'fd122829ec0544d25f33c4842fc014fddcad9836':
  Implemented onRestrictBackgroundBlacklistChanged().

Change-Id: Idabaf686ef95056feb22396943046e13de9d7651
2016-05-17 18:50:42 +00:00
Felipe Leme
b2c4949de7 Implemented onRestrictBackgroundBlacklistChanged().
BUG: 28743623

Change-Id: I2d8620360858660fed0e745b16dc61ce262b90b9
2016-05-16 20:43:12 +00:00
Felipe Leme
85779c82be Merge "Removed onRestrictPowerChanged()." into nyc-dev am: 85f4269c9f am: 7fe77ae5db
am: cfe2bfd8b4

* commit 'cfe2bfd8b4ce35c684ddfe696e9f88a270d59b55':
  Removed onRestrictPowerChanged().

Change-Id: I312a9a17609741ab5725e3e2ba409eb9e63b30f7
2016-05-13 17:38:35 +00:00
TreeHugger Robot
85f4269c9f Merge "Removed onRestrictPowerChanged()." into nyc-dev 2016-05-13 17:14:12 +00:00
Felipe Leme
c3534bb963 Removed onRestrictPowerChanged().
BUG: 28521946

Change-Id: Ib48030c704cf38541101b600b1e91935302beb9c
2016-05-10 23:21:29 +00:00