Commit Graph

74 Commits

Author SHA1 Message Date
Menghan Li
a389ff59ab refactor(A11yFeedback): Simply feedback logic into menu controller
Bug: 393980229
Test: atest FeedbackMenuControllerTest
Flag: com.android.server.accessibility.enable_low_vision_generic_feedback
Change-Id: I03af00957c2bcca1d1cc81970eccad6dd69bb4ac
2025-03-11 02:43:32 +00:00
Menghan Li
c26eb7fd24 feat(A11yFeedback): Implements page ID to feedback bucket ID mapping
This change adds a new API to a Pixel overlay feature provider,
allowing Android to map page IDs to feedback bucket IDs.

Bug: 393980229
Test: Manual testing for Pixel and non-Pixel overlay in real device
Test: atest AccessibilitySettingsTest
            FeedbackManagerTest
Flag: com.android.server.accessibility.enable_low_vision_generic_feedback
Change-Id: I8a110b08816cac9c8a8e8c3e1218530fffb6f121
2025-03-05 05:23:00 +00:00
Menghan Li
6b916e6f29 feat(A11yFeedback): Pixel overlay to expose the feedback bucket ID
This change introduces a feature provider for Pixel overlays, allowing
customization of the feedback bucket ID on Android.

Bug: 393980229
Test: Manual testing for Pixel and non-Pixel overlay in real device
Test: atest AccessibilitySettingsTest
            FeedbackManagerTest
Flag: com.android.server.accessibility.enable_low_vision_generic_feedback
Change-Id: Ieeb1dba4de5c13a275e66781621cbfcca7219a5e
2025-02-14 03:01:41 +00:00
Menghan Li
c86e2f3472 feat(A11yFeedback): Add feedback entry for Accessibility page
This entry point allows users to access in the action bar.
Visibility is controlled by the aconfig and FeedbackManager#isAvailable

Bug: 393981463
Test: atest AccessibilitySettingsTest
Flag: com.android.server.accessibility.enable_low_vision_generic_feedback
Change-Id: I8c219b8220b5839121d14959fe526e6200afeecb
2025-02-14 03:01:13 +00:00
Jacky Wang
2ac3cdfb22 Fix memory leak on Accessibility screen
The root cause is that androidx.preference.Preference does not implement
equals and hashCode methods, but it is used as Map key (see bug comment2
for more details). Given that Preference.getParent() can find the
category, we can simplify the data structure from Map to List.

Bug: 388696327
Flag: EXEMPT bugfix
Test: Resume/Pause Accessibility screen 100 times
Change-Id: Ib70acbf2147048730f8a4e8fd66731f9efdadecf
2025-01-09 18:57:38 +08:00
Riley Jones
178bdd4c60 Cleanup of AccessibilityUtil#hasValueInSettings
Settings should now be able to directly use the equivalent ShortcutUtils functions,
so the unnecessary code is being removed from AccessibilityUtil.
This does cause much behavior to depend on A11yManager instead of Settings.Secure,
so several tests need their conditions updated.

Test: atest com.android.settings.accessibility
Flag: EXEMPT internal refactoring
Bug: 367414968

Change-Id: I95f81f7d78b074def0fe2d1e01f60ceb7e142dac
2024-12-17 20:03:16 +00:00
Riley Jones
6d1c378972 Merge "Cleaning up quick settings flag in Settings app" into main 2024-12-03 22:03:04 +00:00
Riley Jones
acccaff128 Cleaning up quick settings flag in Settings app
Removes all instances of a11y_qs_enabled. Any code that would be nontrivial to remove has been deprecated for later cleanup.

Test: atest com.android.settings.accessibility
Flag: EXEMPT flag cleanup
Bug: 367414968

Change-Id: I81f3c9cee377535eaa552a170d58ec1a79d1da65
2024-12-02 20:38:10 +00:00
Cam Bickel
de0e5cdff9 Cleanup flag "check_prebundled_is_preinstalled"
Bug: b/353888087
Test: atest AccessibilitySettingsTest
Flag: EXEMPT flag cleanup
Change-Id: Ia16cc83b1d499bac3845c7397ae1ac3e4c97ae91
2024-11-22 17:27:10 +00:00
Chun-Ku Lin
3f19805209 Provide installed a11y services/activities from dynamicRawData for search
Bug: 354076686
Flag: com.android.settings.accessibility.fix_a11y_settings_search
Test: Search Project Relate and verify the item shows up in the search
result
Test: Search Talkback with keywords, verify the Talkback shows up in the
search result
Test: atest AccessibilitySettingsTest

Change-Id: I258ecb0928308b7cde30c12104408e11cc25ecd5
2024-09-12 17:20:04 +00:00
Daniel Norman
c38fd822ba Stops hiding a11y services with the same package+label as an activity.
Bug: 353700779
Test: atest AccessibilitySettings, ensure new test passes
Test: revert AccessibilitySettings.java change, ensure new test fails
Test: Install poc APKs from the bug, observe issue not reproducible
Flag: NONE security fix
Change-Id: Ie680e80169aa734f2559fe50ef06e4d1eae46779
2024-08-14 22:48:06 +00:00
Yuchen Sun
ed3594fe61 Merge "Clean up preference_summary_default_combination in Settings." into main 2024-07-24 04:29:03 +00:00
Yuchen
48f304a23f Clean up preference_summary_default_combination in Settings.
Test: Existing tests passed
Flag: EXEMPT clean up
Bug: 328519240
Change-Id: I86996c43243b7a8e2d4b1a83180c189986b3a6ca
2024-07-24 02:36:09 +00:00
Daniel Norman
20d2eabe35 Checks that prebundled categories contain only preinstalled contents.
Bug: 353888087
Test: atest AccessibilitySettingsTest
Test: manually check all prebundled services are still in their proper
      groups, even after installing an APK update
Flag: com.android.settings.accessibility.check_prebundled_is_preinstalled
Change-Id: I023db9c37d7990deb50c9eec516619f0a8db65b7
2024-07-22 21:42:59 +00:00
Daniel Norman
c3b2165dfe Update A11ySettings to load preferences in onCreate().
This version still only loads preferences once, but the previous attempt
commit 774bbc1ff2
created a "sliding" effect as the preferences were loaded after the page
became visible to the user.

Also reorders methods so that their position in the source file matches
the Activity lifecycle ordering.

Bug: 327052480
Test: existing A11y Settings robotest presubmit
Test: Launch this page from the Settings app, observe no sliding UI
Flag: NONE low risk visual bug fix
Change-Id: I44312ada359aef7dec8eb27c57cde2a8e00f254b
2024-06-01 22:24:18 +00:00
TYM Tsai
9fc6c88697 Rmove unuseful test for PackageMonitor change
In PackageMonitor, it is no longer based on broadcast receivers to
listen package added/removed/... events. Therefore the verification
should be removed.

Bug: 340387113
Test: atest SettingsRoboTests:com.android.settings.accessibility.AccessibilitySettingsTest
Change-Id: I7b0d46add06c74f1b9bf1097f92dececa9b130de
2024-05-20 15:13:37 +00:00
Chun-Ku Lin
deba8599d8 Reflect QS shortcut changes in a11y pages.
Bug: 314843909

Test: manual (modify qs tiles in QS panel while the a11y page is open,
verify the a11y page reflect the qs changes)
Test: atest com.android.settings.accessibility
Test: atest com.android.settings.accessibility.shortcuts

Flag: ACONFIG android.view.accessibility.a11y_qs_shortcut

Change-Id: Ie5b46459faab902912a214ca131eb5d0b105a7ef
2024-03-12 01:32:00 +00:00
Hani Kazmi
206300962f Replace ECM AppOps call with service
A new ECM service was introcuded in changeId
I831391e4437b51b3312b5273a2360bd029a3d8ee.

We begin calling it, and update/cleanup method signatures to match.

Note: There are two feature flags:

1. enhancedConfirmationModeApisEnabled - read only, protects the
   mainline API.

2. extendEcmToAllSettings - runtime - gates calls to the above APIs.

We use both so we can ramp up in teamfood as needed.

Bug: 297372999
Test: Tested on device
Test: atest SpaPrivilegedLibTests
Test: atest com.android.settings.applications.specialaccess.notificationaccess
Test: atest com.android.settings.datausage
Test: atest PremiumSmsAccessTest
Test: atest RestrictedPreferenceHelperTest
Change-Id: I945ec51df5cd63de548a8ffdd1acc4f09f2301e5
2024-02-21 14:43:02 +00:00
Chun-Ku Lin
9a0c7ba7da Fix AccessibilitySettingsTest
**Root cause**
- We can no longer mock the fragment.getActivity method because it's a
  final method.
- We need to use custom shadows to implement the method we use but not
  shadowed in Robolectric. (e.g. ColorDisplayManager's
  isReduceBrightColorsActivated method)

Bug: 300157873
Test: atest AccessibilitySettingsTest
Change-Id: Ia7d039dd2e31e6b4a7b9382827f9006d4133ca1d
2023-10-13 21:55:22 +00:00
Rex Hoffman
3c961e1c0e Setup external/robolectric for SettingsRoboTests
Current failing tests: ab/I64100010182936387
Had to Ignore some of com.android.settings.accessibility tests, which will be fixed separately

Bug: 261728063
Test: atest SettingsRoboTests -- --test-arg com.android.tradefed.testtype.IsolatedHostTest:java-flags:-XX:CompressedClassSpaceSize=3g

Change-Id: I4a0cb992db924936826e0c9808accc78dddb5f30
2023-08-17 22:33:20 +00:00
Chun-Ku Lin
b65108ba1b Split the string resource id for non-generic accessibility preference.
- Keep the accessibility settings strings the same as in U.

Bug: 289425138
Test: manual
Test: atest
Change-Id: Iddbbfe627c93529d2421e153094a30628229c4bc
2023-08-08 19:17:54 +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
Daniel Norman
8f5c6d06b5 Stop asserting on internal PackageMonitor details.
Fix: 289324081
Test: SettingsRoboTests
Change-Id: Ia4cdd3b4e994786ba2cbc3045c181eb9339f12d7
2023-06-29 19:15:25 +00:00
Chun-Ku Lin
b34dcecc58 Adding ShadowBluetoothAdapter for the test
Many robotests that touches BluetoothAdapter might need to use our own
ShadowBluetoothAdapter which implements a "fake" getSupportedProfiles
call, so that the test won't trying to execute the android framework's getSupportedProfiles method.

Bug: 285235777
Test: atest AccessibilitySettingsTest

Change-Id: I5b3b2f4528a2b32aff22928653c57576981c0ff9
2023-06-01 17:50:10 +00:00
Chun-Ku Lin
b8084ecfcd Unified service and shortcut state summary on a11y settings page.
Bug: 210026562
Test: manual
Test: atest

Change-Id: I4d5ff6b10d6bfd2fe6b3de1849d00a9d084bf269
2023-05-23 22:19:55 +00:00
Daniel Norman
203d362d2d Stops @Ignore-ing a11y robotests.
Our team is trying to determine the state of our tests in automation,
which is tough to do when some tests are skipped completely.

A11y SettingsRobotests are currently run only in postsubmit, so even
if the Ignored tests fail it should not cause presubmit issues.

Bug: 279082331
Test: Use go/abtd to ensure tests run (and some fail)
Change-Id: I767b25427e748b7e94ab05e81a2f645f8b6279cf
2023-05-19 21:32:19 +00:00
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
Angela Wang
0e48c55a2a Fixes fail test cases in AccessibilitySettingsTest
AccessibilityHearingAidPreferenceController can't be instantiated
correctly in tests with the lack of LocalBluetoothManager. This causes
null pointer exception when
AccessibilityHearingAidPreferenceController.setFragmentManager() is
called in AccessibilitySettings.onAttach().

Solution: Mocks the LocalBluetoothManager for tests to successfully
instantiate AccessibilityHearingAidPreferenceController to prevent null
pointer exception from happening.

Bug: 269407238
Test: atest AccessibilitySettingsTest
Change-Id: Ibcfffa10b46fd6e85c1b74b03343e5ee0e8843b3
2023-02-20 06:33:58 +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
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
Wei Wang
fcd3c608bf Ignore all failing tests in Settings for now in order to unblock ATP V2
migration

Test: m RunSettingsRoboTests passed on desktop
Change-Id: I2450aaa083aabdf224e070f588441bb01206972b
Bug: 252671269
2022-10-13 17:29:36 +08: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
acd3f94fde Pop up pairing another ear dialog when detecting hearing aid is a set
* Pop up dialog in 'Connected deivce' page and 'Accessibility -> Hearing
  aids' page

Bug: 225117454
Bug: 226511985
Test: make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidPairingDialogFragmentTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AvailableMediaDeviceGroupControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityHearingAidPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=HearingAidUtils

Change-Id: I34a1e3ac680a7efe97dc501bfbe93f840ad16364
2022-05-14 22:16:22 +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
Ricky Wai
d09d62a55e Apply restricted settings to notification access.
Bug: 202130031
Test: Able to boot without error
Test: When app is installed by PackageInstaller app, notification
access is being restricted. The restriction is being removed after
turing it restricted settings off for that app.

Change-Id: I9c1fbc80dd2ca4cc483a60dfa9d043aaa99cde87
2022-03-09 16:51:09 +00: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
Bonian Chen
a5ad2a5cb4 [Settings] Ignore failed test case
Ignore failed test case.

Bug: 201020932
Test: build pass
Change-Id: I434482fcaa2a4b0985bfbd27131df5996d249ac6
2021-09-24 05:50:48 +00: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
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
Alexander Dorokhine
46e85a2fad Migrate away from deprecated Truth APIs.
This is a transitional step towards truth 1.0.1, where these APIs have
been completely removed.

Bug: 168765701
Test: m checkbuild
Change-Id: I76f9c37cb699ce6ab8715ffe35d11668ccbceea1
2020-09-24 23:09:41 +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
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
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
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
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
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
Mill Chen
08c4c4aadd Separate shortcut preference controller form accessibility
Bug: 135056871
Test: manual, robotests
Change-Id: I1dc61d50f46dfbd9bbd6fa33ecbc03157427d0b1
2019-07-03 20:15:09 +08:00