Commit Graph

1528 Commits

Author SHA1 Message Date
Daniel Nishi
4ab4ff8bec Fix a flaky test.
If a test with an initialized fake factory was run before this test, it
passed. If it runs first, though, it would flake. By initializing the
fake factory in the test, it shouldn't flake anymore.

Change-Id: I3ecb7477b6b29d093059f01d5dc0124690fb15b3
Fixes: 62103876
Test: Robotests pass
2017-05-25 15:34:03 -07:00
jackqdyulei
0658dcd6fa Merge "Turn on power accounting in AOSP" into oc-dev am: 0a6d61883c
am: db42779cf1

Change-Id: Ie4db806a166c45a14cd3b8ed69be6405befcb64b
2017-05-25 04:04:47 +00:00
TreeHugger Robot
0a6d61883c Merge "Turn on power accounting in AOSP" into oc-dev 2017-05-25 03:57:29 +00:00
Fan Zhang
b84b9cc8e7 Merge "Recursively remove preference from screen." into oc-dev am: 7731b4244e
am: 4472d8af83

Change-Id: Ie8835c9789d959ce3d75b84b05d711f976bab56e
2017-05-25 03:28:15 +00:00
TreeHugger Robot
7731b4244e Merge "Recursively remove preference from screen." into oc-dev 2017-05-25 03:22:51 +00:00
Doris Ling
28068990d2 Merge "Listener to tether state change on Network & internet page." into oc-dev am: 1dead24890
am: be520a5f34

Change-Id: I31036a30605036e957b421727833b3a9830e4584
2017-05-25 02:37:59 +00:00
TreeHugger Robot
1dead24890 Merge "Listener to tether state change on Network & internet page." into oc-dev 2017-05-25 02:25:56 +00:00
TreeHugger Robot
f688c5612c Merge "Sort app list after smeared on screen" 2017-05-25 02:25:41 +00:00
TreeHugger Robot
2cc13a8206 Merge "Migrate settings robolectric tests to mockito 2" 2017-05-25 02:20:37 +00:00
TreeHugger Robot
0965a9ded4 Merge "Set correct uid when loading app icon in data usage UI." 2017-05-25 02:13:13 +00:00
Doris Ling
5bf5c8ac04 Listener to tether state change on Network & internet page.
User can navigates to the page and turn hotspot on or off from the quick
settings. Need to listen to the tether state updates to refresh the
summary for the Hotspot & tethering preference accordingly.

Change-Id: I7c6869b909306b09556e19cf7b7543ce9dcd890e
Fix: 38452559
Test: make RunSettingsRoboTests
2017-05-24 16:51:14 -07:00
Fan Zhang
17d63964c7 Set correct uid when loading app icon in data usage UI.
work profile apps belongs to a different user. Set the correct uid when
loading the icon so the work profile badge is displayed.

Change-Id: I2ed27d6b83c1b42961500dc8d63475bf1f7eabcd
Fix: 38372681
Test: make RunSettingsRoboTests
2017-05-24 16:04:23 -07:00
Maurice Lam
046400c2c4 Migrate settings robolectric tests to mockito 2
- Migrated ArgumentMatcher subclasses to lambdas
- Replaced any() with nullable() where tests were failing

Test: cd tests/robotests && mma
Bug: 38456058
Change-Id: Ice8c39b435c45b87f82dbbd9860e68f235314cf8
2017-05-24 15:14:31 -07:00
Fan Zhang
e84407f5c3 Recursively remove preference from screen.
The preference framework does not remove pref recursively. So when a
preference is nested in preference hierarchy, it's not safe to simply
call screen.removePreference(). We need to first find its parent and
remove pref from its parent.

Change-Id: Ic7fefa498ed71a8877d862845ddcc2d6d6034a55
Fix: 38507066
Test: make RunSettingsRoboTests
2017-05-24 21:21:00 +00:00
TreeHugger Robot
a935b3c030 Merge "Make "Battery usage" accessible at any time" into oc-dev 2017-05-24 19:19:55 +00:00
jackqdyulei
e379be8277 Add background activity action
Background activity action is designed for wakeup alarm anomaly.
This cl also change the parameter in anomaly action interface
from "packageName" to "anomaly"

Bug: 36921529
Test: RunSettingsRoboTests
Change-Id: Ibde69f351f81043641f228f0e74deaa2e230c08a
2017-05-24 10:28:28 -07:00
Matthew Fritze
1dd31158a8 Merge "Revert "Revert "Replace dynamic summary text for SettingPref""" into oc-dev am: ae0886c9f7
am: 934a04509f

Change-Id: Iff239e99df07cf425f650fbdb9cfb72a3fc40182
2017-05-24 17:18:58 +00:00
TreeHugger Robot
ae0886c9f7 Merge "Revert "Revert "Replace dynamic summary text for SettingPref""" into oc-dev 2017-05-24 17:12:35 +00:00
jackqdyulei
58406203e2 Make "Battery usage" accessible at any time
Before this cl, user could go to "Battery usage" page only if
related app has battery usage. This cl breaks this rule so we
could open "Battery usage" without battery data.

Bug: 38497822
Test: RunSettingsRoboTests
Merged-In: Ic53c33b7dcbac82de58f31cf96e0bd8fa54e53ea
Change-Id: Ic53c33b7dcbac82de58f31cf96e0bd8fa54e53ea
2017-05-24 10:12:13 -07:00
TreeHugger Robot
7226c9f4c4 Merge "Show app battery usage in correct user" into oc-dev 2017-05-24 10:49:12 +00:00
TreeHugger Robot
b11845096a Merge "Update Settings search result unique ids" 2017-05-24 04:48:45 +00:00
TreeHugger Robot
2cd55c1255 Merge "Misc fixes to search and UI." 2017-05-24 01:25:16 +00:00
TreeHugger Robot
987ee5338a Merge "Split loading process for battery header" into oc-dev 2017-05-24 01:22:25 +00:00
jackqdyulei
7932484fa9 Sort app list after smeared on screen
Then we could make sure the app list is sorted

Bug: 62035385
Test: RunSettingsRoboTests
Change-Id: I3fa3d6ffc5930cf011e382632143e459fdbc4369
2017-05-23 17:36:47 -07:00
Lei Yu
bce1ef6a00 Merge "Make "Battery usage" accessible at any time" 2017-05-23 23:24:33 +00:00
jackqdyulei
4a7c8d7125 Split loading process for battery header
This cl creates BatteryHeaderPreferenceController, which will first
load the battery level in ui thread(in displayPreference()), then
display the remaining time once we get the battery stats.

This is the best we can do to avoid ui flashing while removing the
animation

Bug: 38349587
Test: RunSettingsRoboTests

Merged-In: Ic3622bb73562ba42e69b37e5674a724c03c45f12
Change-Id: Ic3622bb73562ba42e69b37e5674a724c03c45f12
2017-05-23 16:21:33 -07:00
Lei Yu
cceeac9ae8 Merge "Split loading process for battery header" 2017-05-23 23:20:56 +00:00
jackqdyulei
1d51b3cc15 Turn on power accounting in AOSP
Bug: 38328724
Test: RunSettingsRoboTests
Change-Id: Ibb2691ffdf8581549a1e99f94a8dbaa849453742
2017-05-23 16:05:12 -07:00
Matthew Fritze
6efea1e624 Update Settings search result unique ids
- SearchResult stableIds are now DocIds from the database
- DocIds are data reference key's hash, when the key is not
empty or null
- Otherwise, DocIds are a hashcode from a set of fields.

Change-Id: Id36f7bf4ceaaa3a2bd326ecafbfe97fd0b247df2
Fixes: 37327194
Test: make RunSettingsRoboTest
2017-05-23 15:38:29 -07:00
Lei Yu
c29df373bc Merge "Add flag for wakeup alarm" 2017-05-23 22:22:23 +00:00
TreeHugger Robot
96a8dffafb Merge "Remove duplicates in Security Settings" into oc-dev 2017-05-23 22:13:38 +00:00
Matthew Fritze
c1e9f8787f Revert "Revert "Replace dynamic summary text for SettingPref""
This reverts commit 8061aaef62.
Test: make RunSettingsRoboTests
Fixes: 36101902
Change-Id: Ide74780153fc7f36d897f559c7a3c138190e3320
2017-05-23 22:04:58 +00:00
Fan Zhang
82be5f0c3f Misc fixes to search and UI.
- Use prefContext to create preference.
- rename "Gestures" to "Gesture shortcuts"
- Add search keyword to individual gesture settings so when search
  "gesture" they also show up.
- call super() for all getNonIndexableKeys() in search provider

Fix: 38327387
Fix: 36621897
Fix: 36685646
Test: make RunSettingsRoboTests

Change-Id: Ia5ddfeae08cb27c278dfb8d2376594e21d8f283c
2017-05-23 14:55:23 -07:00
Matthew Fritze
2078bc2358 Remove search2 package and put everything into search
Change-Id: Ie8651c79ef023f154cd7120a88a20f3481abce2b
Fixes: 38502743
Test: make RunSettingsRoboTests
2017-05-23 13:57:28 -07:00
jackqdyulei
fa4939bbc9 Add flag for wakeup alarm
Also hook up it to WakeupAlarmAnomalyDetector

Bug: 38233931
Test: RunSettingsRoboTests
Change-Id: Iceae37dcd2e6a6f1a044fa36efb416f11703c431
2017-05-23 13:34:17 -07:00
jackqdyulei
2a95a63466 Make "Battery usage" accessible at any time
Before this cl, user could go to "Battery usage" page only if
related app has battery usage. This cl breaks this rule so we
could open "Battery usage" without battery data.

Bug: 38497822
Test: RunSettingsRoboTests
Change-Id: Ic53c33b7dcbac82de58f31cf96e0bd8fa54e53ea
2017-05-23 13:30:15 -07:00
jackqdyulei
605dbc66be Split loading process for battery header
This cl creates BatteryHeaderPreferenceController, which will first
load the battery level in ui thread(in displayPreference()), then
display the remaining time once we get the battery stats.

This is the best we can do to avoid ui flashing while removing the
animation

Bug: 38349587
Test: RunSettingsRoboTests

Change-Id: Ic3622bb73562ba42e69b37e5674a724c03c45f12
2017-05-23 13:22:42 -07:00
TreeHugger Robot
45727458f9 Merge "Remove duplicates in Security Settings" 2017-05-23 19:17:28 +00:00
TreeHugger Robot
b53938ff29 Merge "Add summary text to Apps & notifications -> Notifications" 2017-05-23 18:48:52 +00:00
TreeHugger Robot
ef949e39dc Merge "Hook up the anomaly policy to wakelockanomaly" 2017-05-23 18:12:20 +00:00
TreeHugger Robot
4d815d93ad Merge "Add wakeup alarm anomaly detector" 2017-05-23 18:08:10 +00:00
Matthew Fritze
3a50f5c290 Remove duplicates in Security Settings
Duplicates:
- Location
- Scanning
- Encryption and Credentials
- Screen Pinning
- Device Admin Apps

Bug: 33701673
Test: make RunSettingsRoboTests
Change-Id: Id06b6d9e82769abfa31a0c3e9900bcebdbd0c13c
Merged-In: I91566b8fb7fdb3b39c8833a6fa8e52bbbf6507b6
2017-05-23 17:44:35 +00:00
Matthew Fritze
2e34a64a55 Remove duplicates in Security Settings
Duplicates:
- Location
- Scanning
- Encryption and Credentials
- Screen Pinning
- Device Admin Apps

Merge for ag/2247508

Bug: 33701673
Test: make RunSettingsRoboTests
Change-Id: I91566b8fb7fdb3b39c8833a6fa8e52bbbf6507b6
2017-05-23 10:43:14 -07:00
Doris Ling
929bc614de Add summary text to Apps & notifications -> Notifications
Share the summary provider for Apps & notifications -> Notifications ->
Notifications with Apps & notifications -> Notifications so that the
upper level also shows the corresponding notification summary.

Change-Id: Id6879d9a6b00237781320c18591703b3031c9627
Fix: 36376411
Test: make RunSettingsRoboTests
2017-05-23 10:15:26 -07:00
jackqdyulei
495de548bd Add wakeup alarm anomaly detector
Wakeup alarm count frequent is calculated by a / b, where
1. a: the total wakeup alarm count since the last full charge
2. b: total time running since last full charge
(include sleeping time)

This cl also has the following changes:
1. Move bunch of methods to BatteryUtils
2. Create type WAKEUP_ALARM
3. Add and update tests

Upcoming cl will make sure we get the threshold from
AnomalyDetectionPolicy

Bug: 36921529
Test: RunSettingsRoboTests
Change-Id: I4f7b85606df68b6057f6c7d3f3be7f9a9a747f1d
2017-05-23 09:49:14 -07:00
jackqdyulei
f6dca8a68d Hook up the anomaly policy to wakelockanomaly
Bug: 38233034
Test: RunSettingsRoboTests
Change-Id: Id8c13480e08f609a1ba9927ba35558f82664904c
2017-05-23 09:43:01 -07:00
Tony Mak
764e52c8cf Show app battery usage in correct user
Test: m -j RunSettingsRoboTests

Change-Id: I6c0f74b79468ee670f642edb0a50400c030d1925

Merged-In: I6c0f74b79468ee670f642edb0a50400c030d1925

Fix: 38447829
2017-05-23 12:24:04 +00:00
Tony Mak
5ab93ad700 Show app battery usage in correct user
Test: m -j RunSettingsRoboTests

Fix: 38447829

Change-Id: I6c0f74b79468ee670f642edb0a50400c030d1925
2017-05-23 10:37:38 +01:00
Lei Yu
6784e41977 Merge "Use BatteryStatsLoader in InstalledAppDetails" into oc-dev am: 37f6b7f751
am: 996adfeb29

Change-Id: I11d0c39a68428637ce12aaffaa2a4f1e49bb716e
2017-05-23 06:23:31 +00:00
Lei Yu
37f6b7f751 Merge "Use BatteryStatsLoader in InstalledAppDetails" into oc-dev 2017-05-23 06:16:44 +00:00