Commit Graph

84 Commits

Author SHA1 Message Date
Doris Ling
01639b7504 Merge commit '071aa6b88bc1fb4ca0af0c67b89b4bf0c3ac5de0' into manual_merge_071aa6b88b
Change-Id: I06f6e1bf1bbff0ac2e5ea7200432e8edb66ee1e3
Test: make RunSettingsRoboTests
2017-05-12 15:51:11 -07:00
Doris Ling
071aa6b88b Merge "Change AppPrefLoader from AsyncTask to AsyncLoader." into oc-dev
am: d821a32b8e

Change-Id: If0208dec8535fe72b14f73f42eb56ecfd7c9d2f7
2017-05-12 22:06:32 +00:00
Doris Ling
2f02218493 Change AppPrefLoader from AsyncTask to AsyncLoader.
Showing the wifi data usage results in reaching the max number of
threads in the pool executor. Switching the loader implementation
from Async task to AsynLoader and use a single loader to get the
whole list of preferences instead of using a new task to create each
list element.

Change-Id: I0da19ca09031a7fa178970c192e12a99ab489145
Fix: 33820327
Test: make RunSettingsRoboTests
2017-05-12 10:34:20 -07:00
Fan Zhang
470caeaa80 Hide app info link for "All work apps" data usage detail
We should hide the link because "All work apps" is a meta app, it
doesn't point to any specific app, so app info link does not make sense.

Change-Id: I768786f2df5d05bbde0723e5585abcdbe875c652
Fix: 36542896
Test: make RunSettingsRoboTests
2017-05-12 10:21:33 -07:00
Sunny Goyal
77fca989a0 Merge "Using a common class for loading drawables and handling various badging" into oc-dev
am: d2561263a8

Change-Id: I2e8d795a9d94f068c988c57cdc7610421b62da96
2017-04-19 02:53:17 +00:00
Sunny Goyal
3b172d7b89 Using a common class for loading drawables and handling various badging
Test: make RunSettingsRoboTests -j31
Bug: 36591157

Change-Id: I4cb1d313920d5d8604fd79ff65b40e2dda180e2e
2017-04-18 21:34:13 +00:00
Fan Zhang
00a0978293 Update action bar style in app header UI.
am: be6fab0135

Change-Id: I51f4b7900fb1be6631b686915e02333db2df2e9f
2017-04-17 18:38:01 +00:00
Fan Zhang
be6fab0135 Update action bar style in app header UI.
- Update background color of actionbar
- Remove elevation of actionbar so it appears to be the same entity as
  app header.
- Add a shadow below app header view. We can't set elevation on app
  header unfortunately because that will add shadow all round the view,
  but we only want shadow below it.
- Updated app icon size/text size per to match UI spec.

Change-Id: I63d7fa42b859a008fa662aaf19848cd40529c2ff
Fix: 37207527
Fix: 37079248
Test: visual && make RunSettingsRoboTests
2017-04-17 09:30:40 -07:00
Robin Lee
27ae2bb1fe resolve merge conflicts of 86c72f7ea5 to oc-dev-plus-aosp
Test: make RunSettingsRoboTests -j
Change-Id: If6b87d1caa358335ce56201eab0ed8add8b339e9
2017-03-29 13:54:02 +01:00
tiansiming
40234f6fe2 Optimize code on get UidDetail in AppDataUsage
The class UidDetailProvider providers details about a specific UID,
we can directly  apply it here.

Optimize: https://code.google.com/p/android/issues/detail?id=237810
Test: for case TrafficStats.UID_REMOVED
1.add an new User
2.generate some data traffic under the new user
3.switch to the phone owner
4.delete the User added just now
5.go to Data usage and open the item "Removed apps and users"

    for case TrafficStats.UID_TETHERING
1.open tethering and generate some data traffic
2.go to Data usage and open the item "Tethering & portable hotspot"

Change-Id: I05aa522728b296d6c06580adf809f274491cdcea
Signed-off-by: tiansiming <tiansiming@xiaomi.com>
2017-03-28 22:13:53 +08:00
Doris Ling
f2cf2aea37 Remove code that check for dashboard feature.
- remove DashboardFeatureProvider.isEnabled() and all relating code
and tests.

Bug: 35764802
Test: make RunSettingsRoboTests
Change-Id: If7796677abc8904b7436525836d50cdef38e37a4
2017-03-07 11:15:03 -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
fdb833873a Use new app header in more screens.
- This covers app data usage settings, power usage details
- Addded helper method on AppHeaderController to build the header as
  Preference because every fragment needs to do this anyway.

Bug: 32442716
Test: RunSettingsRoboTests

Change-Id: I6d38321b867154f8fb5194b993d118bcdbbfedc9
2016-10-28 17:16:39 -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
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
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
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
3763b581a3 Fix crash in AppDataUsage
Better handling of detecting apps

Change-Id: I15644c8d28f394aeac021af856d0d755d7a986c6
Fixes: 29609311
2016-06-24 10:37:12 -04: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
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
Julia Reynolds
47beeec10b Null check.
Change-Id: I16dfe2cf265b4254aa69bc6165a8f72fc3954d7a
Fixes: 28531037
2016-05-17 16:14:10 -04:00
Jason Monk
f82b3afdd6 Don't crash on non-app data usage
Change-Id: Ib39fc280a892dea2e3e7cbe22339799ab51a6eca
Fixes: 28531037
2016-05-04 13:43:26 -04:00
Jason Monk
bc4e200a59 Don't crash on Settings data usage
Consider Settings uid (SYSTEM_UID) to be an app.

Change-Id: Ia5cc7897eafdf3d654e8a23715bd25502097bab8
Fixes: 28193076
2016-04-29 14:06:10 -04:00
Felipe Leme
85c63f348f Listen to INetworkPolicyManager events and update UI accordingly.
BUG: 27481520

Change-Id: I09c4c586188d754ddd3ac3dcb3903217842ea0a5
2016-04-20 09:17:14 -07:00
Felipe Leme
c2ef27faf4 Handle blacklisted apps on Data Saver whitelist.
When user blacklists an app for background data access, the
"Unrestricted data access" list should not display the whitelist toggle
option, but rather explain background access is turned off and offer the
option to open the app's data usage screen to turn it back on.

It still does not handle changed received by DataSaverBackend, so the UI
will be stale when the user removes a blacklist and navigates back to
the list.

BUG: 27481520

Change-Id: I9d0fa9f0180a69ce9bd1417921bf89ec3ba31f01
2016-04-18 13:14:01 -07:00
Felipe Leme
0628e33bf2 Add metrics for Data Saver actions.
BUG: 28166693
Change-Id: Ie435db66183ef645467ffa6cc7537d54d35cab31
2016-04-14 16:14:55 -07:00
Felipe Leme
2b131e58a7 Merge "Improvements on "App data usage" screen." into nyc-dev 2016-04-14 15:55:18 +00:00
Felipe Leme
4133fc1cb1 Improvements on "App data usage" screen.
- Don't disply whitelist toggle if app is blacklisted.
- Handle scenario where app don't have any quota usage.

BUG: 27481520

Change-Id: I0147025d6bba2d6deeda109aeebb296607550bd8
2016-04-13 15:35:27 -07:00
Nicolas Prevot
cda955072d Show the right icon and label for work profile in data usage.
Previously, it showed the icon and label of a random application.

BUG:26798809
Change-Id: I9d812943bdf6f99e87dfd9bb4a37b25644b8d18d
2016-04-12 20:29:22 +01:00
Jason Monk
3e19fc5600 Move temporary metrics constants to proto
Change-Id: I8fb3ac22df7bdc52039dd640f7696ebd32281f0b
2016-03-08 14:18:30 -05:00
Jason Monk
bd5eabe12e Fix background data setting being backwords
Bug: 27250166
Change-Id: Ia8ef4b0ab860e6c15d972a32c7918b2d54f7743b
2016-02-21 11:53:36 -05:00
Julia Reynolds
fe22e8998b Link to external settings activity from the app header.
Bug: 26288458
Change-Id: Ib7c723f23a09f2dbcb6c9738db8e455fb7b82462
2016-01-29 10:15:31 -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