Commit Graph

130 Commits

Author SHA1 Message Date
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
jasonwshsu
2f2f0e982f Write default accessibility service only when user enter into corresponding page.
Based on ag/17463205, to help users not to mis-triggered
volume-key-accessibility shortcut, we will only write default
accessibility service when user enter into corresponding service page.

Fix: 228562075
Fix: 226866175
Test: manual test ->
      1. Do not enter into default config accessibility service page during setup wizard then finish setup wizard.
      2. Observe settings value of shortcut targets. It should be null.
Change-Id: I4f26598d646c8e6b312debd03eaaa9d2cd7010ea
2022-04-12 15:10:38 +08: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
jasonwshsu
4bfe215e4c Add link functionality in message of magnification triple-tap dialog
Bug: 210593079
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ShortcutPreferenceTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=MagnificationModePreferenceControllerTest
Change-Id: Id69b0b717410b5c5c44a818c36688bb7331c73ae
2022-03-23 19:44:33 +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
3a82089630 Not show default footer strings in accessibility settings
Bug: 224689419
Test: Manual testing
Change-Id: I2377c21de0e8fac395ea2b84a480feb5fc8b69ff
2022-03-16 05:46:07 +08:00
menghanli
075364f147 Clean up accessibility quick settings "tooltips" for singular purpose
Bug: 220655084
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityQuickSettingsTooltipWindowTest LaunchAccessibilityActivityPreferenceFragmentTest ToggleAccessibilityServicePreferenceFragmentTest
Change-Id: I771ad407b04375be2679c2237a970ee418b9bf37
2022-03-10 07:51:48 +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
Menghan Li
24abb535ed Merge "Show different tooltips for QS features auto-added and non-auto-added" into tm-dev 2022-02-21 21:15:01 +00:00
menghanli
cad616bd9a Show different tooltips for QS features auto-added and non-auto-added
There are 2 different kinds of auto-added / non-auto-added illustrations in QS tooltips for framework features. Show animation in the settings page for full flow for non-framework services.

Bug: 218968108
Test: manual testing
Change-Id: I9c95c9f3e60ce94ce4059e27ef93c1dacce7a5c7
2022-02-21 15:49:18 +08:00
Menghan Li
100a1f9990 Merge "Fix two intro strings for Magnification page during Suw" into tm-dev 2022-02-21 07:04:38 +00:00
menghanli
1a4ca56796 Fix two intro strings for Magnification page during Suw
- Keep the SuW intro and hide the setting intro

Bug: 220025399
Test: Manual testing
Change-Id: Ie4e9eace8dbd638bd141c14a22603644d93d458a
2022-02-17 14:39:32 +08:00
menghanli
01d02d3d8e Show different tooltips for QS features auto-added and non-auto-added
There are 2 different kinds of auto-added / non-auto-added subtext in QS tooltips for framework features. Show animation in the settings page for full flow for non-framework services.

Bug: 218968108
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityQuickSettingsTooltipWindowTest AccessibilityShortcutPreferenceFragmentTest
Change-Id: I462cfcece959df8b9d97fab8e28337bceca9e25e
2022-02-15 16:09:30 +08: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
426e781f19 Accessibility framework & Settings to support the Android accessibility intro & footer
- Implements a TopIntroPreference into the Accessibility Settings base fragment.
- Creates a protected API or variable to provide content to support if needed.

Bug: 218407398
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleFeaturePreferenceFragmentTest
Change-Id: Id0f7700bb8f62960951913db8bd034fce1b15a90
2022-02-13 07:25:47 +08:00
menghanli
0d6909dc0f Support accessibility settings load title from quick settings panel
- ToggleAccessibilityServicePreferenceFragment for unbundle accessibility service
- LaunchAccessibilityActivityPreferenceFragment for unbundle accessibility shortcut-activity

Bug: 210356011
Test: make RunSettingsRoboTests ROBOTEST_FILTER=LaunchAccessibilityActivityPreferenceFragmentTest ToggleAccessibilityServicePreferenceFragmentTest
Change-Id: I78dcb8dcb2778819ec4bb130a041211598f6d9c
2022-02-09 08:15:22 +08:00
menghanli
0577a068b8 Show quick setting tooltips after shortcut edit dialog dismiss
- ToggleAccessibilityServicePreferenceFragment for unbundle accessibility service
- LaunchAccessibilityActivityPreferenceFragment for unbundle accessibility shortcut-activity

Bug: 210356011
Test: Manual testing
Change-Id: I3bbaa6c0e5a4359e696c776a300520c4572b31f7
2022-02-09 08:15:22 +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
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
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
Peter_Liang
af5f355b35 Add the max height restriction into the illustration view.
Bug: 191721423
Test: manual test
Change-Id: I3829ead500eaf586f6d543855690ee8f0d0913ff
2021-09-24 14:42:53 +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
2811428165 Replace the AnimatedImagePreference with IllustrationPreference.
Bug: 190585192
Test: manual test
Change-Id: I4a6d1f5bbfd50f5586bfa39a8586442bd7b2a78d
2021-06-24 00:26:29 +08:00
Bill Lin
3ae771d04a Integrate One handed mode shortcut preference
1) Update AccessibilityShortcutPreferenceFragment extends
   DashboardFragment
2) OneHandedSettings extends AccessibilityShortcutPreferenceFragment
   for shortcut feature
3) Add General Category above shortcut preference

Test: Settings > System > Gesture > One handed mode
Test: Settings > A11y > System Controls > One handed mode
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings
      .OneHandedShortcutPreferenceControllerTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings
      .OneHandedShortcutPreferenceFragmentTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings
      .OneHandedActionPullDownPrefControllerTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings
      .OneHandedActionShowNotificationPreferenceControllerTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings
      .OneHandedSettingsUtilsTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=
      "com.android.settings
      .AccessibilityShortcutPreferenceFragmentTest"

Bug: 182425480
Change-Id: I653388beea422e9bf47fd3240367fb374d6f0025
2021-06-11 16:13:59 +08:00
menghanli
e771cbb1aa Add AccessibilityShortcutPreferenceFragment to share non-accesibility tools to add shortcut
Bug: 190022774
Test: make RunSettingsRoboTests -j52 ROBOTEST_FILTER=AccessibilityShortcutPreferenceFragmentTest
Change-Id: I1cae8fbed059ba7c309126e2dff46adfb48cffd8
2021-06-08 22:58:05 +08:00
menghanli
78c093b0b3 Move DialogEumn into AccessibilityDialogUtils
Bug: 190022774
Test: Manual testing
Change-Id: I391089b675b415c26bbacd028caf1d1ab617e707
2021-06-07 13:38:50 +08:00
menghanli
1a83638592 Fix the link text "Learn more" in the accessibility pages with help links could not convey the link's purpose clearly
Root cause: A long content textview shows the accessibility service info and learn more link. User cannot double click to open help link. They need to swipe up and right to pops up dialog to move to next page. But, the dialog show the "Learn more", it is not clear for user to idendify what the link page.

Solution: Add another textview to show the "Learn more" and provides more clear content description for this link. Also, user just need to double click to activate it.

Bug: 188603037
Test: make RunSettingsRoboTests -j52 ROBOTEST_FILTER=AccessibilityFooterPreferenceTest
Change-Id: Ia9a56f11bbd235ae3a698fcb2e1a2fcff64ef940
2021-05-25 15:51:45 +08:00