Commit Graph

22 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
Chaohui Wang
8e2ae547d6 Clean up FeatureFactory.getFeature()
Bug: 286764889
Test: m Settings
Change-Id: I7e472e6b0ca6b7a735c1b92742ddf06c545176fc
2023-08-08 08:41:48 +00:00
Jason Chiu
2989c50a23 Add highlight menu keys for all toggle pref controllers and custom slices
Bug: 204695404
Test: manual, robotest build pass, unit
Change-Id: Iad2e28ada8ddb766ffa7eff2c8dc581250cbd6f8
2021-11-01 15:00:18 +08:00
Stanley Wang
10b7a7d483 Use MainSwitchPreference to replace the button style switches.
Fix: 177967926
Fix: 177968295
Fix: 177967925
Fix: 177968078

Test: Run robotest and apply the widget in Settings and see the ui
Change-Id: Ie854de96e5495fa564fb8a097ed4547bbd2b10c5
2021-02-02 08:39:37 +00: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
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
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
Yi-Ling Chuang
31719321af Make some display related slices public.
Only PreferenceControllers with isPublicSlice() set to true are exposed
to other apps. Others will be Settings only.

Bug: 141088937
Test: robotests
Change-Id: I2a36da4ac4bb14a4d2ac7b89ab2bb3ebf8e655f7
2019-11-28 14:29:33 +08:00
Beverly
a30cb1158f Focus remains on the button after turning on/off
Test: manually test talkback
Fixes: 145181672
Change-Id: I16ceb81dd686e4a18354dfd464c7683ba94df79d
2019-11-26 15:37:42 +00:00
Mill Chen
7d0150d160 Remove On/Off string from Night light slice
We only deleted On/Off string from the subtitle of night light slice in
the settings search result, and still keep On/Off string for Night Light
preference.

Fixes: 130364160
Test: visual
Change-Id: Ibe7f2752f099a4ab0d4a01a205e4e8ce0a226f55
2019-04-15 11:40:19 -07:00
Christine Franks
a21c6edcf6 Use ColorDisplayManager for night display settings
Bug: 123352608
Test: make ROBOTEST_FILTER="(Night*)" RunSettingsRoboTests -j48
Change-Id: Id4ab9ca4a21243be5967d63db72212daefb3dcb9
2019-01-24 12:18:40 -08:00
Christine Franks
5405d71616 Use ColorDisplayManager for night display
Bug: 111215474
Test: make ROBOTEST_FILTER="(Night*)" RunSettingsRoboTests -j48
Change-Id: I8b92407470446ef86e460985fc64cf2467eb3e5c
2019-01-23 13:32:30 -08:00
tmfang
dce94bb237 Use SettingsLib's LayoutPreference
- Remove LayoutPreference in Settings source code.
- Remove unused style, layout
- Replace old imports to com.android.settingslib.widget.LayoutPreference
- Replace old XML tag to com.android.settingslib.widget.LayoutPreference

Test: robotest, manual test
Bug: 120005054
Change-Id: I9ae1ae14a16f443e11ac5d75b6038c7c5e253844
2018-11-27 13:12:53 +08:00
Christine Franks
26d0595373 Use ColorDisplayManager
Bug: 111215474
Test: make RunSettingsRoboTests -j100
Change-Id: I78bb44a1c4824f2b5223ca0d58ad224b96591d9a
2018-11-06 21:31:28 +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
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Matthew Fritze
bf1f5b5813 Add isSliceable API to BasePrefController
Only support explicitly approved Settings Slices,
dictated by controllers which return true for the new
method isSliceable.

Updating the supported settings to a whitelist means that
the method to return all available slices must be updated,
and checking slicability when we index slices.

Test: robotests
Bug: 79779103
Change-Id: Ib2b9690cdd0036b5cc4a1cb846c52bce7c824ab9
2018-05-22 11:06:42 -07:00
Matthew Fritze
f87a1f3f41 Establish permanently unavailable settings
Distinguish between settings which are permanently unavailable on
the device, and temporarily unavailable. This enables us to restrict
which setting slices are exposed in onSliceGetDescendants.

The primary changes in this CL are renaming:
"DISABLED_UNSUPPORTED" -> "UNSUPPORTED_ON_DEVICE"
to be more clear the the setting will cannot be accessed on the device, and,
adding a new enum to encapsulate settings which are currently unavailable, but
could be enabled in the future.

Also remove UNAVAILABLE_UNKNOWN. Devs should never need this enum.

Bug: 78910582
Bug: 79245656
Test: robotests
Change-Id: I58821a6cfd6134b3b351657b6edf5f74ead00643
2018-05-09 08:36:59 -07:00
Christine Franks
d67ec89c4b Add night display pref controllers and change UX
- Convert NightDisplaySettings to a DashboardFragment
- Add preference controllers for all Night Display settings
- Change UX for activation from a toggle to a button

Bug: 73739388
Bug: 69912911
Test: make -j100 and make RunSettingsRoboTests -j100
Change-Id: Ia173f16207ba59bf57eb7546cbb1e2dbca67b063
2018-05-02 13:12:26 -07:00