Commit Graph

677 Commits

Author SHA1 Message Date
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
Bharath
7fe45b31db Add support to configure double line clock in lockscreen [2/2]
This keeps the Settings entry under Lockscreen Settings for
Double line clock to be configurable.

As a result, this is now consistent with previous Android versions.

Co-authored-by: Luca Weiss <luca.weiss@fairphone.com>
Bug: 277244307
Test: atest SettingsRoboTests:com.android.settings.display.LockscreenClockPreferenceControllerTest
Change-Id: I08121a1a658cb4045aa30d0bd93e18ca22c3db6d
2023-08-18 09:57:44 +05:30
Chaohui Wang
8e2ae547d6 Clean up FeatureFactory.getFeature()
Bug: 286764889
Test: m Settings
Change-Id: I7e472e6b0ca6b7a735c1b92742ddf06c545176fc
2023-08-08 08:41:48 +00:00
Chaohui Wang
2541381259 Fix references to resources for Settings
Bug: 293810334
Test: m Settings
Change-Id: Ie140278f492ef7e1c062ec1ecae2866c521a86aa
2023-08-08 01:56:05 +00:00
Ken Lin
b48d473d51 Merge "Settings crashed when changing the Screen Resolution" into udc-d1-dev am: a6f2464e8c am: 20c3a8ea29 am: 4bf3a373c3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24109923

Change-Id: I6c1ce63018bec83b0eb6068e08a70a2eeb6e2a5e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-19 06:34:48 +00:00
Ken Lin
4bf3a373c3 Merge "Settings crashed when changing the Screen Resolution" into udc-d1-dev am: a6f2464e8c am: 20c3a8ea29
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24109923

Change-Id: If7f9f875c96678833b3727edc84f6a8296f9e6ba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-19 05:51:05 +00:00
Ken Lin
face5b6c2a Merge "Settings crashed when changing the Screen Resolution" into udc-d1-dev am: a6f2464e8c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24109923

Change-Id: I5554e3263baf46c64ba2286a80e5cb83da5d4098
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-19 05:08:37 +00:00
Ken Lin
20c3a8ea29 Merge "Settings crashed when changing the Screen Resolution" into udc-d1-dev am: a6f2464e8c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24109923

Change-Id: I41d1c839032341387bbe05bea462258fb9caef18
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-19 05:05:28 +00:00
Ken Lin
c655c82ada Settings crashed when changing the Screen Resolution
Check if index is out of bound

Bug: 288256336
Test: Change to Full resolution, set Smallest width to 426 dp, then
switch to High resolution
Test: atest ScreenResolutionFragmentTest

Change-Id: Ida4128e76e097050b01deae91c9d669e58ab9e8f
2023-07-18 02:30:09 +00:00
Shivangi Dubey
b5a6c7a020 Merge "Add 'Stay unlocked on fold' toogle to settings" into udc-qpr-dev am: 8c68b0e7e2 am: 32d914ea56
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23832963

Change-Id: I340d008ea78939a614e8b33f83c212421d4388d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-17 16:48:24 +00:00
Shivangi Dubey
32d914ea56 Merge "Add 'Stay unlocked on fold' toogle to settings" into udc-qpr-dev am: 8c68b0e7e2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23832963

Change-Id: I1bd342d5e2649e13734aa504f461bf12a141c819
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-14 14:22:00 +00:00
dshivangi
8f4122ad5d Add 'Stay unlocked on fold' toogle to settings
Added 'Stay unlocked on fold' toogle to display settings. Enabling this
setting will allow user to keep their device awake after the fold the
device.

Test: atest StayAwakeOnFoldPreferenceControllerTest LogicalDisplayMapperTest
Test: manual
  Built and flashed foldable device and manually tested by
    1. unfolded device -> enable setting -> folded device
    2. unfolded device -> disabled setting -> folded devices
  Built and flashed non-foldable device and manually tested by
    1. Went to Settings -> display -> the toogle setting is not visible
Bug: 274447767
Change-Id: I35fbd0f5d1297ee6e14896e8f3be8301cda6622f
2023-07-06 11:42:35 +00:00
Chaohui Wang
2e4141e4ab Clean up AwareFeatureProvider from Settings
Bug: 287566056
Test: m Settings
Change-Id: I7f7f57809c55bf8824b427f0d4a232cacdbe88a7
2023-06-25 16:52:34 +08:00
Ale Nijamkin
dc6449157b Merge "Fixes nav stack issue." into udc-dev am: b5dda005fd am: 1e3ecf6352
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23573917

Change-Id: Iac1b92075d8113012e69bdc82462921191690ed1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-06 20:26:05 +00:00
Ale Nijamkin
d31487b529 Merge "Fixes nav stack issue." into udc-dev am: b5dda005fd am: 306421f87f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23573917

Change-Id: I6ca144e73e9d3e4465dcfd0325b57add2f61f426
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-06 20:23:19 +00:00
Ale Nijamkin
ef6f54982a Merge "Fixes nav stack issue." into udc-dev am: b5dda005fd
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23573917

Change-Id: I9248f9d94bbd8bbea16c93cd2a1a259fa43fa1d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-06 19:41:14 +00:00
Alejandro Nijamkin
6f9f3a4594 Fixes nav stack issue.
By marking the Intent that's being sent to WPP as "launched from
settings", the code in CustomizationPickerActivity can correctly
conclude that the multi-pane wrapper does not need to be applied to the
intent, preventing the odd "disordering" of the back stack in the bug.

Fix: 284809020
Test: manually verified, on a large screen device with a multi-pane
settings configuration, that going to Display > Lock screen > Shortcuts
and then swiping back off the left edge of the display correctly exits
settings instead of revealing an incorrect screen like it did in the
bug.
Test: also manually verified that the long-press on the home screena and
on the lock screen paths both open the right tab in WPP in settings
correctly.

Change-Id: Iac2b4e9fa5bab91b6a5251f1c51b4d21a0824f00
2023-06-05 16:02:17 -07:00
Evan Laird
930bee6167 Merge "Set default value of battery percent preference" am: 145caf7d4e am: b4d2e7da30 am: ff6f9337c8
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1719617

Change-Id: I6af1354602e15a80f8c101ccad9b84cb89ba8131
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-09 18:03:25 +00:00
Evan Laird
b4d2e7da30 Merge "Set default value of battery percent preference" am: 145caf7d4e
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1719617

Change-Id: I34fe8a73fb89283e44dd46c9c655f8db9353e41b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-09 16:37:47 +00:00
Mattias Nilsson
03a0bdd030 Set default value of battery percent preference
Read config_defaultBatteryPercentageSetting to set default
preference value for battery percentage in SystemUI.

Bug: 189235242
Test: Set resource and check device at boot
Change-Id: I6427a3b76f5641b387dc19f45e17b30820911e3a
2023-05-04 23:23:48 +00:00
Ioana Alexandru
e0a4a343c4 Fix AmbientDisplayAlwaysOn isSliceable.
I changed this method to return true in ag/22761786 thinking that it was
necessary (as per the example at
https://g3doc.corp.google.com/company/teams/apps-android-settings/howto/settings_slices.md#preference-controller),
but this breaks a test, so I'm rolling back that part of the change.

Fix: 279881487
Test: presubmit
Change-Id: I87716a0daf5face9a79f98353b49ea2166226279
2023-05-02 16:52:26 +00:00
Piotr Wilczyński
eef23f441c Revert "Back up the smooth display setting"
Revert submission 22741921-cherrypick-bug-211737588-lp9s6r5vn3

Reason for revert: b/279215664

Reverted changes: /q/submissionid:22741921-cherrypick-bug-211737588-lp9s6r5vn3

Change-Id: I9b50aa0e2c5a7d328c4aa70b049c37c81e49e89b
Merged-In: I9b50aa0e2c5a7d328c4aa70b049c37c81e49e89b
2023-04-27 16:13:03 +00:00
Ioana Alexandru
361ed50185 Merge "Add keywords for AOD setting." into udc-dev 2023-04-26 09:05:08 +00:00
Ioana Alexandru
e18a7140f3 Add keywords for AOD setting.
Used the WiFi slice for inspiration: ag/6793584

Also added "ambient" to the keywords, since "ambient display" is another
phrase used for AOD.

Bug: 279029717
Test: manually checked that the setting shows up when searching for
"aod"
Change-Id: I8a3a4a6635c9724565426b859722242d2bae9e49
2023-04-21 12:54:56 +00:00
Piotr Wilczyński
85d5e3efb8 Merge "Back up the smooth display setting" into udc-dev 2023-04-21 07:31:47 +00:00
Piotr Wilczyński
5c42659602 Back up the smooth display setting
- Convert "Smooth display" and "Force peak refresh rate" to a boolean. If they are a boolean, they can be backed up without being device-specific.
- Back up "Smooth display" and add a validator
- Upgrade the 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
Change-Id: Ib2cb2dd100f06f5452083b7606109a486e795a0e
Merged-In: Ib2cb2dd100f06f5452083b7606109a486e795a0e
2023-04-20 13:25:38 +00:00
Ken Lin
8809994fce Smooth Display description error
Correct max refresh rate

Bug: 278111301
Test: Settings > Display > Smooth Display (and read description)
Change-Id: I9c701596712606ebd9d7d5640edd7dc3135ff5c9
2023-04-18 05:24:14 +00:00
Varun Shah
4a5e0e5bc7 Update the default wellbeing package config.
defaultWellbeingPackage is now deprecated and should not be used.
Instead, point all references to the new systemWellbeing config.

Bug: 233363529
Test: atest AmbientDisplayAlwaysOnPreferenceControllerTest
Test: atest DarkModeCustomBedtimePreferenceControllerTest
Test: atest DarkModeScheduleSelectorControllerTest
Test: atest WhenToDreamPreferenceControllerTest
Change-Id: Ia55ce505c5010e401ec0dc18a2fed41d3a692c7a
2023-04-07 19:55:19 +00:00
TreeHugger Robot
8ae1abecc1 Merge "Moves lock screen shortcuts summary loading to the background." into udc-dev 2023-03-31 18:48:29 +00:00
Alejandro Nijamkin
d2fb185677 Moves lock screen shortcuts summary loading to the background.
To load the summary for the Settings > Display > Lock screen >
Shortcuts, we need to issue a binder/IPC call to query the content
provider that resides in the System UI process.

Previously, this was being done on the main thread. The thinking was
that it's critical to load this as soon as the Settings page is shown.
This results in ANRs, as per the attached bug.

The fix is to move the loading off the main thread and onto a background
thread.

Fix: 274788437
Test: unit tests updated
Test: manually verified that the summary is correct and that it updates
correctly after clicking on it, changing the lock screen shortcuts, and
going back

Change-Id: I41a5e883236de4f16c105f3930b8849538807f00
2023-03-28 12:05:18 -07:00