Commit Graph

102 Commits

Author SHA1 Message Date
Eric Biggers
c300a01bf4 Remove FDE support from accessibility settings
With FDE (Full Disk Encryption), secure start-up (i.e. requiring a PIN /
pattern / password to boot the device) was incompatible with
accessibility services.  Thus, the accessibility settings would ask the
user to disable secure start-up when enabling an accessibility service.

Now that FDE support has been removed in favor of FBE (File Based
Encryption), this is no longer necessary.  Remove it.

Bug: 208476087
Change-Id: I5f6e512f223df63e1b4d1c181fc8b3fe683dcd5f
(cherry picked from commit b4060ef65b)
Merged-In: I5f6e512f223df63e1b4d1c181fc8b3fe683dcd5f
2022-03-08 17:13:22 +00: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
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
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
Stanley Wang
bbab97c955 Merge "Fix the problem of the TalkBack function can not be turned on." into sc-dev 2021-06-09 06:37:29 +00:00
Stanley Wang
fab609f892 Fix the problem of the TalkBack function can not be turned on.
- Check the states of the switch and the accessibility service.
  If the states are different, update the state of accessibility
  service.

Fix: 190309601
Test: robotest and test the TalkBack manually.
Change-Id: Id8c28223b1958087e7cdc481348487376afa2203
2021-06-08 20:34:55 +08:00
menghanli
78c093b0b3 Move DialogEumn into AccessibilityDialogUtils
Bug: 190022774
Test: Manual testing
Change-Id: I391089b675b415c26bbacd028caf1d1ab617e707
2021-06-07 13:38:50 +08:00
Ryan Lin
296c42e4ce Merge "Add uninstall option in the capabilities confirm dialog" into sc-dev 2021-02-24 13:12:45 +00:00
ryanlwlin
4806a38516 Add uninstall option in the capabilities confirm dialog
Uninstall option is visible only when the application of the
service is not system App. It provides an efficient way to
uninstall the App if users are shocked with the perimssions
they need to grant.

Bug: 176877955
Test: Install an App with AccessibilityService and uninstall
it with this option.

Change-Id: I6b60cc56d8d34c2983458a676b500035551ec9df
2021-02-23 20:43:27 +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
9f54ab9afa Redesign roles of variable mUserShortcutTypesCache & mUserShortcutTypes
* mUserShortcutTypesCache -> get value from savedInstanceState only
* mUserShortcutTypes -> use local variables to replace its mission

Bug: 158540780
Test: atest ToggleFeaturePreferenceFragmentTest
Change-Id: I1473f89ed743261f616e8d19733bae829c9dbb02
2020-11-05 14:24:09 +08:00
jasonwshsu
48b546eccf Extract UserShortcutType functions from ToggleFeaturePreferenceFragment
* Simplify StringJoiner to '+' since it only have one case
* Simplify Collections usage to use removeIf() and findFirst() directly
* Change class name SharedPreferenceUtils to PreferredShortcuts

Bug: 158540780
Test: atest ToggleFeaturePreferenceFragmentTest
Test: atest PreferredShortcutsTest
Change-Id: I02f03ccba09b6d7edaa5c0c8223ab3561a5e976b
2020-10-09 00:34:04 +00: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
21f8cb3a44 Refactor Reset options 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: I94969f6903d047b9bc41b1e8c14096c92c460b38
2020-08-04 23:33:50 +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
72aa60ae95 Tutorial improvement for Accessibility shortcut (2/n).
Update UI widgets to meet the new design.

Bug: 148989018
Test: manual test
Change-Id: Ife42995af193db6746135d29f6fa1ad452d265a6
2020-04-23 12:18:26 +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
Peter_Liang
a277adc7c7 Uniform the settings enum proto for accessibility tutorial.
Replace 'DIALOG_TOGGLE_SCREEN_ACCESSIBILITY_BUTTON' and 'DIALOG_TOGGLE_SCREEN_GESTURE_NAVIGATION' with DIALOG_ACCESSIBILITY_TUTORIAL.

Bug: 148989018
Test: manual test
Change-Id: I991cc8fac532982ebdb4995b42ea01a3dc0e52e3
2020-04-20 16:00:39 +08:00
Peter_Liang
58cc3ea7f9 Revising the function name related to user shortcut type.
Should add 's' into the name.

Bug: 148989018
Test: manual test
Change-Id: I46aadb80f4f28dc1794fc3313563c79be149e847
2020-04-15 17:43:05 +08:00
menghanli
5d7083a103 ShortcutPreference Toggle design (2/n)
- Removes edit shortcut disable condition.
- Shows "off" if user removes all items in edit dialog.
- Restores last time what user chosen options when show edit dialog.

Bug: 148989269
Test: Manually test
Change-Id: I105abda782999d38c92e3de9811e2fd378869e73
2020-03-06 18:02:53 +08:00
menghanli
919e555a51 ShortcutPreference Toggle design.
- For target SDK < 30 app show as preference item to trigger shortcut on/off.
- For target SDK >= 30 app show two item: the left one can edit shortcut and the right one be a on/off trigger button.

The design is reference from WIFI setting which has similar comportment.

Bug: 148989269
Test: Test result in Buganizer.

Change-Id: I815206d9e885c01bf3e6445820176aed4a743323
2020-03-03 17:31:27 +08:00
PETER LIANG
52ff691add Merge "Revise the modifier and naming of public APIs for allow rich content." 2020-02-19 23:51:48 +00:00
Peter_Liang
4f01e9aa46 Revise the modifier and naming of public APIs for allow rich content.
Change "int getAnimatedImageRes()" to "Drawable loadAnimatedImage(PackageManager packageManager)"

Bug: 142532186
Test: manual test
Change-Id: I9d56e53fd8c4050fda0c5c82c7265330246e4119
2020-02-19 21:43:00 +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
menghanli
5638acbc82 Use HTML text preference for rich content
Implements for Color Correction, Color Inversion, and Magnify

Bug: 148837311
Test: Manual test
Change-Id: I5e5b311b6ae8e42cca3ef9048c8b8b0de52d13bc
2020-02-12 19:12:26 +08: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
1869e01f3e Fix Startup fails when click "Color correction" of the selection menu in "Color correction" page
Setting provider observar is register onResume() and release of onPause().
The selection menu is activity-base dialog to cause the app does not to monitor the value change.

Bug: 148832544
Test: Manual test
Change-Id: I01354d5096c00ba39336e27aa45169d8768f8594
2020-02-04 17:44:40 +08:00
menghanli
c240b27862 Add back "Tapping Stop will stop x" dialog while turning off an accessibility service
Bug: 146539308
Test: make RunSettingsRoboTests2
Change-Id: Ic572f9245db016bd79a272030f97004a21f4b672
2020-02-03 19:17:34 +08:00
menghanli
8e881181a8 Fix "Cannot get activity context when service off".
1. Unify getPrefContext() usage in Accessibility Settings
2. Correct the dialog emuns order

Test: local test
Change-Id: Idc51f7b15b5813bbae7b32e1ae3c7f00c71cea50
2020-02-03 07:13:31 +00: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
menghanli
bf46032074 Support accessibility shortcut secondary action (10/n)
Integrate with Talkback enabled and change the behavior as below:
1. Show 3-finger swipe up from bottom summary
2. Show 3-finger icons for edit shortcut dialog
3. Dismiss the running the edit shortcut dialog

Bug: 142530063
Bug: 142531156
Bug: 147989432
Test: make RunSettingsRoboTests2
Change-Id: I2f34b8eebfdc5a385d72402e95a8b1d0bde4a428
2020-01-21 15:58:43 +08:00
menghanli
87147f55f0 Support accessibility shortcut secondary action (9/n)
Reorder layout and add title for each category block.

Bug: 142530063
Bug: 142531156
Test: make RunSettingsRoboTests2
Change-Id: I0f4067aaf9c42c3ce065eebd0e75ad4153f7e9dc
2020-01-18 00:24:20 +08:00
TreeHugger Robot
4a70204f51 Merge "Accessibility shortcut secondary action - fix permission dialog did not pop up" 2020-01-17 07:44:02 +00:00
menghanli
5d0f336fec Support accessibility shortcut secondary action (8/n)
Integrate with the multiple shortcut selections and change the behavior as below:
- Get the shortcut type from system provider or shared_prefs if this is first time to use.
- Update the shared_prefs for what user seen.

Bug: 142530063
Bug: 142531156
Test: make RunSettingsRoboTests2
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityUtilTest
Change-Id: I58aeb960e2c4aa0bc2432be34c1372c0de89117a
2020-01-16 22:57:11 +08:00
jasonwshsu
c602ceb5ea Accessibility shortcut secondary action - fix permission dialog did not pop up
- Need to set EXTRA_CHECKED after shortcutPreference's checkbox is unchecked

Bug: 142530063
Test: manual
Change-Id: I7f1ea5a9d4b12ac958ac8a074cf7a267faddb4ad
2020-01-16 21:18:21 +08:00
Jason Hsu
d53cbefcc0 Merge "Accessibility shortcut secondary action - handle all preferred shortcut type key" 2020-01-14 05:53:38 +00:00
Jason Hsu
d5095abc91 Merge "Accessibility shortcut secondary action - legacy type fragment only have hardware shortcut" 2020-01-14 05:53:19 +00:00
jasonwshsu
fb576356aa Accessibility shortcut secondary action - handle all preferred shortcut type key
- save and restore all preferredShortcutType: SOFTWARE, HARDWARE, TRIPLETAP

Bug: 142530063
Test: manual
Change-Id: I7dd714d1516f49e89c42822241f9cb2b41ae2d2e
2020-01-14 12:15:14 +08:00
Jason Hsu
fd17fcbf11 Merge "Accessibility shortcut secondary action - Invisible type fragment need to handle AccessibilityServiceState" 2020-01-14 02:46:46 +00:00
jasonwshsu
802fad998e Accessibility shortcut secondary action - legacy type fragment only have hardware shortcut
- LegacyAccessibilityServicePreferenceFragment only allowed hardware shortcut, software shortcut appear is controlled by flagRequestAccessibilityButton

Bug: 142530063
Test: manual
Change-Id: I90c7246c83b5525613e22ff5f0ad03295288c53d
2020-01-13 16:28:50 +08:00
jasonwshsu
5469cffa58 Accessibility shortcut secondary action - Invisible type fragment need to handle AccessibilityServiceState
- InvisibleToggleAccessibilityServicePreferenceFragment need to set
AccessibilityServiceState according to ShortcutPreference checkbox's stauts.

Bug: 142530063
Test: manual
Change-Id: I9ff21b66ebf72a51e62a958e3e391624c7925c27
2020-01-13 15:22:50 +08:00
menghanli
334dc4f20b Support accessibility shortcut secondary action (7/n)
Implements sharedPreference to keep the user preferred shortcut for each
service.

Bug: 142530063
Bug: 142531156
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleFeaturePreferenceFragmentTest
Test: make RunSettingsRoboTests2
Change-Id: I2a7c54ddc32764f6d88f2efed87982d469acc183
2020-01-13 12:34:04 +08:00
Peter_Liang
ec2fa7e872 Accessibility scary dialog for android R changed.
Show scary dialog only once when toggle shortcut preference and use
  service.

Fix: b/142532185
Test: manual test
Change-Id: Ic36fdd5eec8ec20ead79ce47cd5e5e19d2ef5768
2020-01-07 11:54:27 +00:00
jasonwshsu
8ef01d25fb Accessibility shortcut secondary action - save and restore shortcut key
- Implement onCheckboxClicked() to save shortcut key
- restore shortcut key when onViewCreated()
- Use preferredShortcutType to handle settings key

Bug: 142530063
Test: make -j52 RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityUtilTest
Change-Id: Iabe636641968d346e52becea19b6e201ea5bc1fb
2020-01-06 13:56:48 +08:00
menghanli
a5d8e12766 Support accessibility shortcut secondary action (6/n)
Implements new edit shortcut dialog selection and save what user
prefered key back for color inversion, color correction, magnifiction,
downlaoded service - LEGACY, INVISIBLE, INTUITIVE case.

Bug: 142530063
Bug: 142531156
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AccessibilityUtilTest
Test: make RunSettingsRoboTests2
Change-Id: I94607db918047ae4082457dd33f17c8675934e2c
2019-12-31 17:42:06 +08:00
Menghan Li
3b87b777b0 Merge "Remove all "Tapping Stop will stop x" dialog while turning off an accessibility service" 2019-12-25 01:29:00 +00:00
menghanli
f74f3061e3 Remove all "Tapping Stop will stop x" dialog while turning off an accessibility service
Bug: 146539308
Test: make RunSettingsRoboTests2
Change-Id: Ib3124aea307e42e648ba8d3f561dadb2901c06e5
2019-12-24 02:45:45 +00:00
jasonwshsu
0dd53520a5 Accessibility shortcut secondary action - improve shortcutPreference
1. Use setWidgetLayoutResource() for the controllable widget at the
right side.
2. Improve listener structure.
3. Extend checkbox clickable area.

Bug: 142530063
Test: make -j52 RunSettingsRoboTests ROBOTEST_FILTER=ShortcutPreferenceTest
Change-Id: Iebb9f62653914a0d7200c627f01cf7953d576960
2019-12-24 10:37:55 +08:00
Kevin Chang
ea3d3520c3 Support accessibility shorcut secondary action (4/n)
Replace metrics constants of different edit dialogs.

Bug: 142531156
Test: Maunal
Change-Id: I52b3d481d815edab17b954283ae5e366723a842c
2019-12-18 16:37:14 +08:00