Commit Graph

32 Commits

Author SHA1 Message Date
Eric Rahm
802b922593 Revert "Test Fix SettingRobolectricTest Fail"
This reverts commit 818f77cd1f.

Reason for revert: Underlying issue fixed in ag/23454315.

Bug: b/275023433
Test: atest SettingsGlobalRoboTests

Change-Id: I1af272efd00b3c5bd35310512f5712d5d1c7d834
2023-09-11 13:38:36 +00:00
Rex Hoffman
3c961e1c0e Setup external/robolectric for SettingsRoboTests
Current failing tests: ab/I64100010182936387
Had to Ignore some of com.android.settings.accessibility tests, which will be fixed separately

Bug: 261728063
Test: atest SettingsRoboTests -- --test-arg com.android.tradefed.testtype.IsolatedHostTest:java-flags:-XX:CompressedClassSpaceSize=3g

Change-Id: I4a0cb992db924936826e0c9808accc78dddb5f30
2023-08-17 22:33:20 +00:00
Vincent Wang
818f77cd1f Test Fix SettingRobolectricTest Fail
Bug: b/275023433
Test: NA
Change-Id: If2dcb8f6c196327129ccc9375b190e394c994efa
2023-05-09 06:26:39 +00:00
Rupesh Bansal
bc255db77a Remove VR features from apps
Bug: 260555143
Test: atest com.android.server.power
Change-Id: I7d1938363dacb06f93cea69672a710ccbb76012e
2022-12-07 12:30:30 +00:00
Piotr Wilczyński
a26381aa85 Notify about brightness change when screen turns on
Bug: 216419091
Test: ROBOTEST_FILTER=BrightnessLevelPreferenceControllerTest m -j RunSettingsRoboTests
Change-Id: I35f4b81b325a7275ad7391aa631d183ddcbd8fe3
2022-05-03 13:51:55 +00:00
Daniel Solomon
76c18bae69 Update BrightnessInfo construction in tests
Update existing BrightnessInfo construction in
BrightnessLevelPreferenceControllerTest to account for a new
BrightnessInfo field.

Bug: 206857086
Bug: 212634465
Test: atest BrightnessLevelPreferenceControllerTest
Change-Id: I526c1b38f5aa8e048d98cf20af9717715ae39482
2022-01-17 18:24:13 -08:00
Daniel Solomon
5a02e48902 Update BrightnessInfo constructor usage
Bug: 200851199
Test: atest DisplayModeDirectorTest BrightnessLevelPreferenceControllerTest
Change-Id: I37593443b3d7eb314f8c4970711e4d4d6f39c6ea
2021-09-26 16:14:09 -07:00
Yi-Ling Chuang
eed791e238 Suppress shared axis transition on Brightness level
The brightness bar is a dialog activity. If the shared axis transition
is applied, we'll see an empty page appears with a seek bar on the top,
which is not ideal. Hence, suppress the transition to keep the original
behaviour.

Fixes: 189076430
Test: robotest and test on the brightness level
Change-Id: I1572c31f09d8c6bb3b2c906f6211ed9b97024439
2021-05-25 19:05:42 +08:00
Santos Cordon
8dcffb88cf Use new getBrighntessInfo() API for brightness
The slider and settings need to use the new brightness
api so that:
1) It can work for mutiple-displays that support brightness
2) Can work with high-brightness mode which can dynamically
adjust the brightness min and max.

Bug: 168210311
Test: Verify that slider can go to 100% with HBM on or off.
Test: atest com.android.settings.display
Change-Id: I01029e211f64f0a8598b1388dd3bb535eb0beb69
2021-04-23 05:28:54 +01:00
Fiona Campbell
bf6624b603 Fix displayed brightness value in settings.
Change BrightnessLevelPreferenceController to use float values for
brightness instead of the int system.

Change tests to use correct values and floats.

Bug: b/150099686

Test: m -j99 RunSettingsRoboTests
ROBOTEST_FILTER="com.android.settings.display.BrightnessLevelPreferenceControllerTest",  manual

Change-Id: I1a6e06b4f5532b641d766f770be351b8ca827664
2020-03-19 11:28:44 +00:00
James Lemieux
f1dade40d2 Use binary resource support in robolectric
The resources available to tests are now exactly the merged resources
located in the APK under test.

Bug: 74359828
Test: make -j56 RunSettingsRoboTests
Change-Id: I050db81a92decefea23314b5ec7a62f77ff4bb2b
2018-12-12 19:53:49 -08:00
TreeHugger Robot
a3738857da Merge "Add null check for vrManager" 2018-08-29 10:02:09 +00:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Rick Yiu
bad519d0a4 Add null check for vrManager
If VrManagerService is not started, vrManager will be null. Need
add check for it.

Test: robotests
Bug: 112064298
Change-Id: I899337bb5a996efffe82970fa690f2c5d59c1bb5
2018-08-28 16:03:40 +08:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Fan Zhang
ca44caa663 Merge "Update brightness percentage display logic to match sysui." into pi-dev am: 69d12406f0
am: e9045a7a41

Change-Id: I20c27b31caa7a44b6d114780a0b7b18206f75d12
2018-04-25 08:25:54 -07:00
Fan Zhang
1346b066bd Update brightness percentage display logic to match sysui.
The brightness raw value is in linear pace, we need to convert
it to gamma space to make it match the way sysui represents the
brightness level.

Bug: 73810208
Change-Id: Ic4551bbeff4a6af30f7af2871a79a7d797279edb
Fixes: 78173473
Test: robotests
2018-04-24 12:10:46 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Fan Zhang
234854cb04 Remove more wrappers in favor of new Robolectric support
Bug: 76167422
Test: robotests
Change-Id: Ic71a181bee6f90f25f9fa2a748cf708887495394
2018-03-30 15:58:14 -07:00
James Lemieux
22a39c2b93 Use external/robolectric-shadows/run_robotests.mk
This allows Settings to test against the latest framework changes.

Also replaced TestConfig with traditional robolectric.properties.

Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
2018-03-04 03:50:08 -08:00
Michael Wright
30b66159aa Change automatic brightness summary to absolute brightness.
The brightness slider now always represents the absolute brightness,
including when adaptive brightness is enabled. This changes the summary
of the brightness setting to reflect that.

Bug: 72627086
Test: ROBOTEST_FILTER=BrightnessLevelPreferenceControllerTest m -j RunSettingsRoboTests
Change-Id: I76eed8aa9ee88fe6b70e30d54bfc0d18d1141377
2018-01-29 16:52:47 +00:00
jeffreyhuang
cbfb099a40 Rename SDK_VERSION_O to SDK_VERSION
Test: make RunSettingsRoboTests -j40
Change-Id: I6715062d8addadda441e32809db1af55f15e3a90
2017-12-05 16:43:54 -08:00
jeffreyhuang
adc9d7fb4e Move display test package to sdk 26
Test: make RunSettingsRoboTests -j40
Change-Id: I88978ab800e845eda6c937bf890016d53928d4fd
2017-11-28 13:41:30 -08:00
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