Commit Graph

9 Commits

Author SHA1 Message Date
Doris Ling
9a3fd4f7f1 Merge "Move listening to brightness changes to onStart/onStop." into oc-mr1-dev am: d52c4482e4
am: eccb0fcff9

Change-Id: Ic62d580bad8d520e9a1ec942ab30c361df9e24aa
2017-09-28 02:07:04 +00:00
Maurice Lam
e18902ec67 Update Robolectric to 3.4.2
Bug: 66693279
Test: m RunSettingsRoboTests
      m RunSettingsRoboTests-jacoco
Change-Id: I9df619c3d68f0af2ee2ae944a15998275129f7c2
2017-09-22 18:34:00 +00:00
Doris Ling
308a2d93fb Move listening to brightness changes to onStart/onStop.
Currently, we register the brightness listener in onResume() and stop
listening in onPause(). When we launch the brightness selection bar, the
display settings is paused, and hence we don't get the brightness
update, and only refresh the percentage when the brightness bar is
dismissed.

Moving the listening logic to onStart()/onStop() instead, so that we
will get the updates all the time when the display settings is launched.

Change-Id: I6ed9c8485fdf7721374baff5cea5f7011b63d7ea
Fixes: 65981061
Test: make RunSettingsRoboTests
2017-09-20 15:36:14 -07:00
Doris Ling
dee1a22c45 Consolidate all wrappers used for testing.
- Add the wrapper package and move all wrappers to the wrapper package.
- Get rid of some wrapper interface/impl implementation and have a
wrapper class directly.

Bug: 65634579
Test: make RunSettingsRoboTests
Change-Id: Ic757d8f7bacfa7a034c7e692205bc1dc4b0e1de1
2017-09-14 18:24:49 -07:00
Doris Ling
c7d2d270ab Ensure that brightness level is within 0-100%.
Check whether the retrieved brightnesss value is out of range, and
adjust it if necessary.

Change-Id: Ieb1ccc03dcb9fa3e1ed192fcc3d217b84d4d316c
Fix: 63181935
Test: make RunSettingsRoboTests
2017-07-05 12:53:04 -07:00
Andrew Sapperstein
9f1e911759 Refactor test runner to use static list of resource paths
Previously everything lived in an inner class method of
SettingsRobolectricTestRunner. That method has now been turned into
a static method so that it can be called by other runners.

Bug: 62460102
Test: robotests
Change-Id: I6612b1f26404587301c534c8ba60e39d59d6c840
2017-06-09 09:21:26 -07:00
Doris Ling
2e4ff90f5a Listen to brigtness updates to update brightness summary.
- add content observer for brightness relates changes, and update the
brightness preference summary when changes occur.
- also check for VR mode and auto brightness mode when reading the
current brightness value.

Change-Id: I611ec77174ab45315ccbee2952bdbc2c9a9cd954
Fix: 37227609
Test: make RunSettingsRoboTests
2017-04-27 10:52:31 -07:00
Doris Ling
cf4a185aeb DO NOT MERGE: Revert "Add summary text to Display->Brightness level."
This reverts commit 03ee253701.

The change does not work properly and is causing confusion.

Bug: 36650108

Change-Id: I00acced742b20e215c869ed58eb8750c654f5742
2017-04-26 21:33:16 +00:00
Doris Ling
03ee253701 Add summary text to Display->Brightness level.
Get the current brightness level from settings provider and set it to
the brightness preference summary.

Change-Id: Ieb4fbc132ec120cf839548f64e9c5f5b52b2f9c2
Fix: 36650108
Test: make RunSettingsRoboTests
2017-04-03 15:26:30 -07:00