Commit Graph

30 Commits

Author SHA1 Message Date
Sunny Shao
77aa48fe0b [Catalyst] Migrate Brightness level
Test: atest DisplayScreenTest
Bug: 375895862
Flag: com.android.settings.flags.catalyst_display_settings_screen
Change-Id: Ia098e107e0e9f011db6742cc8d0ebecfc179cca6
2024-10-31 20:09:52 +08:00
Menghan Li
e0f734526d refactor(brightness suw): decouple auto brightness initialization logic for setup flow
The AccessibilitySettingsForSetupWizard class should not be responsible for managing the initial
logic of controllers, such as determining which controllers need to be dynamically added or updated
using setInSetupWizard APIs. This logic should be handled directly by the controllers themselves.

Bug: 311093618
Flag: EXEMPT bugfix
Test: atest AccessibilitySettingsForSetupWizardTest
            AutoBrightnessPreferenceControllerForSetupWizardTest
            AutoBrightnessPreferenceControllerTest
            BrightnessLevelPreferenceControllerForSetupWizardTest
            BrightnessLevelPreferenceControllerTest

Change-Id: I6065a10e72d002981c0f514543e6933d79c2aa1b
2024-09-24 05:41:23 +00:00
Roy Chou
042c8c7328 feat(brightness suw): add brightness preferences in suw
Add brightness level and auto brightness preference in
accessibility_settings_for_setup_wizard.xml. Since the flagging has not
be supported yet for non-Manifest resources, for now we add the
preferences by default, and update the preferece availablity status in
each preference controllers based on the flag.

Bug: 311093618
Flag: ACONFIG com.android.settings.accessibility.add_brightness_settings_in_suw DEVELOPMENT
Test: manually
      atest AccessibilitySettingsForSetupWizardTest
      atest AutoBrightnessPreferenceFragmentForSetupWizardTest
      atest AutoBrightnessPreferenceControllerTest
      atest BrightnessLevelPreferenceControllerTest
Change-Id: I350d99138bdd14bf28828a39e42f707b5b1066c1
2024-05-15 03:19:40 +00:00
Jason Chiu
0bd014c497 [Safer intents] Settings misc
To avoid implicit intents, make intents launch explicitly.

Test: build
Bug: 323061508
Change-Id: Ie19cbceb89842a75a180898abcce81b63c18d46c
2024-03-29 04:22:45 +00:00
Chaohui Wang
be49e61d0f Enforce BaseUserRestriction for DISALLOW_CONFIG_BRIGHTNESS
Fix: 329205638
Test: pm set-user-restriction --user 0 no_config_brightness 1
Change-Id: Icacf051789ea40d23cd29c16168fbeb204cf8f5b
2024-03-18 03:32:54 +00:00
Josh
58fe7197cd Added width specs when creating brightness dialog from settings
The new default width for brightness slider UI is half width when in
landscape mode. However for settings we want full width, now settings
will also send a boolean along with the Intent to start brightness
dialog activity, specifying that the width of the brightness dialog
should be full width.

Test: open settings->display. click or press "Brightness Level" and
check that the brightness slider UI takes the full width of the right
hand pane of settings
Fixes: 303633970

Change-Id: Id40112c652e518b14cf000c791b7965bbb0991cd
2023-10-19 10:36:11 +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
Fabian Kozynski
cbe9bebb8e Start brightness dialog in same task
That way, enter and exit animations can be overriden

Test: manual
Fixes: 210177675
Change-Id: I77c33a77e3128597bfe09d427ba0c06e7c78136e
2021-12-28 14:16:33 +00: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
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
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
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
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
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00
Juan Lang
777ed2535a Depend on SettingsLib's version of lifecycle and FooterMixin.
The implementations have been imported into SettingsLib. Setting's copy
can now be removed, which this change also does.

Test: Manually check battery status, which uses FooterMixin, looks OK.
make RunSettingsLibRobotTests && make RunSettingsRoboTests
     && make RunSettingsGoogleRoboTests
Change-Id: I6539605fdad80d156ff5ff249e68df4a1c412067
2017-05-12 11:10:46 -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