Commit Graph

160 Commits

Author SHA1 Message Date
Chun-Ku Lin
f5cc0119ee workaround(expressive): Fix padding issues Setup > Vision settings
- Works around issue where Setup and Settings libraries are clashing
  when applying their new expressive themes at the same time.
- Updates illustration prefs to match parent width. Otherwise this new
  padding workaround causes the images to get clipped.

Fix: 390545391
Bug: 400479388
Test: manual only; see screenshots
Flag: EXEMPT using custom flagging from Setup ThemeHelper lib
Change-Id: Ie00cdf3e68a2ff7c40aedd04eb5bed0adaa9cf84
2025-03-14 14:00:04 -07:00
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
Candice
7f70f5b633 Add a content description for the illustration if it is an animation
Since `isAnimatable` is decided in `onBindViewHolder`, we need to register
an onBindListener and update the content description if the current
illustration is an animation.
For the static images, we would like to skip them in Talkback since they
are decorative images.

Bug: 395882764
Test: manually. attach screenshot to the bug
Test: atest ToggleFeaturePreferenceFragmentTest
flag: EXEMPT. bugfix
Change-Id: I57bf96d0891ba553ef29d25ae9489f34b2a832e9
2025-03-06 06:53:48 +00:00
Menghan Li
9ffca7cbfc feat(A11yFeedback): Add feedback entry for downloaded Accessibility
This entry point allows users to access in the action bar.
Visibility is controlled by the aconfig and FeedbackManager#isAvailable

Bug: 393980229
Test: Manual testing on Pixel and non-Pixel devices
Test: atest ToggleFeaturePreferenceFragmentTest
Flag: com.android.server.accessibility.enable_low_vision_generic_feedback
Change-Id: Ie6dfb6a887fe5a894622e86bab39878f8adea758
2025-03-05 05:24:38 +00:00
Chun-Ku Lin
0f84b652cc Make ColorAndMotionFragment fully in Catalyst
Bug: 392190782
Test: manual (verify the navigation and the search still works the same)
Test: atest
Flag: com.android.settings.flags.catalyst_accessibility_color_and_motion

Change-Id: I7717390c70246503aec545991fd9a40be5152373
2025-02-17 03:01:36 +00:00
Riley Jones
75500c02b2 Cleanup of deprecated A11y settings functions
Bug: 367414968
Test: atest com.android.settings.accessibility
Flag: EXEMPT cleanup
NO_IFTTT= Change does not alter preference list

Change-Id: I64f5f7fba112b6fb5035b88f01c04d9ee309f2c0
2025-01-21 21:07:34 +00: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
f337bf1fad Cleaning up deprecated QS tooltip code
Flag is rolled out, so tooltips other than font size shouldn't show anymore.
Much code can be removed.

Flag: EXEMPT code cleanup
Test: atest com.android.settings.accessibility
Bug: 367414968
Change-Id: I55084982fee0d0537aade49d36f52e121e24574b
2024-12-10 21:20:15 +00:00
Riley Jones
dec6b37fe4 Merge "Cleanup deprecated functions in AccessibilityUtil" into main 2024-12-06 18:25:34 +00:00
Riley Jones
6107fd8591 Cleanup deprecated functions in AccessibilityUtil
Flag: EXEMPT code cleanup
Bug: 367414968
Test: atest com.android.settings.accessibility
Change-Id: If69a964720fc91ce0ad3661f956c4818f4f2f9dd
2024-12-05 23:45:33 +00:00
Daniel Norman
908bd398bd Adds null checks on callers of Nullable method getA11yServiceInfo().
Also renames mPackageName to mFeatureName. This string is used as the
user-visible feature name, e.g. TalkBack, not the APK package name.

Fix: 382054546
Test: n/a (existing presubmit)
Flag: EXEMPT minor bugfix
Change-Id: I1ce6902612d89bbb68bddf30227ca231ea98dce7
2024-12-04 19:41:07 +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
chenjean
012ba80c50 Create a method to allow child classes to define it's main switch toggle's pref key
We'd like to make the main switch toggle's preference searchable. Since we construct the preference programmatically, this would allow the preference to be automatically scrolled to when the user is brought to this page from a search result.

Bug: 372171003
Flag: EXEMPT refactor
Test: manual
Test: atest ToggleColorInversionPreferenceFragmentTest
      atest ToggleDaltonizerPreferenceFragmentTest
      atest ToggleFeaturePreferenceFragmentTest
Change-Id: I6eed7598ad296a758573318cf4bde5de30c7005c
2024-10-08 18:08:17 +08:00
Riley Jones
3d4b0c5440 Refactoring A11y shortcut functions in Settings to use GESTURE
Properly integrating GESTURE into Settings, so that text pertaining to the gesture shortcut are displayed when appropriate.
Heavy refactoring has been done to allow for easier cleanup and expansion

Demo video: https://x20web.corp.google.com/users/jo/jonesriley/splitShortcut/a11ySettingsGestureCompat.mp4

NO_IFTTT=changes do not alter the order of the shortcuts.

Bug: 365570709
Test: atest com.android.settings.accessibility
Flag: android.provider.a11y_standalone_gesture_enabled
Change-Id: If90719763a48e3b8bc35988a1de9a352a766953b
2024-09-28 02:50:09 +00:00
Daniel Norman
1890c16f90 Populates collection info count for A11y toggle feature pages.
This helps an accessibility service like TalkBack inform the user that
there are items that are skipped when navigating the list because they
are unimportant to accessibility.

Bug: 318607873
Test: atest AccessibilityFragmentUtilsTest
Test: atest ToggleScreenMagnificationPreferenceFragmentTest
Test: Enable TalkBack that supports the collection info count feature,
      open any of the pages from the bug, observe the item count and
      (un)important count are correct.
Flag: com.android.settings.accessibility.toggle_feature_fragment_collection_info
Change-Id: If64c89f2eb2f8301076baa79b9530124c850d2fc
2024-08-27 23:36:19 +00:00
Chun-Ku Lin
919019ca56 [Flag cleanup] edit_shortcuts_in_full_screen is always on now
- Cleaned up the code that won't be executed when the flag is on
- Remove unused resources

Bug: 300302098
Test: Manually verify the user can change the shortcut type, and the
changes are saved
Test: atest com.android.settings.accessibility
Flag: EXEMPT removing com.android.settings.accessibility.edit_shortcuts_in_full_screen

Change-Id: I1e32b724ca3da909feda55e20fb1d51dc4680c09
2024-07-25 22:49:02 +00:00
Riley Jones
d902bdbb62 Merge "Refactoring Accessibility settings to use ShortcutConstants.UserShortcutType" into main 2024-07-09 20:59:30 +00:00
Riley Jones
8f313621aa Refactoring Accessibility settings to use ShortcutConstants.UserShortcutType
This removes AccessibilityUtil.UserShortcutType,
replacing all mention of it with ShortcutConstants.UserShortcutType

NO_IFTTT=UI order not changed
Test: atest com.android.settings.accessibility
Bug: 322014084
Flag: EXEMPT internal refactoring

Change-Id: I18695d040c4bd08a455143594e770adda2b1a8de
2024-07-01 19:42:32 +00:00
Roy Chou
2f1a7d6155 chore(onefingerpan): update onefingerpan preference summary and magnification settings page footer description
Based on b/338409557#comment5, we update the onefingerpan toggle's
summary, and make the magnification settings page's footer HTML
description be dynamic based on one finger panning preference state.

Bug: 338409557
Flag: com.android.server.accessibility.enable_magnification_one_finger_panning_gesture
Test: manually
      atest MagnificationOneFingerPanningPreferenceControllerTest
      atest ToggleScreenMagnificationPreferenceFragmentTest
      atest ToggleFeaturePreferenceFragmentTest
Change-Id: I817cad4fb0c034bcd2db0485ca27c30ea88a0280
2024-06-25 14:22:27 +00:00
Chun-Ku Lin
09efbe453c Pass user preferred shortcut types when launching the
AccessibilityShortcutsTutorial.

**Root cause**
When toggle the shortcut, it asks the AccessibilityManager to turn on
the shortcut and update the Settings data. Internally, the
AccessibilityManager delegate the work to AccessibilityManagerService
via a oneway binder call.

In the past, when launching the AccessibilityShortcutsTutorial, we
assume the shortcut selection are saved in the Settings before launching
the AccessibilityShortcutsTutorial. So we pass whatever are in the
Settings as what the user has selected to the tutorial.
This is not true anymore since we use the oneway AIDL call to do the
updates. The data in Settings may not yet be  updated before we use it to
launch the tutorial.

Since the user preferred shortcuts are always set before we attempt to
launch the AccessibilityShortcutsTutorial, we can rely on it instead of
the Settings value to launch the AccessibilityShortcutsTutorial for the
selected shortcut options.

**Changes in this cl**
- Mechanical refactor to extract the lines to get the user preferred
  shortcut into a method.

- Use the new method to grab the shortcut options to pass to the
  AccessibilityShortcutsTutorial to prevent the crash.

Bug: 341176890
Test: manual
    - Modify the AccessibilityManagerService locally to delay processing
      the request to update the shortcut options in Settings data
    - Turn on the shortcut toggle, and verify the app won't crash

Test: atest com.android.settings.accessibility
Flag: EXEMPT bugfix (low risk + mechanical refactor)
Change-Id: Id3cc4cc5f6667061545955881632544472aedd95
2024-05-21 23:33:55 +00:00
Chun-Ku Lin
dd915a5031 Clean up usages of flag remove_qs_tooltip_in_suw
This bug-fixing flag has been in Trunkfood in two months.

Test: existing presubmit (no functional change)
Bug: 294560581
Change-Id: I05282f1f7ee6b1bb4e4bf873771d80ae68204b4c
2024-04-01 20:13:01 +00:00
Jason Chiu
d2b586c939 Merge "[Safer intents] Accessibility" into main 2024-03-27 02:03:11 +00:00
Chun-Ku Lin
4c9d268fdf Rename AccessibilityGestureNavigationTutorial to AccessibilityShortcutsTutorial
AccessibilityGestureNavigationTutorial is not only for displaying
tutorial for accessibility gesture shortcut. It's used for display the
tutorials for all the selected accessibility shortcuts. Renamed the
class to match it's responsibility.

Bug: N/A
Flag: EXEMPT Strict mechanical refactors
Test: build succeed locally

Change-Id: I1dd212abc660454e77f18f770c2ecc17be320eaa
2024-03-26 01:13:28 +00:00
Chun-Ku Lin
3aee92e2e8 Update a11y edit shortcut screen's text and tutorial text
Bug: 323792194

Test: manual
Test: atest com.android.settings.accessibility
Test: atest com.android.settings.accessibility.shortcuts

Flag: N/A simple string changes

NO_IFTTT=Introduce new IfThisThenThat lint

Change-Id: I7ba4096d669453c33257880407e85ffe76d358f8
2024-03-25 22:19:10 +00:00
Jason Chiu
d785397930 [Safer intents] Accessibility
To avoid implicit intents, make intents launch explicitly.

Bug: 323061508
Test: build
Change-Id: I5be489f4e6b855156b8dd6b8e54b0b6116f728ad
2024-03-25 17:05:41 +08:00
Chun-Ku Lin
5cdf972b50 Make QS shortcut type as default preferred shortcut for A11yService that
associate with a TileService

Bug: 322712028
Test: manual (Turn on the shortcut for the first time for various
feature with or without tile. Verify only the A11yService with tile
would show QS as the shortcut when directly turn on the main shortcut
toggle)
Test: atest com.android.settings.accessibility

Flag: aconfig android.view.accessibility.a11y_qs_shortcut
Change-Id: I569b417639d2db8b7eddd818a2b9037ed4be2509
2024-03-18 00:14:43 +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
Chun-Ku Lin
8b67c17a7b Show QS shortcut option if the a11y feature provides a tile.
Bug: 314852953
Test: atest com.android.settings.accessibility
Test: atest com.android.settings.accessibility.shortcuts
Test: manual
Flag: ACONFIG android.view.accessibility.a11y_qs_shortcut STAGING
Change-Id: Id7a6b3adfd4c4f3cb2b9f7fe15269b57a3d00543
2024-03-06 20:26:28 +00:00
Chun-Ku Lin
1d1b9e451f Move the default shortcut types in a separate utility method.
Bug: 322701168
Test: atest
Flag: N/A (Strict mechanical refactors, no behavior change)
Change-Id: I1beb36e5aeeec0f303228b57baf034a000a72b75
2024-01-29 02:17:49 +00:00
Chun-Ku Lin
64e946c7fa Convert a11y shortcut edit screen to a full screen.
Bug: 300302098

Flag: adb shell device_config put accessibility com.android.settings.accessibility.edit_shortcuts_in_full_screen true

Test: manual
Test: atest com.android.settings.accessibility.shortcuts

Change-Id: I0b5e367fed962ff01036122ce7ff32a8ae47fbc3
2023-12-14 20:50:33 +00:00
Chun-Ku Lin
0f2cc34230 Don't show quick settings tooltip if the user is in the Setup Wizard,
since the user can't access the Quick Settings Panel.

Bug: 294560581
Test: manual
- Turn on feature flag: adb shell device_config put accessibility com.android.settings.accessibility.remove_qs_tooltip_in_suw true
- Modify the font scale in SUW, verify the QS tooltip doesn't show up
- Modify the font scale after SUW, verify the QS tooltip shows up
Test: atest SettingsRoboTests:com.android.settings.accessibility

Change-Id: I1d1a4f8f70ea3e1d929952d5c273de1b4cd80503
2023-11-14 23:30:49 +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
Daniel Norman
8946e64f28 Adds 'App info' button on accessibility service + activity pages.
This launches the existing app info page for the a11y feature's owning
package. Features without a valid component (framework features) do not
have this button. This is also not shown in Setup Wizard which does
not support the App Info page.

This helps users find more info about the app that provided an
accessibility feature.

Screenshot: https://screenshot.googleplex.com/B9FXLoomxFjLBv8.png
Flag: accessibility com.android.settings.flags.accessibility_show_app_info_button

Bug: 277378550
Test: atest ToggleFeaturePreferenceFragmentTest (robotest)
Test: Open and interact with the button, ensure it opens the app info
      page for the correct app.
Change-Id: I2041c09077ce5fadc72117dc0c72409dd33ef60b
2023-10-20 21:31:11 +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
Candice Lo
3dab6548b9 Cleaning up tooltip for ToggleFeaturePreferenceFragment
Cleaning up QS tile tooltip in the Settings page in onDestroy to avoid
leaking the window.

Bug: 279547549
Test: manually check only one tooltip exists
Change-Id: I781cdba1be7be0315de12cd57620521b40969aee
2023-05-16 06:27:44 +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
jasonwshsu
2bf80d8bf2 The string of "Hearing device shortcut" is displayed wrong when shortcut set to gesture.
Root Cause: Did not update dialog when user back to previous page.

Solution: Merge the solution in ToggleFeaturePreferenceFragment.java

Bug: 263451053
Test: manual test
Change-Id: I99513fa70cf44b32a0fb78a5f953e41373e086f4
2023-03-12 20:47:25 +08:00
Arc Wang
1596a2838d Allow Magnification Settings launch from outside of AccessibilitySettings
Before this CL, Magnification Settings can only be
launched from MagnificationPreferenceController.

This CL initializes FooterPreferenceController if the
parent class does not initialize it from Intent extras.

Bug: 268411305
Test: manual
      make RunSettingsRoboTests ROBOTEST_FILTER=MagnificationGesturesPreferenceControllerTest
      make RunSettingsRoboTests ROBOTEST_FILTER=ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: I954739c39c823ce7fe0daa711743f729d182571b
2023-02-24 15:56:43 +08:00
menghanli
bea25c7513 Fix certain Accessibility Settings subpages use wrong resources
Root cause: Portrait mode does not always respect the sw600dp qualifier and instead uses the phone (default) resources.
Solution: Using the product to customize the tablet and phone cases is better way than using the configuration qualifier.

Bug: 269130587
Test: Manual testing
Change-Id: I90cc44f1e9bccf8950a4d89f70119ba5e3c0bfdc
2023-02-14 17:13:36 +08:00
jasonwshsu
ce487188a0 Fix TalkBack shortcut keeps showing enabled when entering into that page.
Root Cause: TextUtils.isEmpty() will return true both null and empty case, and write config key into it.

Solution: Write config key only if settings key is null. That means no one (developers or users) touch the key ever, so we should respect config key here.

Bug: 255912415
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleFeaturePreferenceFragmentTest
Change-Id: I092975ea3de8fce78b7ae2a6241a30f6af8125a6
2022-11-10 12:21:04 +00:00
Angela Wang
c4f3295491 Fix should not let users adjust a11y button settings in SuW issue
Root Cause: Users should not be able to adjust any settings of the a11y
button in the setup wizard flow, but there will be a link button to
a11y button settings page on the a11y tutorial dialog where user can
modify the settings.

Solution: Hide the link button in a11y tutorial dialog if we know the
dialog is launched from any setup wizard page.

Bug: 256084341
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityGestureNavigationTutorialTest
Change-Id: I742f9b7ba311fcd7a5105463709dc104345b9f12
2022-11-01 07:07:47 +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
menghanli
057c5dc8ed Fix no show quick settings tutorial after device rotates
Root cause: Render apps below the cutout area to make the fragment recreate multiple times when the device rotates. The tutorial status is not stored correctly and try to show the tutorial when activity is finishing.
Solution: Avoid showing the tutorial when the activity is finishing and store correct tutorial status after recreate.

Bug: 239578655
Test: Manual testing
Change-Id: I3ff12e23eb971f61280ebc89014b086dc348d734
2022-08-22 15:54:05 +08:00
jasonwshsu
15c73a5f83 Change updatePreferenceOrder() to onCreateView()
Root Cause: change preferences' order in onViewCreated() will see the
order moving animation.

Solution:
* Move to onCreateView() can avoid seeing the order moving animation.
* Move onProcessArguments() to onCreate() to let it be called as early
  as possible. Also let it align the calling getArguments() behavior in
  parent class PreferenceFragmentCompat.

Bug: 171272809
Test: make RunSettingsRoboTests ROBOTEST_FILTLTER=ToggleFeaturePreferenceFragmentTest
Change-Id: Ib9cb9b6df232ddcb681683ac2fcd2c6406c7a487
2022-07-13 00:41:00 +08:00
jasonwshsu
8145631ab8 Migrate to DashboardFragment in ToggleFeaturePreferenceFragment
Root Cause: ToggleFeaturePrefreferenceFragment becomes heavy when more and more features come in.

Solution: Mirgrate to DashboardFragment, a plugin-style preference controllers, can help us separate the preference and its logic into its own controller.

* This is the first step for the whole migration. Change to extend DashboardFragment and fill up the missing override functions.
* Reorder fields and functions to the recommended general approach.

Bug: 171272809
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.accessibility

Change-Id: I852091700a4b3b3c7bbdbc82f0b5dc47c087d61c
2022-07-13 00:40:55 +08:00
Menghan Li
361d42afe5 Merge "Fix inconsistent shortcut strings on accessibility setting and edit dialog" into tm-dev 2022-04-15 04:00:11 +00:00
menghanli
50520c2d3f Fix inconsistent shortcut strings on accessibility setting and edit dialog
Root cause: Base class provides an override function for accessibility settings shortcut preference. But, it cannot update to the edit dialog.
Solution: Refine the resilience function and base class apply into accessibility settings shortcut preference and edit dailog.

Bug: 228830417
Test: Manual testing on all accessibility page and edit dialog
Change-Id: I84bc63a39cd9cfa7e12944dff20ee6b92879008d
2022-04-15 00:31:03 +00:00
Jason Hsu
7a5ade7e9f Merge "Write default accessibility service only when user enter into corresponding page." into tm-dev 2022-04-12 10:18:43 +00:00