Commit Graph

37 Commits

Author SHA1 Message Date
Lucas Silva
9c4dba40b4 Add posturing dream trigger to Settings UI
Adds ability for users to select posturing as the trigger for when
dreams will be shown.

Bug: 383208131
Test: locally - mp droid and verified posturing option is displayed in
Settings
Flag: android.service.dreams.allow_dream_when_postured

Change-Id: Iae69b9e488181b1e2af7474e3e9879a92b51274c
2025-01-08 14:59:58 -05:00
Prince
8b02d17db8 Toggle Home controls when user selects Home Control Panel Dream
Test: DreamSettingsTest
Flag: ACONFIG android.service.controls.flags.home_panel_dream STAGING
Fixes: 323887821
Change-Id: Iba7c2ff41e3e0074a28f96c4e5fa1028b80f7a92
2024-03-13 14:51:07 +00: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
Darrell Shi
ecc9213a45 Merge "Hide "additional info" when active dream does not support." into tm-qpr-dev am: 6b6c68fd94 am: d8f61dc2a3 am: 8ba70d32e2 am: b319e78682
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21452841

Change-Id: I1349f0bc03740f277f2d7ab8e4a38fc9c1929fc9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 12:34:23 +00:00
Darrell Shi
8ba70d32e2 Merge "Hide "additional info" when active dream does not support." into tm-qpr-dev am: 6b6c68fd94 am: d8f61dc2a3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21452841

Change-Id: I097729dd0420387e67d8aa7eba9642c4834330d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 12:12:28 +00:00
William Leshner
ef5b93d05d Merge "Restrict screen saver settings searches to enabled users." into udc-dev am: 01dfbcc297 am: c60c7e70a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/21486654

Change-Id: Ia3ba4a7764b2f2a3f1a4320a4db9d13afd9d4df3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-27 18:33:51 +00:00
Will Leshner
ca1379f0b3 Restrict screen saver settings searches to enabled users.
If a user can't enable screen saver, they shouldn't be able to
accidentally find screen saver related settings in Settings.

Bug: 260276394
Test: atest ScreenSaverPreferenceControllerTest
Test: manually by settings up a second user on a device that supports
screen saver, switching to that user, and making sure that searches for
"screen saver" don't accidentally reveal settings that can't be
accessed.

Change-Id: If2f465b2acb548455f0868507cf47217ea1a626f
2023-02-24 15:36:48 -08:00
Weiyue Huang
edfd262be2 Prevent the screen reader box from unexpected scrolling in dream setting
page.

Bug: 228355186
Test: manual
Change-Id: I66a70d6b12bd3a2766e6879cb27c68a851d1dd87
2023-02-21 14:14:14 +08:00
Darrell Shi
86113ae01f Hide "additional info" when active dream does not support.
Only show the "additional info", which displays dream complications,
when supported by the user selected dream.

Test: make -j86 RunSettingsRoboTests
ROBOTEST_FILTER="com.android.settings.dream.DreamSettingsTest"
Test: verified on device switching between different dreams
Bug: 223860510
Fix: 223860510

Change-Id: I63872ea9ab9f42be47f8e2f7c3835b55056e6588
2023-02-17 00:40:02 +00:00
Darrell Shi
d1f5edfc78 Update screensaver preference summary when on.
The summary for screensaver preference is updated to, e.g. "On / Art
gallery".

Bug: 261907383
Test: 'make -j64 RunSettingsRoboTests \
ROBOTEST_FILTER="com.android.settings.dream.DreamSettingsTest"'

Change-Id: I40483f266c42a6e49e513208ba513d469d67f85a
Merged-In: I40483f266c42a6e49e513208ba513d469d67f85a
2022-12-09 17:36:01 +00:00
Darrell Shi
adb864a784 Update screensaver preference summary when on.
The summary for screensaver preference is updated to, e.g. "On / Art
gallery".

Bug: 261907383
Test: 'make -j64 RunSettingsRoboTests \
ROBOTEST_FILTER="com.android.settings.dream.DreamSettingsTest"'

Change-Id: I40483f266c42a6e49e513208ba513d469d67f85a
2022-12-09 17:33:47 +00:00
Lucas Silva
11a5067ee5 Update the "When to dream" settings am: 47d84b41ac am: 0e7f4d87ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20302008

Change-Id: Id60e4ff240602ef42905a5af46f0ac77bde17f9c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-28 21:07:21 +00:00
Lucas Silva
47d84b41ac Update the "When to dream" settings
For devices which don't support dreaming on battery, we can offer
simpler options since the device must always be charging for
screensavers to appear. Therefore there are only two options:

1. While charging
2. While docked and charging

Test: flashed and verified on device
Test: make -j64 RunSettingsRoboTests
Fixes: 226187572
Change-Id: I6ed24cda8874f2fb941f6cfded9ed97ed78a3cb6
2022-10-28 13:07:36 -04:00
Kweku Adams
5949fccc7a Remove duplicate strings.
"Yes" and "no" were redefined many times with no clear benefit, so this
consolidates them into one definition.

Bug: 243843096
Test: Build, install, and open the Settings app
Test: atest SettingsRoboTests
Change-Id: I5f84d09f223efd478461ded93aeac82bf7b128d8
2022-08-26 00:07:08 +00:00
Lucas Silva
d8b90650d3 Update dream settings categories, to fix padding.
The extra PreferenceCategory is adding some unnecessary padding, so
removing it. Instead of using a preference category to enable/disable
all items, we just iterate through all the preferences when
enabling/disabling items.

Bug: 227139218
Test: locally on device
Change-Id: I403295fbccb7b135b7d603cd1fc713c4c0189569
2022-04-14 18:59:53 +00:00
Lucas Silva
d9071dea25 Add master toggle to enable/disable screen savers
The new control toggles the Settings.Secure.SCREENSAVER_ENABLED setting,
which controls if a screen saver is enabled. Also removed the "Never"
option from the WhenToDream picker, since this is now controlled via the
toggle.

Test: locally on device
Bug: 222360260
Change-Id: Ibcf52b5e2d1ad0c295f32c4c18bfc89082d074ce
2022-03-08 10:27:59 -05:00
Lucas Silva
75c44cd02b Update dream settings UX to match latest mocks.
Updates:
- removed individual complication toggle
- added single toggle which enables/disables all supported complications
- updated colors to match mocks
- updated grid padding in order to line up with existing content. Note:
  this required more complex padding logic, using an item decorator to
  apply the padding only to inner grid elements.
- updated preview image, removing view nesting to make better use of
  ConstraintLayout
- Updated some strings to match mocks

Test: locally on device
Bug: 217555053
Change-Id: I573e5f4ed807cbe2ae9e00f183d402e6e3339590
2022-02-15 17:32:01 +00:00
Lucas Silva
12945af711 Implement floating dream preview button.
Bug: 217556080
Test: locally on device
Change-Id: If76dce6a250fc5fc37d26fc3d7a31775333055d7
2022-02-10 20:42:12 +00:00
Lucas Silva
f0f7adc612 Implement dream complication settings.
This component allows the user to select dream complications to
enable/disable.

Bug: 215703483
Test: locally on device
Change-Id: I03dd9d67b4aeb3f41885b42391d97c18bd7465f6
2022-01-28 17:32:36 +00:00
Stanley Wang
9b906cb5b6 Use MainSwitchPreference on Bubbles, Screen Saver and
One-Handed mode pages.

Fixes: 178679876
Fixes: 177968619
Test: robotest and see the UIs.
Change-Id: Ic62c7464a71e5410ece5d1db7578c522e1babedc
2021-05-04 19:31:29 +08:00
Raff Tsai
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +08:00
Raff Tsai
ac3e0d0988 Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function

Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
2019-09-24 00:35:52 +08:00
Raff Tsai
1f30b1cd67 Merge similar BaseSearchIndexProvider code together
Bug: 135053028
Test: robolectric, check search_index.db contains the same items
Change-Id: If3c18a170b0e671690df1fdf26e59a421d2c48cd
2019-09-12 11:09:09 +08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08: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
Fan Zhang
6269e50e8e Fix crash when starting daydream setting with wrong context
The context must be a UI context. This is a new requirement in P.

(Also converted the CurrentDream controller to be slice compatible)

Change-Id: I28874f296da617f4cedf6706b0663b76671f1780
Fixes: 111375261
Test: robotests
2018-07-12 14:40:28 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -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
Tony Mantler
0fcd6cbaa8 Autogenerate SearchIndexableResources subclass
Bug: 77148954
Test: RunSettingsLibRoboTests RunSettingsRoboTests RunSettingsGoogleRoboTests RunArcSettingsRoboTests
Change-Id: I842c42c55014c3310070ef22bd4f0d9a70dfd804
2018-04-03 10:26:55 -07:00
Fan Zhang
f7843adabd More renaming in DashboardFragment
getPreferenceControllers() -> createPreferenceControllers() for the same
reason as in ag/3647936

Bug: 73668763
Test: robotests
Change-Id: I97670a91a2a38d1c844d1b9d37f4222c5e6f45a0
2018-02-23 16:56:30 -08:00
Fan Zhang
aed8994f6f Rename Indexable::getAllPreferenceControllers.
To getPreferenceControllers. "all" is redundant. Then internally, the
old getPreferenceControllers() is renamed to
createPreferenceControllers() to emphasize the controllers are created
from code (versus the ones created from xml).

Bug: 73668763
Test: robotest
Change-Id: Ifec46aefdc2a418031c8e152028b30bdcd396fc7
2018-02-23 16:37:28 -08:00
Fan Zhang
e0b0e9f902 Refactor help menu stuff into a controller
This is a clean up to action bar menu item pattern, we will use the same
pattern to build search icon on all pages in a later change.

Bug: 68814716
Test: robotests
Change-Id: Iedd3ec263e8ccb63ed75ec7a95b28c00878b1de4
2017-11-29 15:51:04 -08: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
Fan Zhang
179645eecd Add help url placeholders for new pages
Bug: 38412798
Test: visual
Change-Id: I4ede523cb13790ea05309279f80a778b2086f850
2017-06-05 14:50:01 -07:00
Evan Laird
227affaf29 Cleanup to screensaver settings for O
Reworked the way screensaver settings are laid out for O. Instead of
using the options menu and dialogs to navigate screensaver options,
there are now two rows: one row for the screensaver choice and
optionally its own settings, and one row for the "when to show" setting.
And now there's a nice obvious button you can press to preview your
choices.

Test: 'export ROBOTEST_FILTER="RadioButtonListFragmentTest";\
mmm -j20 packages/apps/Settings/tests/robotests'

Bug: 35031991
Change-Id: Ie7d2055fb45f6dfe72e34cb9598d9a25f7bee75a
2017-05-01 20:08:16 +00:00