Commit Graph

706 Commits

Author SHA1 Message Date
Fiona Campbell
65ccea2e52 Even Dimmer for manual screen brightness mode
Bug: 338416256
Fixes: 331324279
Test: atest EvenDimmerPreferenceControllerTest

Change-Id: I039f90df1b77348cde543964905c0745c888413d
2024-06-10 11:16:31 +00:00
Roy Chou
535494eca9 Merge "feat(brightness suw): add brightness preferences in suw" into main 2024-05-15 07:25:06 +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
marcusge
24289fa084 [Contrast] Migrate contrast settings into Display
Test: local raven device
Bug: 333905689

Change-Id: Ie94633c23ebe024b8fb48d7ffebdd7b1dfa588da
2024-05-09 06:32:29 +00:00
Fiona Campbell
8443ce8f9a Set EvenDimmer to true by default
- Read from setting with true as fallback

Bug: 336476693
Test: atest DisplayServiceTests
Test: manual up/downgrade with settings / off

Change-Id: I5279db2b35af9e84057d8f89bbbe9f26c62237c6
2024-05-07 12:29:10 +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
tomhsu
32a501562c Fix crash due to incompatible type
fix: 331182785
Test: Manual test
Change-Id: I20c150845caad1c14cad35f661c31e36def968ac
2024-03-26 05:03:16 +00:00
Treehugger Robot
333b21c6d0 Merge "Disable even dimmer setting conditionally" into main 2024-03-25 12:59:59 +00:00
Fiona Campbell
4a401d4313 Disable even dimmer setting conditionally
- Disable even dimmer settings option if autobrightness is not enabled
  on the device

Bug:179428400
Test: manual

Change-Id: I8f7add839022fc7c27694fd8daa83a608cf2736a
2024-03-23 02:09:46 +00:00
tomhsu
7465e27d85 Enforce BaseUserRestriction for DISALLOW_CONFIG_BRIGHTNESS
- For Adaptive brightness

Fix: 330855652
Test: Manual test. see b/330855652
Change-Id: Iea848c9d92abdf152d3eb827fbe1fb141f4687d7
2024-03-22 11:50:22 +00:00
Chaohui Wang
21d5f4160b Merge "Enforce BaseUserRestriction for DISALLOW_CONFIG_SCREEN_TIMEOUT" into main 2024-03-18 05:43:44 +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
Chaohui Wang
77ecdc7c04 Enforce BaseUserRestriction for DISALLOW_CONFIG_SCREEN_TIMEOUT
Fix: 329202191
Test: pm set-user-restriction --user 0 no_config_screen_timeout 1
Change-Id: Icd35365f446296fb53b1068d278d4cf5fd25939e
2024-03-12 16:22:33 +08:00
Fiona Campbell
20909fa590 Merge "Create EvenDimmerPreferenceController" into main 2024-02-26 14:28:02 +00:00
Piotr Wilczyński
96343a9eff Refresh rate preference controllers aware of multiple displays
Set mPeakRefreshRate in the preference controllers to the highest refresh rate among all the modes of all the displays. It'll then be used to determine two things:
- if the setting is available
- the summary of the setting

This should only be done if the back up smooth display feature flag is enabled. If it's disabled, mPeakRefreshRate is passed to DisplayModeDirector and used for the votes. If the highest refresh rate of one display is 120 and that of the other is 130, we shouldn't set the vote to 130 for both displays. With the flag enabled, DisplayModeDirector figures out the highest refresh rate for each display.

Bug: 310238382
Test: atest PeakRefreshRatePreferenceControllerTest
Test: atest ForcePeakRefreshRatePreferenceControllerTest
Test: atest RefreshRateSettingsUtilsTest
Change-Id: I369927ba22df70958178505d8fc7c5747aaa8fdd
2024-02-23 18:01:22 +00:00
Fiona Campbell
836018788d Create EvenDimmerPreferenceController
- Create preference controller
- linked to even dimmer activated setting

Bug: 179428400
Test: EvenDimmerPreferenceControllerTest
Change-Id: I3ac6501c3d45399caeda96fe6a7dd4164439d1bd
2024-02-19 11:46:11 +00:00
chengfeitao
ffb6e7e21b SettingsGoogle: Add ContextualScreenTimeout
Store contextual screen timeout preference when the
corresponding switch is toggled.

Bug: 295232527

Test: atest ExternalSettingsProviderTest
Test: atest ContextualTimeoutPreferenceControllerTest
Change-Id: I093d180f4b11ebb806c4b1949ff5428520c8f40f
2024-02-12 23:14:40 +00:00
Beverly
78d5efebdb Update fold setting illustrations
Flag: ACONFIG fold_lock_setting_enabled TRUNKFOOD
Flag: ACONFIG com.android.internal.foldables.flags.fold_grace_period_enabled TRUNKFOOD
Test: manually check settings pages
Fixes: 319857292
Change-Id: If0e9b8ae9be29a65ce03b030105bf74e41ea845c
2024-01-31 16:05:43 +00:00
Sunny Shao
bee65b4109 Merge "Revert^2 "Nullability Annotations replacement"" into main 2024-01-10 08:35:06 +00:00
Sunny Shao
076ed573eb Revert^2 "Nullability Annotations replacement"
This reverts commit 19d1d3d15d.

Reason for revert: revert it because this is not the root cause.

bug: 316867690
Change-Id: I0f168dbb64044aa720202af7b1040afd4f028c9c
2024-01-10 07:34:01 +00:00
Piotr Wilczyński
c7de74ac4b Merge "Don't back up Smooth Display if feature flag off" into main 2024-01-05 12:48:32 +00:00
Beverly Tai
b996d0a4ea Merge "Add new folding grace period settings strings" into main 2024-01-03 13:48:42 +00:00
Piotr Wilczyński
369cfd8ea5 Don't back up Smooth Display if feature flag off
In the previous CL (ag/24838636), we decided to back up Smooth Display and Force Peak Refresh Rate even if the feature flag is off and then just convert the value in DisplayModeDirector based on the state of the feature flag. This was because it wasn't clear how to access the feature flag from the Settings module. This resulted in the feature partially working if the flag is off.

Bug: 313021502
Test: atest DisplayModeDirectorTest
Test: atest ForcePeakRefreshRatePreferenceControllerTest
Test: atest PeakRefreshRatePreferenceControllerTest
Test: atest SettingsBackupAgentTest
Test: atest SettingsBackupTest
Test: atest SettingsValidatorsTest
Change-Id: I3406bc5c5f49fe6102cdfe6934813a9c4073ac6f
2024-01-02 15:06:31 +00:00
Sunny Shao
19d1d3d15d Revert "Nullability Annotations replacement"
This reverts commit cf0501e4d7.

Reason for revert: b/317462033, it seems a flaky but revert it first.

Change-Id: Ie1d5e279cca6477fc17d8c27c1ecda8d7a6b2553
2023-12-29 02:28:24 +00:00
Beverly
20e48424d9 Add new folding grace period settings strings
Bug: 315219497
Flag: ACONFIG com.android.internal.foldables.flags.fold_grace_period_enabled DEVELOPMENT
Test: manually enable and see new strings (adb root && adb shell setprop
persist.fold_grace_period_enabled true && adb reboot)

Change-Id: Ie278b45e3928e1154f78066e71551fb5cac8a176
2023-12-28 17:24:58 +00:00
Jan Tomljanovic
6b4c754f5e Add auth challenge for increasing screen timeout.
We only require one auth after onStart(), and only for increasing the
timeout.

Test: atest SettingsRoboTests:com.android.settings.display.ScreenTimeoutSettingsTest
Test: also manually tested
Bug: 315937886
Change-Id: If4aed67736cd7545d3a518aadd8253ea6a9fae43
2023-12-20 21:53:56 +00:00
sunnyshao
cf0501e4d7 Nullability Annotations replacement
-- Replace the android.annotation.Nullable / android.annotation.NonNull
   with androidx.annotation.Nullable / androidx.annotation.NonNull

Bug: 316867690
Test: build pass
Change-Id: I0c1da55dfb09ece855151c47e0492d6f46538621
2023-12-20 08:50:09 +08:00
Peter Lin
f59044d827 Make the peak refresh rate with rounding
To ensure accurate comparison of peak refresh rates, it is essential
to consider the peak refresh rate after rounding. This eliminates the
risk of unexpected triggers that could activate the Smooth Display
settings UI.

Bug: 312121651
Test: check the settings with Smooth Display
Change-Id: I4cd68efbcf4fdb9d4664c96332901661a23f4f09
2023-11-30 13:16:08 +00:00
mxyyiyi
027db802fe Add power consumption footer in screen timeout page.
- show this footer when there's no footer about work profile
Screenshots:
[without work profile]: https://screenshot.googleplex.com/5pAD2xBvP6QSBvY
[with work profile]:  https://screenshot.googleplex.com/7BRd6ToAjFN9QZx

Bug: 300245790
Test: manual
Test: make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.display.ScreenTimeoutSettingsTest"
Change-Id: I6df018d7758fbec3277179358b17eb11fa1aee34
2023-11-24 17:11:15 +08:00
Chaohui Wang
08a1c9876e Revert^2 "Migrate to CompoundButton.OnCheckedChangeListener"
8979681a8d

Change-Id: I60edd3aabf49afbe4aa016af780baa68d928bddf
2023-11-07 14:17:15 +00:00
Sebastian Pickl
8979681a8d Revert "Migrate to CompoundButton.OnCheckedChangeListener"
Revert submission 25147565-onSwitchChanged-CompoundButton

Reason for revert: breaking builds 

Bug:309601476

Reverted changes: /q/submissionid:25147565-onSwitchChanged-CompoundButton

Change-Id: Ie746db87d9c642599593aa3d5e5baf6b7ba89c0e
2023-11-07 13:26:36 +00:00
Chaohui Wang
71d1f021af Migrate to CompoundButton.OnCheckedChangeListener
Switch and SwitchCompat are both CompoundButton.

Using CompoundButton in Java will helps migration in the future.

Bug: 306658427
Test: manual - check Settings pages
Change-Id: If2e08a9a9557ec66a3b31ef18cd2e15943098a59
2023-11-07 20:22:27 +08:00
Steven Ng
9ad7284d3f Check if the bedtime settings intent is null before launch
Test: make RunSettingsRoboTests -j56 ROBOTEST_FILTER=com.android.settings.display.darkmode.*
Bug: 306060498
Change-Id: Iddaec94c3a4cba74841d83305e581605c030bf33
2023-11-06 18:45:34 +00:00
Chaohui Wang
cfdb3b1f1b Migrate new() to SwitchPreferenceCompat
Bug: 306658427
Test: manual - on Settings pages
Change-Id: I258a8c63d5c46403c6d333a9d2f34c33cb35e27f
2023-10-24 14:05:34 +08:00
Chaohui Wang
15ca95a31b Migrate to TwoStatePreference
SwitchPreference and SwitchPreferenceCompat are both TwoStatePreference.

Using TwoStatePreference in Java will helps migration in the future.

Bug: 306771414
Test: manual - check Settings pages
Change-Id: I84e1d7b09451106797c2b23d127855c6976678ca
2023-10-23 09:28:57 +00:00
Joshua Mokut
7f25a5edb8 Merge "Added width specs when creating brightness dialog from settings" into main 2023-10-20 15:48:59 +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
Piotr Wilczyński
176a63a1db Back up peak refresh rate and min refresh rate
It's possible that in the future the peak refresh rate setting will have multiple values (e.g. 90, 120). For that reason, we shouldn't convert it to a boolean like in the previous CLs (ag/24604787, ag/24604847).

- set peak/min refresh rate to infinity if it's the highest refresh rate so that when we restore the setting on another device, we also choose the highest refresh rate
- back up peak/min refresh rate and add validators
- upgrade settings in SettingsProvider
- create a utils class - RefreshRateSettingsUtils

Bug: 211737588
Test: atest DisplayModeDirectorTest
Test: atest ForcePeakRefreshRatePreferenceControllerTest
Test: atest PeakRefreshRatePreferenceControllerTest
Test: atest SettingsBackupTest
Test: atest SettingsProviderTest
Test: atest RefreshRateSettingsUtilsTest
Change-Id: Ie1d8cfc76e42c7d98c4a36743463ccaf3ca5d483
2023-10-10 14:10:38 +00:00
Matt Pietal
9695477373 Merge "Add support to configure double line clock in lockscreen [2/2]" into main am: 3be411d513 am: 705507d68f am: 8d4d73f152 am: 9e233f3284 am: 84076896f6
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2539870

Change-Id: I361b6926ca06f22211048ad5738b58d3bf21c473
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 16:57:42 +00:00
Matt Pietal
84076896f6 Merge "Add support to configure double line clock in lockscreen [2/2]" into main am: 3be411d513 am: 705507d68f am: 8d4d73f152 am: 9e233f3284
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2539870

Change-Id: I91198eb53fda60d1f5801e5fa8512be2800304e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 16:26:27 +00:00
Matt Pietal
9e233f3284 Merge "Add support to configure double line clock in lockscreen [2/2]" into main am: 3be411d513 am: 705507d68f am: 8d4d73f152
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2539870

Change-Id: I9a436c40d689ad4db65a9ff9def5ea04c8115894
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 15:55:50 +00:00
Matt Pietal
705507d68f Merge "Add support to configure double line clock in lockscreen [2/2]" into main am: 3be411d513
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2539870

Change-Id: Ia1bfae20044369b8a8e463e21a2393cf9b6e9250
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-04 14:54:22 +00:00
Shivangi Dubey
097a9e736c Merge "Disable Fold lock behavior setting by default" into main 2023-10-02 10:00:10 +00:00
Chris Göllner
f09a5ce94c Start logging rotation lock history + include caller information
There have been a few reports on foldables where rotation lock suddenly
changed, without user interaction.
Adding these logs will make it easier to debug the issue.

Bug: 289023967
Bug: 289534937
Bug: 279685215
Test: Manually - Change rotation lock and check logs in dumpsys
Change-Id: I2a877e7b47c863871a2c6ba29ce46e63d28c8008
2023-09-25 17:55:06 +01:00
Peter Kalauskas
80e914a263 Enable use_resource_processor for all sysui deps
This will make the build faster

Test: m checkbuild
Bug: 295208392
Change-Id: If75acb6b1c3f204e3686c20cef609f7cfabe15cf
2023-09-21 23:09:39 +00:00
dshivangi
599130f235 Disable Fold lock behavior setting by default
Flag protect Fold lock behavior setting behind a sysprop flag.
The setting will be disabled by default and can be
teamfooded by enabling sysprop flag with prop name
persist.fold_lock_behavior_config.
Enable sysprop flag by running following command
* adb root && adb shell setprop persist.fold_lock_behavior_config true

Flag: persist.fold_lock_behavior_config
Bug: 298200843
Test: atest FoldSettingProviderTest FoldLockBehaviorPreferenceControllerTest
* Manually check if the setting accessible with sysprop flag true and
false.

Change-Id: I80e3ba4c544bbe20673b57fe8702e7f299c387a9
2023-09-21 18:11:44 +00:00
dshivangi
0f4ec2b1b7 Add illustrations to fold lock setting
Added illustrations to fold lock setting for all respective fold lock
setting values.
The illustrations can be found here: https://docs.google.com/presentation/d/1hSDuwaX0fqDSXO7LFmtgNcodaLftqUrgVT1cvfffp_Q/edit?resourcekey=0-ZJ0UdziPYZgD43a8I-cdIw#slide=id.g239e21e8ec8_0_0

Bug: 294194379
Test: Flash device with this change.
* Set diffrent values of fold lock setting
* Verify correct illustration is showed for respective setting value

Change-Id: I16af550b70e951d29bf5e0e2c9e8513473461528
2023-09-20 11:47:19 +00:00
Shivangi Dubey
00a78fca41 Merge "Refine fold setting" into udc-qpr-dev am: 26e14e09bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24314953

Change-Id: Iaf6c0514a406267de5924672b1e879a4dce3ce4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-06 15:06:39 +00:00
dshivangi
7435bbc70a Refine fold setting
Current fold setting has a toggle button which can enable the “Stay unlocked on fold” setting.
Create a new page for fold setting which will allow us to choose something from three options.(https://screenshot.googleplex.com/6W65aTYtigGpr3v)
 *Always - Front display turns on when you fold your device [Currently available setting]
 *Only games, videos, and more - Front display turns on for apps that stop your screen going idle [Default]
 *Never - Front display locks when you fold your device [New option for user]

Test: atest FoldLockBehaviorSettingsTest FoldLockBehaviorPreferenceControllerTest
*Manual
  Flash the build with these changes
  Manually select options one by one
  Observe the behavior

Fixes: 294194379
Change-Id: Ie5b4e1d7560ed645ec2ca5f49cc9715b17d21367
Merged-In: Ie5b4e1d7560ed645ec2ca5f49cc9715b17d21367
2023-09-06 10:52:12 +00:00
dshivangi
dc485887cc Refine fold setting
Current fold setting has a toggle button which can enable the “Stay unlocked on fold” setting.
Create a new page for fold setting which will allow us to choose something from three options.(https://screenshot.googleplex.com/6W65aTYtigGpr3v)
 *Always - Front display turns on when you fold your device [Currently available setting]
 *Only games, videos, and more - Front display turns on for apps that stop your screen going idle [Default]
 *Never - Front display locks when you fold your device [New option for user]

Test: atest FoldLockBehaviorSettingsTest FoldLockBehaviorPreferenceControllerTest
*Manual
  Flash the build with these changes
  Manually select options one by one
  Observe the behavior

Fixes: 294194379
Change-Id: Ie5b4e1d7560ed645ec2ca5f49cc9715b17d21367
2023-09-01 14:43:22 +00:00