Commit Graph

46 Commits

Author SHA1 Message Date
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
jasonwshsu
5656caecd0 Correct shortcut summary to have different software types of shortcut result
Root Cause: Did not consider different software types shortcut in AccessibilityShortcutPreferenceFragment

Solution: Add support for different software shortcut types

Bug: 263451053
Test: manual change shortcut type and check
Change-Id: Ic425fdab790d4bbf1de6418ada382e420a9860fc
2023-05-11 22:23:16 +08: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
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
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
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
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
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
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
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
95eba64f85 Support OHM quick settings tooltips when feature on
Bug: 210356011
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityShortcutPreferenceFragmentTest
Change-Id: I3b35d9bb347b7e516db94a4b801a4484f6f38ca8
2022-01-26 07:55:52 +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
menghanli
6c7b52b703 Provides TC ID for shortcut title in AccessibilityShortcutPreferenceFragment
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: Iced1fe7db81e4e78ddfed30ab947d449b5f9c735
2021-07-15 18:10:50 +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
a8b9f30d11 Accessibility Service & Shortcut Redesign - Remove “volume key shortcut” setting (2/n)
Bug: 142529032
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityShortcutPreferenceControllerTest
Change-Id: Ic55d4fd8db0678b8fccbbb6ef1d217b47a5094bd
2020-02-13 15:44:11 +08:00
menghanli
40f9e47bb7 Accessibility Service & Shortcut Redesign - Remove “volume key shortcut” setting (1/n)
Bug: 142529032
Test: Manual test
Change-Id: Icfff02b25b1c83598774dd1708e145c0cf9447d7
2020-02-13 06:27:07 +00:00
menghanli
6eb3912f31 Accessibility Service & Shortcut Redesign - Primary action - toggle button design
Implements DividerSwitchPreference to replace ToggleSwitch

Bug: 142528112
Test: Manual test

Change-Id: I0d80d16bfa941f7ee333a2c5680a25a26c42809d
2020-02-07 20:49:13 +08:00
menghanli
b82931520f Support accessibility shortcut secondary action (11/n)
Refactor current shortcut design to base fragment and provide
protected function to customize the legacy design,
magnification or no need shortcut app.

Bug: 142530063
Bug: 142531156
Test: make RunSettingsRoboTests2

Change-Id: I51c951ef8f819a1940ddfe33b009b40ed5ec0530
2020-02-02 10:51:44 +08:00
Edgar Wang
e19ee9a01f Revert "Settings search - Navigate user to exact page"
This reverts commit 08f2a58459.

Reason for revert: design changed, we decide to take the user to
the entry after clicking on a search result.
It's opposite with what we did, so we revert related CL first.

Test: robotest

Change-Id: Iadb9a94a7ef7838be34a54499e2d934d6396c336
2020-01-16 14:07:38 +08:00
Edgar Wang
08f2a58459 Settings search - Navigate user to exact page
- remove duplicate index preference
- default set searchable = false when the preference has fragment
- make some fragments indexable

Bug: 143057584
Test: robotest & manual

Change-Id: I4d64f6106d2f92f0a45e8c7e26388677f593f412
2019-12-24 21:04:11 +08:00
Kevin Chang
a6308c09a8 Change string of switchbar and installed service category title
Bug: 122897712
Test: Visual
Change-Id: I0f56b4b7375e651a74189dd17e6b3bd8b99ccfca
2019-10-14 11:05:59 +08:00
Raff Tsai
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +08:00
Raff Tsai
ac3e0d0988 Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function

Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
2019-09-24 00:35:52 +08:00
Sunny Shao
30cfc2553e Use FooterPreference in xml explicitly
Removed the FooterPreferenceMixin from the some accessibility pages.

Fixes: 139455988
Test: manual test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.accessibility
Change-Id: Ia1568e0a120eede26fadc16764caef2ecfb2411a
2019-08-15 15:11:16 +08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Tony Mantler
0fcd6cbaa8 Autogenerate SearchIndexableResources subclass
Bug: 77148954
Test: RunSettingsLibRoboTests RunSettingsRoboTests RunSettingsGoogleRoboTests RunArcSettingsRoboTests
Change-Id: I842c42c55014c3310070ef22bd4f0d9a70dfd804
2018-04-03 10:26:55 -07:00
Phil Weaver
203b923cb4 Settings reflect new a11y shortcut on lockscreen
Matching changes to the framework behavior. The
setting is on by default iff the user has agreed
to use the a11y shortcut.

Bug: 70944865
Test: Adding new test for this fragment that checks
this behavior

Change-Id: I7831f64cf3ec59c2d266340cc570227433a4febb
2018-03-03 03:35:24 +00:00
Phil Weaver
d7d5754cfd Merge "Settings enable a11y shortcut framework features" 2017-12-06 17:38:58 +00:00
Phil Weaver
b9cf0d2a4f Settings enable a11y shortcut framework features
Bug: 34621067
Test: Settings->Accessibility->Volume key shortcut
dialog now shows color inversion and color correction,
and selecting them works.
Change-Id: If7b4f55bd39fbd4c00b1ad95c6568a77e23c4e7e
2017-12-05 15:14:11 -08:00
Fan Zhang
e0b0e9f902 Refactor help menu stuff into a controller
This is a clean up to action bar menu item pattern, we will use the same
pattern to build search icon on all pages in a later change.

Bug: 68814716
Test: robotests
Change-Id: Iedd3ec263e8ccb63ed75ec7a95b28c00878b1de4
2017-11-29 15:51:04 -08:00
Doris Ling
4a01283309 Remove the feature flag for using new title.
- remove all code that check for the feature flag, and use the new logic
by default.

Change-Id: I7fbe60da84c1c0f35e7241402a71d2bc4cd300e6
Fixes: 64564191
Test: make RunSettingsRoboTests
2017-11-13 17:58:13 -08:00
Doris Ling
03a3b518de Update preference screen title.
- Add missing title to preference screen xml so that they will be used to
set the activity title when the fragment is launched.
- Also updated some incorrect preference screen titles.
- Overrides getTitle() in preference fragments that do not use the
preference screen xml.

Bug: 64564191
Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots
Change-Id: Id72d5ddf18f0962bc484de8bbd847a2e55d6371e
2017-10-25 11:02:07 -07:00
Phil Weaver
928045e5d5 Merge "Adjust a11y shortcut settings based on UX input" 2017-06-27 15:09:35 +00:00
Fan Zhang
179645eecd Add help url placeholders for new pages
Bug: 38412798
Test: visual
Change-Id: I4ede523cb13790ea05309279f80a778b2086f850
2017-06-05 14:50:01 -07:00
Phil Weaver
8fcf4d8349 Adjust a11y shortcut settings based on UX input
Disabling the shortcut if no service is configured, so we
users won't see an "On" unless the shortcut will have an
effect.

If no service is configured and the user tries to enable
the shortcut, the service picking UI is shown. If the user
chooses a service, the shortcut turns on. If not, the
shortcut remains off.

Service selection is disabled when the shortcut is disabled
(except for the specific case above).

Lock screen behavior selection is disabled when the shortcut
is disabled.

Also updating a couple of strings based on UX input.

Adding an AOSP header to a file that somehow got checked in
without one.

Fixes: 37443184
Fixes: 38030853

Test: Manually went through the various combinations of
shortcut on and service enabled. I turned off the default
selection of TalkBack as the shortcut service to ensure
that we show a dialog when no service is selected.

Change-Id: Iac5cff12edea91a496fc81781518db4ae49ef334
2017-06-02 16:10:13 -07:00
Phil Weaver
a989b19646 Fix default for a11y shortcut setting
Settings thought the default for "Allow from lock screen" was
on. It's really off.

Bug: 37158451
Test: Manually confirmed that a fresh device now shows off.
Change-Id: I38dc4f6d2bfec5e0c8562c0d2c6e034db461aa98
2017-04-19 11:09:23 -07:00
Phil Weaver
ed69e8a417 Respect user's choice on a11y shortcut dialog
Wasn't checking if the user actually agreed. Whoops.

Bug: 37123004
Test: Manually verified that canceling leaves the selection
unchanged.

Change-Id: I48a052eb74733d3d0105fc1e72c4bf77ce8be0c5
2017-04-18 17:53:14 -07:00
Phil Weaver
296b7263ad A11y shortcut settings enhancement
Adding shortcut on/off switch, improving the service picker,
and adding a switch to enable the shortcut on the lock screen.

Also adjusted setting search code to avoid indexing the
accessibility shortcut aside from the main accessibility settings
page.

Bug: 35872328
Bug: 35219988
Test: Ran in a variety of conditions, ran existing settings test.
Also added basic robo test, verified existing robo tests pass.
Change-Id: I4da9bad74caf96d9c8f3640e7db5417b4ee5d602
2017-03-24 13:15:13 -07:00