Commit Graph

203 Commits

Author SHA1 Message Date
Lifu Tang
caa1b51ef2 Revert "Remove duplicate strings."
Revert submission 19748582-settings_yesno

Reason for revert: Common strings in English could be translated into different strings in other languages.

Reverted changes: /q/submissionid:19748582-settings_yesno

Bug: 272603842
Test: build and open Settings app
Test: atest SettingsRoboTests
Change-Id: Iaad301c5513478fb95e40987ea3ccb4f923d71fa
2023-03-15 22:39:24 +00:00
Daniel Norman
58b553a594 Adapt to moved ACCESSIBILITY_MENU_IN_SYSTEM location.
Bug: 261252772
Test: atest AccessibilitySettingsTest
Change-Id: I33051116c972b46f3861b3658c53ecaa5ec55095
2023-02-06 11:10:02 -08:00
TreeHugger Robot
f253dc391f Merge "Make Accessibility Settings can support Relate project in Speech category" 2023-01-30 14:40:56 +00:00
Daniel Norman
322fc449af Includes AccessibilityMenu-in-System in interaction controls category.
The Menu APK will be included by default on devices. However, in order
to ensure Menu appears in the interaction controls category an OEM would
need to update their config_preinstalled_interaction_control_services
array.

This change ensures Menu is in the correct category without any OEM
action required.

Bug: 261252772
Test: atest AccessibilitySettingsTest
Change-Id: I9b3d6dddf2691d9489ef847e400eb776aca96e56
2023-01-24 16:59:24 -08:00
menghanli
a1677e1193 Make Accessibility Settings can support Relate project in Speech category
Goal: Make Accessibility Settings can dynamically show the Relate project in Speech category when existing

Bug: 265883460
Test: Manual testing
Change-Id: I28ac9bee6d1e946a793ed679829e326a178f1015
2023-01-19 06:40:43 +08:00
Menghan Li
526ababc60 Merge "Dynamic update a11y settings when a11y service target is disabled" 2023-01-09 22:06:26 +00:00
menghanli
556bfd4c60 Dynamic update a11y settings when a11y service target is disabled
Root cause: A11y settings only handle the package install/uninstall/update, but it does not observe the component status.
Solution: Add onPackageModified() to refresh the list.

Bug: 264697450
Test: Manual test
Change-Id: I779c4ba87c6f54616e9c4c6378db91d9ff611b24
2023-01-07 09:31:29 +08:00
jasonwshsu
ad6351d614 [Hearing device shortcut] Setup shortcut for hearing device
* Hearing aids page need to set restricted mode to DISALLOW_CONFIG_BLUETOOTH, so change AccessibilityShortcutPreferenceFragment to extend RestrictedDashboardFragment
* move ShortcutPreference under the device control category for the 1st order

Bug: 237625815
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityShortcutPreferenceFragmentTest
Change-Id: I13da8d979694aeab76d8a10edf1348c0ee7810f6
2022-12-28 02:35:53 +08:00
Peter Liang
08e6061ade Fix the summary of Magnification didn’t be updated after the content change.
Solution:
1) Update the preference state when the settings content change.

Bug: 246869845
Test: manual test
Change-Id: Ib776100e6940d09f5549c3edc2c5f5c6963c6d0e
2022-12-09 00:54:48 +00:00
menghanli
f76e31fe48 Fix unbundled accessibility features settings crash when launched
Root cause: The ag/19938064 introduces Settings Core change preference value changed metrics log format. It tries to lookupMetricsCategory() at Fragment#instantiate() stage. It has not onAttach() to activity by FragmentManager#add() or #replace(). The features were added by ag/15824482.
Solution: PutInt new MATRICS_CATEGORY extra in previous class to avoid giving context for FeatureFactory.getFactory to custom 1P accessibility services for SettingsGoogle overlay.

Bug: 259355675
Test: manual test
Change-Id: Ic37d41be6a54fe388f211c1c397d0b9b87b5fb56
2022-11-18 22:18:27 +00: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
jasonwshsu
f02c069f3d Extract inner helper from AccessibilitySettings to public
* Need to be used in 'Connected device' page for hearing aid device

Bug: 225117933
Bug: 227172850
Test: make RunSettingsRoboTests ROBOTEST_FILTER=RestrictedPreferenceHelperTest
Change-Id: Icda456aa9c7597dc113775d1359acb0a8430768c
2022-03-31 21:49:13 +08:00
menghanli
3c24caf357 Refine A11y Tile Service javadoc
- Explicitly say that this is only the class name,to be looked up in the a11y services package, and not a full component name
- Fix typo of Javadoc refers to class names (plural)
- Rename to getTileServiceName()

Bug: 219873375
Test: manual test
Change-Id: Ib06e68bd07cb85bffe0fa6ee1c680e4ee4e8e00a
2022-02-22 21:51:32 +00:00
menghanli
aa02174745 Integrate new accessibility intro attr into settings
- Accessibilty service: AccessibilityService_intro
- Accesibility shortcut: AccessibilityShortcutTarget_intro

Bug: 218407448
Test: manual test
Change-Id: I8d8ff1bbcc999fb09aa49ffcd458a457f061f82c
2022-02-13 07:26:40 +08:00
menghanli
61479cde86 Integrate new accessibility tileService attr into settings
- Accessibilty service: AccessibilityService_tileService
- Accesibility shortcut: AccessibilityShortcutTarget_tileService

Bug: 216614718
Test: manual test
Change-Id: I24baff13300dfc9a242fcfffe0a4888575ca0c9f
2022-02-09 11:46:40 +08:00
Ricky Wai
c76a11f0c1 Add restricted settings UI in Settings accessibility screeen
If OP_ACCESS_RESTRICTED_SETTINGS is rejected, it means accessibility page
for that app is gray out and app info won't show "unlock restricted settings menu"

If OP_ACCESS_RESTRICTED_SETTINGS is ignored, it means accessibility page
for that app is gray out, but app info shows "unlock restricted settings menu"

If OP_ACCESS_RESTRICTED_SETTINGS is allowed(default), it means users can
access accessibility page for that app.

OP_ACCESS_RESTRICTED_SETTINGS will be changed to ignored if user visited
the restricted settings dialog.

OP_ACCESS_RESTRICTED_SETTINGS will be changed to allowed if user passes
the confirmation screen.

Bug: 202130031
Test: Tested the UI and it works correctly
Change-Id: I3dfb94cee440658b4726a1c3f7265f93cd19ed3e
2022-01-27 09:50:40 +00:00
Daniel Hsieh
55bc49860b Refactor SettingsContentObserver and add it to follow typing feature.
Refactor SettingsContentObserver and rename it to
AccessibilitySettingsContentObserver. Besides, we register it to observe
follow typing feature preference value.

The reasons behind refactor:
1. We change callback signature due to the consistency for register it
by preference key, not by Uri.
2. We refactor the default preference key to a seperate method. Since
the default value is related to accessibility, we rename it with
accessibility prefix.
3. We can register different callback for difference collections of
preference keys.

Default preference keys: They existed in the previous constructor.
1. Settings.Secure.ACCESSIBILITY_ENABLED
2. Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES

Bug: 194668976
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
           AccessibilitySettingsTest
           AccessibilitySettingsContentObserverTest
           AccessibilityShortcutPreferenceFragmentTest
           MagnificationFollowTypingPreferenceControllerTest
           ToggleFeaturePreferenceFragmentTest
           ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: Iafd27e044ebe2536ae7ae55c1c80af54f7f0f822
2022-01-20 08:38:27 +00:00
Lais Andrade
141b5bb3bc Update Settings to use intensity settings as main preference keys
Updating the Settings app to allow setting the value off for key
HAPTIC_FEEDBACK_INTENSITY. This setting state is also copied onto
HAPTIC_FEEDBACK_ENABLED setting, so both should be in sync after this
change.

Similar logic is applied between RING_VIBRATION_INTENSITY and
VIBRATE_WHEN_RINGING.

This will not disable the hardware feedback since that one is controlled
by a separate setting key now.

The "vibrate for calls" was also removed and the single toggle for
"vibrate first then ring gradually" was moved into the "Vibration &
haptics" page.

Bug: 185351540
Test: [HapticFeedback|NotificationVibration|RingVibration][Intensity|Toggle]PreferenceControllerTest
      and manual testing of the AOSP settings app
Change-Id: I9c94cef331a1500a1272a601ba32667ca995ddab
2022-01-12 22:59:29 +00:00
Lais Andrade
24b2d9e5a1 Move APPLY_RAMPING_RINGER from Global to System
This configuration should be user-scoped.

Bug: 184165158
Test: AccessibilitySettingsTest
      RingVibrationPreferenceFragmentTest
      VibrateForCallsPreferenceControllerTest
      VibrateForCallsPreferenceFragmentTest
Change-Id: I7b8684fb1cf03d41872a700fd8732c76422e37c3
2021-11-23 14:51:55 +00:00
lucychang
7f94301cd4 Log accessibility privacy warning status (2/2)
Uses the atom NonA11yToolServiceWarningReported in westworld to log
the accessibility privacy warning service has been disabled in
accessibility setting.

Bug: 180983963
Test: m statsd_testdrive && statsd_testdrive 384
Change-Id: I4fb23066159f3086aaaeff521f305266e58cf42d
2021-08-19 22:41:07 +08:00
jasonwshsu
87b90dfc50 Improve search by adding the settings keywords for supported downloaded services
* Use FeatureFactory to improve the search only for google overlay

Bug: 184171842
Test: atest AccessibilitySettingsTest
Change-Id: I93ed52d2579b7da35dba59f9562b6715d13dd80d
2021-06-21 16:03:37 +08:00
jasonwshsu
9b284a9af1 Wrap a white adaptive background if it is not an AdaptiveIcon
Bug: 183501919
Test: manual test
Change-Id: I6a899aa0fcb724d5318274190f359080fc2d0615
2021-04-26 05:01:00 +00:00
jasonwshsu
15df635dd6 Fix accessibility settings page did not update the preference state
Root Cause: Keys in ContentObserver registered after the keys change

Solution: Keys in ContentObserver need to be observed during the whole lifecycle to update the preferences including summary text

Fix: 183157677
Fix: 172469017
Fix: 183459237
Fix: 183459376
Test: atest AccessibilitySettingsTest
Change-Id: I3b22773965f1878c499a0f9cbd8bd0f3c9c6fae9
2021-04-20 23:13:23 +08:00
jasonwshsu
6e33293fa3 Remove unused code
* isColorTransformAccelerated() already moved to ColorDisplayManager
* TurnScreenDarker fragment already moved to top level accessibility settings or TextAndDisplay fragment

Bug: 174829936
Test: manual test
Change-Id: I34ec6947129a5042d573e94eabe3c24c2fe761b5
2021-04-01 09:41:11 +00:00
Edgar Wang
0c914077aa Merge "Change packagename of TwoTargetPreference" into sc-dev 2021-03-17 05:08:21 +00:00
Ben Chung
478db86589 Update accessibility settings layout
Accessibility settings category restructure
1. Add caption category fragment for related accessibility services.
2. Remove experimental category.

Bug: 174829936
Test: atest AccessibilitySettingsTest
Change-Id: I13b1ed62afe0634329d1e340ba154454640fadd6
2021-02-14 15:11:59 +00:00
Edgar Wang
9691da0d21 Change packagename of TwoTargetPreference
Bug: 180156703
Test: robotest
Change-Id: Ida344e689971aa780054093b2472582d61c476d1
2021-02-13 12:17:14 +08:00
Ben Chung
e66e641980 Add accessibility shortcuts fragment in a11y settings
Accessibility settings category restructure, add accessibility shortcuts
fragment for related accessibility services.

Bug: 174829936
Test: atest AccessibilityShortcutsFragmentTest, atest AccessibilitySettingsTest
Change-Id: I9706906863872bc60d31eae54bbf3a35d70e812e
2021-02-05 07:30:49 +00:00
Ben Chung
3e2e4407cf Accessibility settings display category restructure, add text and display fragment for related accessibility services.
Bug: 174829936
Test: atest TextAndDisplayFragmentTest, atest AccessibilitySettingsTest
Change-Id: Ie2cf147de53385ae0c626c8472306f1b85317686
2021-01-06 18:26:43 +08:00
Sally
b9ff672a31 Add a setting page for Reduce Bright Colors under A11y
This is essentially a copy page of ToggleDaltonizerPreferenceFragment.
We extend ToggleFeaturePreferenceFragment to maintain consistency with
other shortcut assignable a11y feature.

UI is a draft

This CL:
1) allows users to enabled/disable RBC with the a11y shortcut (button,
gestures, volume keys), if assigned
2) adds a slider and persist switch to the template
ToggleFeaturePreferenceFragment page (which already contains a feature
switch, shortcut preference, and footer description)
3) enables/disables the intensity slider when RBC is on/off
4) sets placeholders for calling into ColorDisplayService in
controllers and tests
5) follows convention set by other color transformations settings and
places feature under Experimental section in A11y settings page if
transformations can't be efficiently performed by hardware

Test: A11y setting and page appears, tested activation with shortcut,
preference controller tests
Bug: b/128465252

Change-Id: I291bb86ce3d855ce052ca70dc7a941a888e2c723
2020-10-21 23:08:53 +00:00
Peter_Liang
2387212823 Fix the screen scrolling down after enabling dark theme.
Root Cause:
Dynamically update preferences behind onCreate lifecycle.

Solution:
Move it to previous lifecycle.

Bug: 139877200
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilitySettingsTest
Change-Id: I1638a8b2d48369ec1ea0b996fbed09233c5e3649
2020-08-06 21:22:19 +08:00
jasonwshsu
43daeb90da Change the name of accessibility service fragment type to more descriptive names
Bug: 155052371
Test: manual test
Change-Id: I097138c84083528acd4d16a145921227ffe3f736
2020-04-28 00:55:04 +08:00
Jason Hsu
79d73eaa59 Merge "Use new setting key to maintain the list of user assigned shortcut targets." into rvc-dev 2020-04-24 03:07:39 +00:00
jasonwshsu
f74c0a72b6 Show default description only if description and html description are empty
* AccessibilitySettings only get the description to pass to the
ToggleFeaturePreferenceFragment
* ToggleFeaturePreferenceFragment handle the default description logic

Bug: 154092127
Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.accessibility.AccessibilitySettingsTest"
Change-Id: I516a393aeef1472ca5d185d477a2b0b108fc5342
2020-04-21 01:34:22 +00:00
jasonwshsu
1be2666d11 Remove unused attribute 'EXTRA_SUMMARY_RES'
* Magnification already use EXTRA_HTML_DESCRIPTION to replace it.

Bug: 154092127
Test: manual test
Change-Id: I5385907eb0911894159a80444493bf233bb43e1a
2020-04-20 23:09:59 +08:00
jasonwshsu
e1eec16427 Use new setting key to maintain the list of user assigned shortcut targets.
* Framework changes to keep ACCESSIBILITY_BUTTON_TARGET_COMPONENT
contains only a single target, use ACCESSIBILITY_BUTTON_TARGETS to maintain the targets list.

Bug: 151295675
Test: manual test
Change-Id: I2218402fd122acc9a86c64127e9cfcf77a6e241e
2020-04-16 17:21:20 +08:00
Hiroki Sato
0e75d475ec Hide Bluetooth, Reset, Accessibility Settings in ARC
This is an upstreaming change of http://ag/8541963 and
http://ag/10296201 to hide some items from settings search.

This CL also adds javadoc to some settings classes to fix pre-upload
warnings.

Bug: 153704887
Test: Manual. In ARC build, "bluetooth" and "accessibility" no longer shows related settings.
Change-Id: Ic3e9217944251adbea1bdd67baf66d3a9e89583a
2020-04-10 16:00:57 +09:00
menghanli
19cf6ddff8 Update R acessibility assets and strings (2/n)
- Temporary-use template summary by shortcut state

Bug: 148837311
Test: Manual test
Change-Id: Ia720b8f3f317bb1874d6758ebc4fbf4145d0c217
2020-03-11 17:21:27 +08:00
jasonwshsu
c7fa4da58d Accessibility shortcut primary action - add settings UI for accessibility shortcut type fragment
Bug: 142531433
Test: manual test
Change-Id: I6a9eebc1718f2b924cfb373f09abb57890fa10a5
2020-03-04 16:06:41 +08:00
jasonwshsu
b67d873372 Accessibility shortcut primary action - setup entry for launched type fragment.
* Reduce the complexity of updateServicePreferences.
* Introduces RestrictedPreferenceHelper to setup installed
AccessibilityServiceInfo and AccessibilityShortcutInfo.

Bug: 142531433
Test: make RunSettingsRoboTests
Change-Id: I0f5eeac56a93caadeb05c25f1f8c4daa0d775b35
2020-02-19 15:25:48 +08:00
jasonwshsu
13b6850c52 Fix the NPE error when get the service summary.
* Check NPE for AccessibilityInfo.loadSummary()
* Remove the state argument that could get from info argument

Bug: 148837311
Test: Manual test
Change-Id: Ic6906fdbdd7f1c241776d1045be33f89468670b6
2020-02-15 11:49:37 +08:00
Menghan Li
14c548e38a Merge "Remove on/off information if the services cannot toggle service on/off" 2020-02-13 15:33:48 +00:00
menghanli
04a46cb7c6 Remove on/off information if the services cannot toggle service on/off
Bug: 148837311
Test: Manual test
Change-Id: I57e0ed33bebc41cde99008bb2ed014c63194c52a
2020-02-13 10:41:30 +00:00
Yiwen Chen
54114d7895 Merge "Device config flag clean up." 2020-02-12 22:07:42 +00:00
menghanli
4705d87c4a Update the shortcut design strings.
Bug: 148837311
Test: Manual test

Change-Id: Iac96b3f36e4298aea36bbde5632f701ad1e9572d
2020-02-07 14:23:22 +08:00
Yiwen Chen
950023fc36 Device config flag clean up.
Test: built and tested on device
Change-Id: I4e64cceca629c0b4c0a5d0a5ec23bc2d75f4aead
2020-02-05 16:15:35 -08:00
menghanli
30e5fea655 Change the Settings to app name with settings
Bug: 148837311
Test: Manual test
Change-Id: Ib27fd840c1a33378d9b301658b5d6c9ef148c615
2020-02-04 17:13:18 +08:00
Jason Hsu
24af3f4c81 Merge "Accessibility shortcut secondary action - divide different fragment for different fragment type" 2019-12-26 13:42:17 +00:00
menghanli
b7306044c9 Create settings for color inversion (2/n)
Provide a setting for new color inversion design.

Bug: 146019226
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ColorInversionPreferenceControllerTest
Test: make RunSettingsRoboTests2
Change-Id: I1d081c6321ee96d48e8f52304893e4a5fb59333a
2019-12-26 06:39:44 +00:00
jasonwshsu
3d94a57d97 Accessibility shortcut secondary action - divide different fragment for different fragment type
Different accessibility service fragment type have different UI.
- AccessibilityServiceFragmentType.LEGACY will use LegacyAccessibilityServicePreferenceFragment
- AccessibilityServiceFragmentType.INVISIBLE will use InvisibleToggleAccessibilityServicePreferenceFragment
- AccessibilityServiceFragmentType.INTUITIVE will use ToggleAccessibilityServicePreferenceFragment

Bug: 142530063
Test: Manual
Change-Id: Ib32a4f97514450e5c0d29e99c22935efecf8b6df
2019-12-26 11:40:11 +08:00