Commit Graph

28 Commits

Author SHA1 Message Date
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
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
menghanli
f76e31fe48 Fix unbundled accessibility features settings crash when launched
Root cause: The ag/19938064 introduces Settings Core change preference value changed metrics log format. It tries to lookupMetricsCategory() at Fragment#instantiate() stage. It has not onAttach() to activity by FragmentManager#add() or #replace(). The features were added by ag/15824482.
Solution: PutInt new MATRICS_CATEGORY extra in previous class to avoid giving context for FeatureFactory.getFactory to custom 1P accessibility services for SettingsGoogle overlay.

Bug: 259355675
Test: manual test
Change-Id: Ic37d41be6a54fe388f211c1c397d0b9b87b5fb56
2022-11-18 22:18:27 +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
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
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
61479cde86 Integrate new accessibility tileService attr into settings
- Accessibilty service: AccessibilityService_tileService
- Accesibility shortcut: AccessibilityShortcutTarget_tileService

Bug: 216614718
Test: manual test
Change-Id: I24baff13300dfc9a242fcfffe0a4888575ca0c9f
2022-02-09 11:46:40 +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
9855997b3c Show quick setting tooltips after shortcut tutorial dialog dismiss
- ToggleAccessibilityServicePreferenceFragment for unbundle
accessibility service
- LaunchAccessibilityActivityPreferenceFragment for unbundle
accessibility shortcut-activity

Bug: 210356011
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityGestureNavigationTutorialTest
Change-Id: I6f9e7e206ae7642d91e658ceb18b9e7ce4244a22
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
jasonwshsu
a8442468ad Align the "Open activity" UI style with usual accessibility service "Use service"
Root Cause: "Open activity" Preference is not part of the widget SettingsMainSwitchBarPreference, so its UI style did not be inherited.

Solution: "Open activity" has different concept from switch bar, we need to manual set its bacground to comply with the SettingsLib style.

Bug: 207067203
Test: manual test
Change-Id: I66f63f6952e5c4770509febc0e53eca6dc6eedb9
2021-11-23 15:13:39 +08:00
jasonwshsu
3d0f12d043 Support ability to add different page id for different accessibility service page in settings.
Bug: 190344664
Test: build pass
Change-Id: I6cc90b27dcbb5075d13e3c59fe754309182b4d0a
2021-09-22 18:36:46 +08:00
Peter_Liang
652c425acb Fixing the crash when tapping the "Downloaded apps" in Accessibility page.
Root cause:
When Accessibility settings parse the application which is from google
play store, the settings have no check if the resource is valid before
delivery the parameter into the corresponding fragment.

Solution:
Check if the resource is valid before creating the image uri.

Bug: 190716289
Test: manual test
Change-Id: I56eba2232ddf6ed5b2e526d4698479465a012e52
2021-06-11 03:24:06 +00:00
menghanli
924506e131 Fix Sound Amplifier does not have 'Open XXX' button
SettingsMainSwitchPreference does not allow hide switch bar. For support
this launch preference, we hide the SettingsMainSwitchPreference and add
new preference into the list.

Bug: 184711985
Test: Manual testing
Change-Id: I293800e83aafb387e0bb0a4988af774b56f508e6
2021-05-06 17:01:39 +08:00
Stanley Wang
86cc0579f3 Replace the SwitchBar with MainSwitch.
- Update wi-fi calling switch.
- Update the switches in Accessibility

Fix: 178673860
Fix: 177968565
Test: Run robotest and apply the widget in Settings and see the ui
Change-Id: Id10e6a110f418ea500a2eaf3c54752bef4f36507
2021-02-23 16:21:52 +08:00
jasonwshsu
1a1ae82460 Modify flow in ToggleFeaturePreferenceFragment
* Show edit shortcut dialog should belong to the basic feature, so move
them back to ToggleFeaturePreferenceFragment
* Add test cases for UserShortcutType to prepare to further refactor

Bug: 158540780
Test: atest ToggleFeaturePreferenceFragmentTest
Change-Id: Ia84bea5581f85d199f395b2065652ce69738abbf
2020-09-26 04:30:04 +00:00
Edgar Wang
dd032d3734 Update inclusive language for Accessibility Settings
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: I67032d4beb7c8ae6b5a3271ea75ca38be4351484
2020-08-06 14:51:19 +08:00
menghanli
efabdcc7d6 Avoid launching activity-based feature to force stop exist actiivty and
recreate it.

Root cause: FLAG_ACTIVITY_CLEAR_TASK would cause the exist activity are finished and new one items to be started. It causes Live Transcribe main activity goes onStart call of new activity is followed by onStop call of old activity, which cause the mic stopping.

Solution: Remmove the FLAG_ACTIVITY_CLEAR_TASK.

Bug: 156455425
Test: Manual test
Change-Id: I86778577ff37d7f14b28e5eca3087fa9cf5cb2c1
2020-05-14 09:29:04 +08:00
jasonwshsu
d2572c3295 Change to use ComponentName instead of String in log.
* align framework log to use the same format in ag/11250012

Bug: 151285965
Test: manual test
Change-Id: Ia76e3d88c116ffa37fb022aed2866acc0f315bd9
2020-05-09 22:18:18 +08:00
jasonwshsu
e76f541f7c Logs accessibility service user trigger status.
* Uses the atom AccessibilityServiceReported in westworld.

Bug: 151285965
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive 267
Change-Id: Id6a109e4e90c09f2310d92533cd4632875712f81
2020-04-29 20:16:14 +08:00
Peter_Liang
cfe3e454ac Tutorial improvement for Accessibility shortcut (1/n).
Because can't save the value into setting keys for the service before version R, and in order to let tutorial dialog can get the consistent value, using alternative that each fragment with shortcut to must implement the new abstract method.

Bug: 148989018
Test: manual test
Change-Id: Iba2a7daa70eb00f0bba37317c9355531fbb77628
2020-04-23 12:18:23 +08:00
Jason Hsu
91d2dbe2d4 Merge "Accessibility shortcut primary action - remove search and help icon" into rvc-dev 2020-03-04 12:14:49 +00:00
jasonwshsu
693068f512 Accessibility shortcut primary action - remove search and help icon
* Show search and help page only for accessibility framework feature. Framework don't know the information for downloaded accessibility.
* Modify MagnificationPreferenceFragment to use same logic.

Bug: 142531433
Bug: 150130421
Test: manual test
Change-Id: I29ab5080acc035f46f1e816a9df1b46020bc356c
2020-03-04 17:27:35 +08:00
jasonwshsu
c7fa4da58d Accessibility shortcut primary action - add settings UI for accessibility shortcut type fragment
Bug: 142531433
Test: manual test
Change-Id: I6a9eebc1718f2b924cfb373f09abb57890fa10a5
2020-03-04 16:06:41 +08:00
jasonwshsu
db883712c3 Accessibility shortcut primary action - implement launched type fragment.
Bug: 142531433
Test: make RunSettingsRoboTests
Change-Id: I444bcc921b2a05483e508934c6f0b90b2cc53421
2020-02-19 15:25:59 +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