Commit Graph

15 Commits

Author SHA1 Message Date
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
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
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
Fan Zhang
841d1d5aab Show shadow when entity header starts scrolling.
- Add a controller to manage add/remove onScrollChangedListener to
  recyclerviews.
- When recyclerview on each screen is scrolled to top, set actionbar
  elevation to 0, otherwise set it to non-zero.
- When screen is moved to background, detach the listener.
- Use the controller in entity header.

Change-Id: Iecf194d885098c98c392810f62893ae9189f3936
Fix: 37670670
Test: make RunSettingsRoboTests
2017-05-22 17:16:24 -07:00
Fan Zhang
d7414259d0 Move entity header controller out of application package.
Bug: 37669238
Test: rerun robotests
Change-Id: I54eb30f28fa0a88a6f0b97b53f9f1408320b5ce0
2017-05-18 16:36:32 -07:00
Fan Zhang
f5bd885a1d Clean up settings_entity_header layout.
update layout view IDs, and controller variable names to be more
generic.

Fix: 36734470
Bug: 37669238
Test: make RunSettingsRoboTests
Change-Id: Ib80827ae3eae6d01a600068b4a8a44b239c32511
2017-05-18 16:35:27 -07:00
TreeHugger Robot
3c19120945 Merge "Properly set isInstantApp for power usage page" into oc-dev 2017-05-10 20:47:29 +00:00
Jesse Evans
78e3a051d8 Properly set isInstantApp for power usage page
Previously the app header was not properly configured to be aware
it was rendering an instant app. This change properly sets the value
and adds tests to ensure it is correclty set in the future.

Test: make RunSettingsRoboTests -j30
Bug: 37919863
Change-Id: I0cbe2cb03bcd44208408f68188387e53ae98d8fb
2017-05-08 15:53:47 -07:00
jackqdyulei
01e690e377 Only use PROCESS_STATE_TOP as foreground time.
There are some miscalculations in state FOREGROUND_SERVICE and
FOREGROUND, so we move them out of the foreground time for now.

We will fix it after O and may add them back later.

Bug: 37000096
Test: RunSettingsRoboTests
Change-Id: Ic3f2f7fa69e8a213895c601630d1cca94fd32220
2017-05-05 10:23:09 -07:00
Lei Yu
8f9f25c541 Merge "Add TtsSpan for formatted time." into oc-dev 2017-04-24 17:01:59 +00:00
jackqdyulei
f4c1cef322 Add TtsSpan for formatted time.
Talk back will read "Used for 3m" as "Used for 3 meters", but
it will read "Used for 3h 3m" correctly.

This cl add specific Ttsspan if the time only contains "minute"

Bug: 36379530
Test: Run SettingsRoboTests

Change-Id: I033575938cce24221980dddd9d66be4e18804541
2017-04-21 14:42:42 -07:00
jackqdyulei
34145705de Fix wrong voice call time in battery page
The voice call is belong to DrainType.PHONE, which is not an app.
This cl stop using method in BatteryUtils to calculate the time, since
that method should only be used for DrainType.APP

Bug: 37402819
Test: RunSettingsRoboTests
Change-Id: I3aa7366401e54df87ffe913af0dcb1bcd5abf110
2017-04-21 11:00:50 -07: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
jackqdyulei
5d2918a675 Add log for BatteryUtils
This cl add logs to get more data for app usage time.

Also refactor BatteryUtils to singleton pattern because we need
to extract package name from uid.

Bug: 36909166
Test: RunSettingsRoboTests
Change-Id: I6ede354035c46e46cb856b7cf57bd1b7ccbd6d4f
2017-04-07 11:18:39 -07:00
jackqdyulei
ddba966700 Revamp the battery usage details page.
This cl adds AdvancedPowerUsageDetail to show the usage details page.
The AdvancedPowerUsageDetail contains all the needed ui components:
1. App Header
2. Two buttons
3. Usage breakdown preference category
4. Power management preference category

This cl also adds preference controller for two buttons but the
detail implementation will be added in the following cl.

Following cl will also remove previous detail page.

Bug: 35810915
Test: RunSettingsRoboTests
Change-Id: I17f95d1288762094671c0f148fa73367e51f175e
2017-03-24 20:58:44 -07:00