Commit Graph

137 Commits

Author SHA1 Message Date
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
Kevin Chang
e65ed3ebb0 Support accessibility shorcut secondary action (3/n)
Combine the UI with both shortcut preference and edit dialog.

This CL only contains UI and related connections.
Related logic implementation will be added in next CL.

Since the drawable resources are not ready, put the mock
drawables as temporary. Once the drawbles are provided by UX,
create a CL to replace the related resources.

Bug: 142530063
Bug: 142531156
Test: Maunal
Change-Id: I21e4c6e99c2d1731c15d7c9553594160b8809eb5
2019-12-18 09:25:16 +08:00
Peter_Liang
64f1374c64 Support the rich content for accessibility service (1/n)
Goal: 1. let third party developer can use html text that include from their local image file and
         animated image instead of only plain text to rich their content.
      2. Avoid malicious links made by third party developer

Action: 1. Add html, static text, and animated image preferences.
        2. Add android:AnimatedImageDrawable, and android:htmlDescription attributes.
        3. Fine-tune interface and integration
        4. Add custom tag filter

Bug: 136292241
Test: Maunal & make RunSettingsRoboTests
Change-Id: I82cd5319efb7faa1ff7e8354a279828fce5135b8
2019-11-27 20:42:39 +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
Kevin Chang
ee15fa1c2d Change disable accessibility service dialog layout
Bug: 140307087
Test: Visual
Change-Id: I78d573f121e2f799a8395fcd2d21ee48a5fffb23
2019-09-11 15:47:08 +08:00
Kevin Chang
0e1f39fad8 Add tutorial dialog for gesture navigation
Add new tutorial dialog for gesture navigation in order to teach
users how to use the gesture

Fixes: 133650388
Test: Manual
Change-Id: I7cc6a950af49044b27cf7ca41e3bcf67ef40b5fd
2019-06-06 13:56:54 +08:00
Kevin Chang
f8baacfe7f Merge "Revert "Change string of switchbar and installed service category title"" into qt-dev
am: f508ece42d

Change-Id: I1c01a995f3cacdd80f5f97bce342dd0ce0907fe2
2019-05-18 01:24:02 -07:00
Kevin Chang
d8927cbabf Revert "Change string of switchbar and installed service category title"
This reverts commit 7eddb0e4dc.

Reason for revert: There's some side effects with string.
Create a new CL in master branch to fix it.

Bug: 132840332
Change-Id: I17526a06474d25bdb32beda96f5bb6371f0e5ade
2019-05-17 08:38:54 +00:00
Kevin Chang
bfed5d1ca1 Merge "Change string of switchbar and installed service category title" into qt-dev
am: d0c5f2d443

Change-Id: I4e8f59bd9c5d0a9b906b4b0bbc05446dc24156ad
2019-05-14 19:50:05 -07:00
Kevin Chang
7eddb0e4dc Change string of switchbar and installed service category title
Bug: 122897712
Test: Visual
Change-Id: I4e15ebc8b91c58d24aadb7e665c6692ebcd627a8
2019-05-14 11:47:19 +08:00
Colin Cross
807e861105 Use if instead of switch for resources
Converting to Soong will move some code from directly compiled
into the app to compiled into an Android library and then
shared between the app and the tests.  This will cause resource
IDs in the library to become non-final, which means they can
no longer be used in case statements.  Convert affect case
statements to if blocks.

Test: m RunSettingsRoboTests
Change-Id: I25742a374f06d3fa4decbfc0d223a350acc50881
2019-05-13 13:42:01 -07:00
Kevin Chang
bb6395eb4a Improve the Accessibility warning dialog with new design
Create new Accessibility warning dialog based on the style of permission
dialog

Bug: 129788631
Test: Visual
Change-Id: I0ec693f9c29e6e85e17d5bd1a64a4c0fe9499f95
2019-05-10 11:46:19 +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
tmfang
41ab6b4bf8 Migrate all AlertDialogs to AndroidX version
This CL only changed AlertDialog imports.
So, reviewer can review it easily.

Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
2018-07-20 11:32:13 +08:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00