Commit Graph

140 Commits

Author SHA1 Message Date
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
Isaac Chai
46369353ed Adding Settings preference for single finger panning feature
Test: Locally tested on device +
MagnificationOneFingerPanningPreferenceControllerTest
Bug: 282039824

Change-Id: I1d1a649060cba862c8f333e6e76184fade2dcdce
2024-03-05 19:10:59 +00:00
Roy Chou
654e43b2e8 chore(magnification): remove onResume overrides for controllers in ToggleScreenMagnificationPreferenceFragment
As b/186731461, so far MagnificationModePreferenceController and other
magnification preference controllers are only used in
ToggleScreenMagnificationPreferenceFragment, which is DashboardFragment.
Since DashboardFragment already updates preference state in its
onResume, so we can remove the onResume overrides in those controllers.
Besides, we can also remove the LifeCycle dependency for the controllers
since it's not used anymore.

Bug: 186731461
Flag: NA
Test: manually
      atest ToggleScreenMagnificationPreferenceFragmentTest
      atest MagnificationAlwaysOnPreferenceControllerTest
      atest MagnificationFollowTypingPreferenceControllerTest
      atest MagnificationJoystickPreferenceControllerTest
      atest MagnificationModePreferenceControllerTest
Change-Id: I379a6a3a985c9d8b7a37bbb878b84cee1bd6adfb
2024-03-04 03:44:59 +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
Jean Chen
097d8a891b feat(MultiFingerMultiTap): Update shortcut string to double tap from triple tap
Bug: 315264770
Test: manual
Change-Id: I1130271d06bac71f23a137c83149ee3363a1cc0e
2023-12-08 10:12:43 +08:00
Daniel Norman
01e624c76b Adds a summary to the (screen) Magnification preference for the main A11y Settings page.
This helps differentiate this from other magnification tools.

Reuses (and slightly modifies) the `magnification_feature_summary`
string which was not used by any existing code. This helps ensure
the existing localizations should be close enough, until L10n
translators have time to update based on the new shorter version.

Bug: 303499185
Test: ToggleScreenMagnificationPreferenceFragmentTest
Test: Open Settings > Accessibility, observe summary
Change-Id: If5ee4f937bbd655b425d4767ad8bbcef08dbe345
2023-12-06 01:10:52 +00:00
Jean Chen
48d73aa3f3 feat(MultiFingerMultiTap): Add two-finger triple-tap shortcut on magnification dialog
The shortcut is separate from single-finger triple-tap. It’s under hardware shortcut and above/outside of Advanced section.

Bug: 297805269
Test: manual
Test: atest ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: Id74cf3e457c04e167f3100d977b6c70c5d601026
2023-10-25 13:30:27 +00:00
Chaohui Wang
cfdb3b1f1b Migrate new() to SwitchPreferenceCompat
Bug: 306658427
Test: manual - on Settings pages
Change-Id: I258a8c63d5c46403c6d333a9d2f34c33cb35e27f
2023-10-24 14:05:34 +08: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
Jean
137cc9af68 Set the shortcut size to large when user enabled Magnification
Set the settings shortcut size to large when the Magnification shortcut it enabled. Provide users with the large size as the default, which is easy to see.

Bug: 283844702
Test: manually - attach videos in the bug
Test: atest ToggleScreenMagnificationPreferenceFragmentTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: I8fac5780b8388b1b4f124cffbdd305235f035e72
2023-07-11 02:21:09 +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
Roy Chou
3b963fee25 Merge "chore(#AlwaysOnMagnification): hardcode the feature flag default true" into udc-dev am: 412c248c10 am: 32a2e30074
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23199816

Change-Id: Ifcb580e3e5379a4e33ce753425582e74ca535925
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-12 17:38:43 +00:00
Roy Chou
0aa67ede68 chore(#AlwaysOnMagnification): hardcode the feature flag default true
Set the feature flag getter default return value to be true to rollout to public. We keep the checking code so that it's still remote controllable.

Bug: 281788002
Test: manually test with adb command
Change-Id: Ie7f32721cf99d8a97c11f0f9c6d0d466c083d668
2023-05-12 15:57:56 +00:00
Chun-Ku Lin
b7d513b84d Remove unused MagnificationPreferenceFragment and its related controllers
Bug: 277258376
Bug: 270481978
Test: manually on Pixel & AOSP
Change-Id: I1e0bbecf78290b85e464a4a5de658184eb91ca2c
2023-04-12 00:51:45 +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
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
Tyler Freeman
35def91fcc Merge "feat(#MagnificationJoystick): add preference for enabling Joystick to Settings" 2023-02-11 01:04:00 +00:00
Tyler Freeman
43d5042ff9 feat(#MagnificationJoystick): add preference for enabling Joystick to Settings
Hide behind feature flag so no one sees the preference unless its enabled.

Bug: b/265688847

Test: atest MagnificationJoystickPreferenceControllerTest

Change-Id: Id5cc9385f25395f53809a79ba70c84205f9758c2
2023-02-10 19:19:11 +00:00
Chaohui Wang
caa04b6303 Revert "Fix Java 8 un-compilable code."
This reverts commit c9fc8bca94.

Reason for revert: No longer need Java 8 compilable

Change-Id: I4ada6a74c7030899a8c5fb646440acee79149dce
2023-02-09 06:07:20 +00:00
Zaiyue Xue
c9fc8bca94 Fix Java 8 un-compilable code.
Test: manual
Change-Id: I84cabab4d2753202143175d838d635c69daf090e
2023-02-08 16:09:16 +08:00
Tyler Freeman
36557e9810 fix(#AlwaysOnMagnifier): update state when setting is changed outside the app
Refactor to keep track of all controllers and notify them all when a key
changes, similar to ColorAndMotionFragment.java

Bug: b/265086261
Fix: 267433655

Test: atest packages/apps/Settings/tests/robotests/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentTest.java
Change-Id: Id44d1d4074318aff8c4c4bc6f07d65b3e0ffc561
2023-02-07 23:14:54 +00:00
Tyler Freeman
193b366ed6 feat(#AlwaysOnMagnifier): add preference for enabling Always On Magnification to Settings
Hide behind feature flag so no one sees the preference unless its enabled.

Defaults to enabled.

Bug: b/265086261

Test: manual

Change-Id: Ic32353f2b139772fe905137c9ec137925ef6ebb9
2023-01-31 21:48:49 +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
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
Edgar Wang
68d12953e7 Update learn more string of FooterPrefernce
Replace FooterPreference#SetLearnMoreContentDescription() with
FooterPreference#SetLearnMoreText().

This is a requirement: All links, controls, and buttons should
also have comprehensible text or tooltip text, so users can identify its
purpose, independent of context, such as when using the URL list from
TalkBack’s local context menu.

Bug: 215045903
Test: manual & robotest
Change-Id: Ib657ba336c5688c1434a58611dea3891001afe14
2022-05-13 08:13:36 +00:00
jasonwshsu
87e0b3c7e5 Correct Magnification shortcut title in edit shortcut dialog
Root Cause: Magnification has its own edit shortcut dialog, but we did not
update correct title with getShortcutTitle()

Solution: set dialog title to getShortcutTitle()

Bug: 231531313
Test: manual test
Change-Id: I0679be2807a4b1f8b8a733604e16a35b0a1258c3
2022-05-12 17:33:07 +08:00
jasonwshsu
e48ebb9755 Correct Magnification shortcut title
Root Cause: Magnification has its own ShortcutPreference, but we did not
update correct title with getShortcutTitle()

Solution: Call setTitle(getShortcutTitle()) in initShortcutPreference()

Bug: 228752572
Test: manual test
Change-Id: I85b09a22032bad0a0c840590a98be88538a0499b
2022-04-25 02:53:15 +08: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
PETER LIANG
d4cd689c8f Merge "Fix that holding volume buttons to activate Extra dim feature doesn't do anything." into tm-dev 2022-03-25 14:06:00 +00:00
mincheli
57b35f9f35 Hides the settings entry in Magnification Settings if window magnification feature is not supported
If the device doesn't support window magnification featue, we
should hide the settings entry in mangification settings

Bug: 213414385
Test: atest ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: I73f087da54cd2930c049dabb6b843c3b373e3c20
2022-03-21 22:48:34 +08:00
Peter_Liang
f94762176f Fix that holding volume buttons to activate Extra dim feature doesn't do anything.
Root cause:
Original framework design which has 3 seconds restriction to prevent users from easily triggering the accessibility volume shortcut when first time using it.

Solution:
The system would bypass the 3 seconds restriction if users manually set any feature as the volume key shortcut.

Bug: 202602908
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleFeaturePreferenceFragmentTest
Change-Id: I324321577263904b6ff8b66e411766d16a6430dc
2022-03-17 15:49:45 +08:00
menghanli
99a9171108 Customized accessibility framework features quick setting tooltips content
- Lowercase for one-handed mode, color correction, color inversion, extra dim in quick settings tooltips if these words are not first words.

Bug: 220655084
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityShortcutPreferenceFragmentTest ToggleFeaturePreferenceFragmentTest LaunchAccessibilityActivityPreferenceFragmentTest ToggleAccessibilityServicePreferenceFragmentTest
Change-Id: I309ca48cecb80942112c9d5adde5857c062706c8
2022-03-10 06:40:54 +08:00
menghanli
ba9f097b03 Integrate Accessibility quick setting tooltips widget into ToggleFeaturePreferenceFragment
- Show tooltips when main switch is on
- Reshow tooltips when rotate device
- Add abstract functions for child components to show tooltips

Bug: 210356011
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleFeaturePreferenceFragmentTest
Change-Id: I543d8af7d24a9fc82659625961850f975a7a0787
2022-01-26 07:54:57 +08:00
Daniel Hsieh
6542b6efb8 Hide following typing preference setting in SuW.
Hide following typing switch preference setting in SuW.

Bug: 214876729
Test: Start set-up wizard > Assistive options > Vision settings >
           Magnification > Following typing preference is invisible
      make RunSettingsRoboTests ROBOTEST_FILTER=
           ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: I4ab64deeef321390c5b89c8ea58ea469fb5c09bf
2022-01-20 08:53:24 +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
Daniel Hsieh
6f4fb88538 Support following typing focus in window mode [3/n].
There are 3 milestones in this feature.
1. Refactor the callbacks for Accessibility in WindowManagerInternal.
2. Implement this feature in such new architecture.
3. Implement the setting choice in preference page.

This CL is for the 3rd milestone.

We add a preference key "magnification_follow_typing" to access and
update the ACCESSIBILITY_MAGNIFICATION_FOLLOW_TYPING_ENABLED value
which controls its corresponding preference page UI.

Bug: 194668976
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
	MagnificationFollowTypingPreferenceControllerTest
	ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: Ib2602c997a535c1acca6a7ddd7bb2c25921f9280
2022-01-14 07:11:05 +00:00
ryanlwlin
a992b611bf Fix incorrect UI after triple-tap is disabled
The preference summary is not changed after
users disable the triple tap shortcut by the confirm
dialog. It is due to the fact that the fragment doesn't
observe the settings value change.

To fix it, we add the settings key to observe the change.

Bug: 208755360
Test: manual test
Change-Id: Ie5b7fc5e67c5491b53485af0d3d68d1789aeace4
2021-12-03 01:58:25 +00:00
jasonwshsu
eba8e8da19 Fix software shortcut in dialog did not update when content change.
Root Cause: Dialog only get updated when clicked the trigger button to show dialog.

Solution: Update the software shortcut content in dialog if needed in onResume() stage.

Bug: 183342594
Test: atest AccessibilityDialogUtilsTest
Change-Id: Ibcd66d6c57f1790f96f234e49f456cbc2c990f64
2021-10-20 16:25:26 +08:00
menghanli
5af9c64110 [Material Next] Accessibility gesture tutorial dialog
Problem: The dialog does not follow the Material Next guideline
Proposal:
1. Apply the dynamic color by removing SettingsTutorialDialogWrapperActivity which set extra theme
2. Hanlde the recreate case if shows the dialog directly
3. Update new Illustration in Pixel Lottie asset

Bug: 195980595
Test: Manual test
Change-Id: Ib6267128bbe5522ac8720c15fc2720c9a78f8671
2021-08-18 11:22:08 +08:00
TreeHugger Robot
b1bdec314a Merge "Add back the shortcut dialog content for accessibility gesture" into sc-v2-dev 2021-07-22 18:54:00 +00:00
menghanli
bae720ffc3 Provides TC ID for accessibility framework feature for "about" and "learn more" part
Goal: Improve readability which is a bit difficult because of string concatenation for accurate translation.
Root cause: In some locales, framework features name would be a word rather than a product name. Hence it need to be in the different position in a sentence.
Solution: Use whole sentence to translate instead of concatenating the string could solve this issue.

Bug: 185478543
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityFooterPreferenceControllerTest
Change-Id: Id198805329be9c773df87f38a074ae956e4d0cdb
2021-07-14 15:15:48 +08:00
menghanli
a606c43adf Provides TC ID for accessibility framework feature for "shortcut" part
Goal: Improve readability which is a bit difficult because of string concatenation for accurate translation.
Root cause: In some locales, framework features name would be a word rather than a product name. Hence it need to be in the different position in a sentence.
Solution: Use whole sentence to translate instead of concatenating the string could solve this issue.

Bug: 185478543
Test: Manually testing
Change-Id: I5a0f04e7ab0d7aa789e10ce6f611cde9bf3660c1
2021-07-06 15:53:28 +00:00
menghanli
f07aa0fa90 Add back the shortcut dialog content for accessibility gesture
Below components are updated.
1. The dialog title, content, and customized link when edit shortcut.
2. The shortcut preference summary in Setting page.
3. The tutorial title and content when shortcut on.

Partial rollback from commit 5fe2cdcf87

Bug: 190563948
Test: Manual test
Change-Id: I5e39b46c9387b4bf5a10f14453be9988d8b7fc9c
2021-07-06 01:05:11 +00:00
Peter_Liang
3e06c2e599 Update the Lottie images for Accessibility features.
Features:
1.Magnification
2.Color Inversion

Bug: 188625240
Test: manual test
Change-Id: I51c1c230d5f230eb3d933c98253f0d9d2bf30d37
2021-06-10 14:53:39 +08:00
menghanli
78c093b0b3 Move DialogEumn into AccessibilityDialogUtils
Bug: 190022774
Test: Manual testing
Change-Id: I391089b675b415c26bbacd028caf1d1ab617e707
2021-06-07 13:38:50 +08:00
ryanlwlin
964872ab96 Fix incorrect seperator while concatenating shortcuts
We concatenate the selected shortcut with a comma
that is not localized. To fix it we use listformatter
to concatenate them.

Bug: 186891004
Test: manually test with differnt languages.
Change-Id: I2c6692facd457b434c56a0633e784ce771905b29
2021-05-21 16:32:23 +08:00
Menghan Li
fd05966f4f Merge "Fix style in "Vision Settings" is inconsistent" into sc-dev 2021-05-12 08:49:55 +00:00
menghanli
11a0700847 Fix style in "Vision Settings" is inconsistent
Root cause: "Accessibility button" page apply BC style but other pages in SUW didn't. It causes page style inconsistency.
Solution: Don't show annotation link to make user open "Accessibility
button" page during SuW.

Bug: 187658718
Test: Manual testing
Change-Id: I6cc3da9a72b68829efd5537ae93fc329ef716fb4
2021-05-12 07:16:05 +00:00