Commit Graph

391 Commits

Author SHA1 Message Date
Tsung-Mao Fang
6c921e5b6c Refine the preference layout for homepage
Based on the Android S design, we update the layout
for homepage.

The scope covers the layout of preference and icons itself.

- Change the icon size for IA items.
- Change the layout spacing of preference.
- Change the margin or search bar.

Test: See the screen and confirm with UX
Bug: 177213699
Change-Id: I985966fdf39a5989d51991aa3c06ea5fd31e8fe2
2021-01-12 12:42:44 +08:00
Tsung-Mao Fang
acab1a0364 Only show the schedule text for the night display and dark theme
In Android S design, night display and dark theme only show
schedule text for summary.

- Rmove redundant string resource.
- Remove redundant method in night display formatter.
- Refactor the code in dark mode preference and night display
controller.

Test: See the correct behavior in screen.
Fix: 174964139
Change-Id: I658b3073a0a6ed83f589103999c711e5430eaeb7
2021-01-07 16:17:20 +08:00
Edgar Wang
e49ae19b1e Merge "Replace some customized RadioButtonPreferences" 2021-01-06 16:31:02 +00:00
Edgar Wang
c0e7328a88 Replace some customized RadioButtonPreferences
- Deleted ZenCustomRadioButtonPreference
- Deleted RadioButtonPreferenceWithExtraWidget
- Replaced with RadioButtonPreference

Bug: 173472216
Test: robotest
Change-Id: I645b59d65ae14af1f384f16ee7b76b3c98e23e1f
2021-01-06 05:37:29 +00:00
Tsung-Mao Fang
010ab29eb1 Night display setting should be toggleable
Based on Android S design, we want to let user can toggle
night light in display settings page directly.

1. Use primary switch preference in xml file.
2. Add a switch toggle controler for its preference.
3. Move logic of night display preference to controler.
4. Remove the night display preference since we migrate the logic to
controller.

Test: Night display works as intented behavior.
Bug: 174964139
Change-Id: Id920033cb22b1a9dd42c77c6fc2563ddae96bfcd
2021-01-05 17:55:37 +08:00
Yanting Yang
3932b07365 Move Styles & wallpapers to the homepage group
- Add Styles & wallpapers to the homepage group.
- Create a new display settings xml for the silky home.
- Remove Styles & wallpapers from new display settings xml.
- Apply the RestrictedTopLevelPreference to remove the restricted icon.

Bug: 168166015
Bug: 174964139
Test: robotest & visual with turning on/off silky home
Change-Id: Ib495b39bc62413242247f7e767c0e44bacc6e937
2020-12-25 09:04:12 +00:00
Yi Jiang
1a5e735773 Removes TimeoutPreferenceController in Settings.
Test: unit tests
Bug: 173450342
Change-Id: I16470192fc41afe83cf601baa79fea360e8dc1d1
2020-12-16 21:30:59 +00:00
Yi Jiang
cf9e39b2f3 Merge "Grays out Screen Timeout Setting when disabled." 2020-12-15 02:59:04 +00:00
Yi Jiang
aed7559a59 Adds 'options disabled by admin' icon in timeout settings.
Bug:171257091
Test: atest ScreenTimeoutSettingsTest

Change-Id: Id0411b009a2d4dc0e4f6abf2825580ca42ad8442
2020-12-14 00:31:51 -08:00
Yi Jiang
111004958d Grays out Screen Timeout Setting when disabled.
Previously we would hide the screen timeout setting when it is disabled
by admin. Instead of hide it in Display Settings, now we gray it out and
also provide the info of the enforced admin.

Bug: 174834978
Test: manually
Change-Id: Idaa3c4512eb648b67fcf6df2996c771a2f1b9617
2020-12-11 15:53:45 -08:00
Tsung-Mao Fang
f7e5b68b96 Apply banner message for night light page
Test: See the screen
Bug: 173184155
Change-Id: I522b5fbc48bed05ff621d914ae8b38d291fceab5
2020-11-20 09:14:46 +00:00
John Li
db2d3347d7 Add haptic feedback for the seekbar in Settings.
- set HAPTIC_FEEDBACK_MODE_ON_TICKS for Gesture Navigation.
- set HAPTIC_FEEDBACK_MODE_ON_TICKS for Battery Saver.
- set HAPTIC_FEEDBACK_MODE_ON_ENDS for Reduce Bright Colors.
- set HAPTIC_FEEDBACK_MODE_ON_ENDS for Night Light.

Bug: 172900709
Test: manual
Change-Id: I070a0f2e4cf690bf611f62c7a4a2bcef17e08571
2020-11-18 08:08:20 +00:00
Tsung-Mao Fang
00956fb4e1 Apply top intro preference in Settings app (1/n)
Based on content in footer, we need to convert some footers
to top info prefernce.

Test: Run robo test and see the screens
Bug: 173087905
Change-Id: Ie62a503481f9d385f5468896fba8f607cb3437d3
2020-11-16 18:44:40 +08:00
Edgar Wang
391217977f Update the summary of AoD when Bedtime mode is on
Since Bedtime mode can suppress AoD, after reviewed by UX, we decide
update the summary to "Unavailable because Bedtime mode is on" when AoD
is suppressed by Bedtime mode.

Bug: 168790245
Test: manual & robotest
Change-Id: Id2511cb0ad93b44f6bf701a707b7ddef9438653d
2020-11-12 21:47:15 +08:00
Yi Jiang
a56be2d614 Hides Screen Attention setting on unsupported devices
Bug: 170971817
Test: make RunSettingsRoboTests
Change-Id: I8aa7882be9a1ae483e8e7500059a18859b20d42b
2020-10-29 13:16:48 -07:00
Mill Chen
ad99e2ef38 Update related UI if battery is not present
This change is to update the related UI in the battery page if the
battery is not present. This includes the following updates:
1. Update the summary of battery tile in the Settings homepage
2. Replace the battery level with "Unknown"
3. Replace the summary with help message in the battery page
4. Remove the battery meter icon

Bug: 171368508
Test: verify on an issue device
Change-Id: I892e0d137143160a0bce0c11ce9265120ebb8fd4
2020-10-23 23:35:15 +08:00
Yanting Yang
9aa4a5463f Remove subtitles for the homepage IA
Remove the summary of the homepage IA if silky home enabled.

Fixes: 170933968
Test: robotest & visual with turning on/off silky home
Change-Id: I502b6590cece9b80e9923109fe0582cc4d9a1c56
2020-10-20 23:54:03 +08:00
Yi Jiang
0bbc758197 Updates screen attention preference at onStart().
Screen attention preference needs to be refreshed at onStart() so that
it get updated immediately once the camera permission is revoked/granted
for the screen attention feature.

Bug: 171019472
Test: manual + atest AdaptiveSleepPreferenceControllerTest

Change-Id: If9ac68c022f10ffefde61b035bbf38ee14c02180
2020-10-16 15:25:12 -07:00
Yi Jiang
f5d1841c9d Merge Screen Attention and Screen timeout Settings.
Bug: 155051311
Test: atest
Change-Id: I6f6ee52618eab629a41b28982be32ead5f9ba08d
2020-10-13 00:47:13 -07:00
Wesley.CW Wang
ff0e65c7f7 Add intent extra when launching WallpaperPicker from SUW and Settings
- Add extra to these intents to help WallpaperPicker log the launch
 source

Bug: 154781896
Test: make SettingsRoboTests
Change-Id: Ifb0ed22ab8ebfbb3c2ad24e9b7bad80007162b6e
2020-09-23 08:06:52 +00:00
Yi Jiang
038d18ff73 Disable screen attention when DISALLOW_CONFIG_SCREEN_TIMEOUT
Test: atest AdaptiveSleepDetailPreferenceControllerTest
Bug: 161938926
Change-Id: I4ed96ad36efe67091a26cbfe2cde16c116f7c8fb
2020-09-10 00:58:03 -07:00
Lucas Dupin
1d663e72ce Merge "Time for dark theme doesnt format 24 hr correctly" into rvc-d1-dev am: e899f749a1 am: 5f44b7cf54 am: 6430a4b88f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12337522

Change-Id: Iac01c66216d6ab98654b97f33505d9f60714c78e
2020-08-12 22:24:45 +00:00
Jay Aliomer
b569dfdac8 Time for dark theme doesnt format 24 hr correctly
Fixes: 163048376
Test: Manual
Change-Id: Ia6c2633408670656c2b42bfb724aaf900561682e
2020-08-07 23:43:09 +00:00
Edgar Wang
c2e4513fb6 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: robotest & manual
Change-Id: I36829e0055437dab79d9e5339ac002a87a4b874f
2020-08-04 18:12:48 +08:00
Matthew Mintz
827665a4a4 Merge "Make WallpaperPreferenceController available when only style picker present." 2020-07-30 05:32:55 +00:00
Matthew Mintz
3243920695 Make WallpaperPreferenceController available when only style picker present.
WallpaperPreferenceController prefers the style picker over the basic wallpaper picker. However, the entire setting is disabled when only the style picker is available, even though the basic wallpaper picker is not used. This change corrects that.

Fixes: 162395248
Test: Added unit tests. Also built, flashed and tested setting with all four combinations of CategoryPickerActivity and CustomizationPickerActivity enabled/disabled.
Change-Id: I4184f834ed771359cef13b64aacf2072e592d6d8
2020-07-29 17:39:47 +08:00
govenliu
b70ddb9df7 [Wi-Fi] WiFi Settings inclusive language fix plan phase 1
Replace WiFi related terms which contain Master wording.
Goal: Create a fixit for Android Platform to reduce the use of non-inclusive language for all code.

Bug: 161425297
Test: make RunSettingsRoboTests -j or
make RunSettingsRoboTests ROBOTEST_FILTER=DashboardFragmentTest
make RunSettingsRoboTests ROBOTEST_FILTER=WirelessDebuggingPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=AutomaticStorageManagementSwitchPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=AllInOneTetherPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=TopLevelNetworkEntryPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=PrimarySwitchPreferenceTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiPrimarySwitchPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherPreferenceControllerTest

Change-Id: I9395c50e092e124016609f88f7c8151554a0d874
2020-07-21 20:56:22 +08:00
Stanley Wang
2af4f657bb Merge "Fix the bug of showing the "Smooth display" item in the search result." into rvc-dev am: 6458ea872c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12065563

Change-Id: Iac0ec59e405443bc1edcb142f6c0f6f194b8ca30
2020-07-06 03:03:37 +00:00
Stanley Wang
61147df890 Fix the bug of showing the "Smooth display" item in the search result.
The controller can't be created when Settings Search gets the
non-indexable keys. So Settings Search can't get the correct value
from it.
The controller creates the Handler without the parameter in constructor
and causes the exception. It should use the main Looper of Context as
the parameter to create the Handler.

Fixes: 160179400
Test: run robotest and observe the search result
Change-Id: I6f9bf6de087ae776e8d531ff59d28966aee96b7b
2020-07-02 14:35:43 +08:00
TreeHugger Robot
35d0304067 Merge "Fix the Night Light page UI shrinking" into rvc-dev am: 6f4aa6e5e0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11983923

Change-Id: I91ffd5a10cf3b583d8a645951550a11e49891366
2020-06-24 12:43:23 +00:00
Sunny Shao
8d74809e96 Fix the Night Light page UI shrinking
- This problem causes the TwilightLocationPreferenceController too late
  to decide the preference display or not.
- Move the display criteria into the getAvailabilityStatus

Fixes: 159032276
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.display
Test: manual review
Change-Id: I5850479e8a891f837c0e6772ad1096e702f95e34
2020-06-24 12:22:59 +00:00
TreeHugger Robot
d2ea0b8e37 Merge "Add new Always on display slice" into rvc-dev am: 16e1cd296a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11736609

Change-Id: I79cee4ac6d5c40605be2a20c69cf39d213ceaa28
2020-06-18 15:08:07 +00:00
TreeHugger Robot
16e1cd296a Merge "Add new Always on display slice" into rvc-dev 2020-06-17 12:04:21 +00:00
Edgar Wang
e1186254d4 Add new Always on display slice
Currently we create Always on Display slice through
AmbientDisplayAlwaysOnPreferenceController. However, as the Always on
Display is merged into Idle lock screen, the conversion won't work
properly anymore when devices support the aware sensor.

Hence, we create another custom slice for this purpose.

Bug: 145920511
Test: manual & robotest

Change-Id: Ifd90e2de5219bd4e97aa13b5855fdab95ff6c4d0
2020-06-17 07:52:01 +00:00
Chihhang Chuang
786e814706 Launch WallpaperPicker in a new task[Part2]
Didn't notice com.android.settings.Settings$WallpaperSettingsActivity was also change unexpectedly, we should only add new task for CustomizationPickerActivity only.

Test: Manually
Fixes: 158642941
Change-Id: I9b271d0fbf124d2d38bc52fa99c2c17b0bfc658c
2020-06-16 18:38:04 +08:00
Chihhang Chuang
8bed8d3454 Launch WallpaperPicker in a new task
Wallpaper does not support multi window mode, but launching from
Settings will make it support multi window because the root activity
supports.

Solution: Launch WallpaperPicker in a new task

Test: Manually
Fixes: 158642941
Change-Id: I93a6eaa8c0292e99c54d5278274482075ed007d5
2020-06-16 15:20:59 +08:00
Beverly
258fd7c03b Explicitly request focus after button pressed
Don't use focusableInTouchMode, it was causing focus/clickability issues
when the device wasn't in touch mode.

Test: manually tap button (tap works first try)
Test: turn on talkback and toggle buttons, also try toggling QS tile
while on the Settings page - doesn't reannounce state
Fixes: 158717450
Change-Id: I785d0200dd61235aa3308a8588f9ee998e7cb6e5
2020-06-12 16:01:50 +00:00
Jay Aliomer
57cc7d01ae Incorrect localization of dark theme custom time
Fixes: 154361883
Test: manually select dark theme custom time and make sure it matches
locale

Change-Id: I2a918b4b2f5aad6b04d3b0318bbca25e82dfae78
2020-05-28 12:00:17 -04:00
Amy Hsu
7730d301b7 Move PeakRefreshRateController to Settings app
1. 60/90 Hz switch
2. Allow DeviceConfig to change default refresh rate

bug: 139869828
bug: 137064289
bug: 132750102

Test: Check refresh rate is expected.
Change-Id: Ia6a3e3717fd8845c7177e55b70bc6d2d952d58f3
2020-05-19 21:45:33 +08:00
Jay Aliomer
dba11e82b5 Revert "Revert "Unable to select twilight scheduling after enabling location""
This reverts commit 782438347b.
Bug: 153115261
Reason for revert: fixing tests

Change-Id: I497a2b83cbe3eaee5f5fb3eb4df73618130fc6e2
2020-05-14 15:14:18 +00:00
Edgar Wang
782438347b Revert "Unable to select twilight scheduling after enabling location"
This reverts commit 9073b2f968.
Bug: 153115261
Reason for revert: this CL make Settings robolectric test fail at com.android.settings.display.darkmode.DarkModeScheduleSelectorControllerTest

Change-Id: I3f1ba35f55f2905b10ca97149268be6074780eda
2020-05-13 03:58:36 +00:00
Jay Aliomer
9073b2f968 Unable to select twilight scheduling after enabling location
Test: run settings tests
Change-Id: I74945dd69f0da9733ee0a5e27ab63852df9544e9
Bug: 153115261
2020-05-11 16:31:42 +00:00
Tsung-Mao Fang
ae9dc54c56 Remove duplicate result for dark mode
We only keep the one in display settings.

Test: robo test and search dark mode in settings search.
Fix: 155735315
Change-Id: I71041f473944e854ef4601063658021bb9411069
2020-05-05 21:08:37 +08:00
Jay Aliomer
41ee5663ab Twilight Location off text
When location is disabled, dark theme and night light
will show text and button to take the user to location page

Fixes: 153115261
Fixes: 153115618
Test: manually turn off location and observe view
Change-Id: I24be2f26a4c9e1b3f2a17e83e6f91cb7685f2e28
2020-04-29 23:14:32 -04:00
Jason Chiu
819abf7f87 Refine metrics log in infrastructure
- Add interfaces to set/get metrics category in BasePreferenceController
  for descendants having a chance to get it.
- Set metrics category in DashboardFragment
- Automatically log metrics in onPreferenceChange of
  TogglePreferenceController
- Add support for TwoStateButtonPreference in TogglePreferenceController
  to make the preference generic

Bug: 137559984
Test: robotest
Change-Id: Ia7e0d24a3db1991b18e0286d9894570fa71247a3
2020-04-07 14:08:39 +08:00
TreeHugger Robot
710fd22f81 Merge "Turn on location dialog when using twilight scheduling" into rvc-dev 2020-04-03 08:03:41 +00:00
Jay Aliomer
59c03c23b7 Turn on location dialog when using twilight scheduling
Night light and Dark theme scheduling does not work when in
twiligth mode. For the reason, we added a dialog to inform the user
that they need to turn on location services first.

Fixes: 153115618
Fixes: 153115261
Test: manual
Change-Id: Iea51018a7caba5c0ec93e058ee047d067bc03867
2020-04-03 03:45:20 +00:00
Beverly
f736532a9d Only request focus if change was self-triggered
For a11y we want to accomplish two things:
1. Keep focus on the button if the button was just pressed. This
requires buttons in settings to be focusableInTouchMode and then request
focus when the buttons are updated.
2. When the setting is changed outside of the settings page (ie: from
Quick Settings), we don't want to re-announce on talkback the button that is
updated on the Settings page. Therefore, to maintain #1, we add a
boolean to check whether or not the updateButton change was triggered by
a click to the button preference or not. Only request focus if the
button was triggered by the settings button (and not when triggered by
other things like QS).

Test: manual
Fixes: 147992252
Change-Id: I505de0585bac38a2f59062743d9d6b75861c3d32
2020-03-27 14:12:08 -04:00
Jason Chiu
26343b82ee Add metric logs for special cases in Display and Battery page
Bug: 137559984
Test: robotest
Change-Id: I60f6237ac2c533306879f46ee4c25d54002cf0e9
2020-03-26 11:31:39 +08: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