From 93edd117240b466c2cbb2f156256dc30402eac2a Mon Sep 17 00:00:00 2001 From: sallyyuen Date: Wed, 1 Apr 2020 11:09:45 -0700 Subject: Fix system action API issues in SystemActions 1) Actions are only registered when the service starts. If the locale changes, the labels need to be translated, so re-register the actions when this happens. 2) When its shortcut isn't visible the a11y menu action is a no-op. The list should be an accurate representation of what actions are available. Pass SystemActions into NavigationBarFragment, which keeps track of the shortcut availability, to unregister/register the action. To do this, SystemActions exposes register/unregister to the fragment and makes SYSTEM_ACTION_ID_ACCESSIBILITY_MENU public. 3) Remove Toggle Split Screen from SystemActions. The trigger isn't system-level but is rather buried in the Recents UI in a button for each app, and the a11y user can access this like everyone else. SystemActionPerformer will still handle the legacy action call in performSystemAction. 4) Rename "Accessibility Menu" to "On-screen Accessibility Shortcut" Bug: 152636060, 152635646, 154833492 Test: Manual TalkBack test Change-Id: I9b037f91c8d3b6f193fc9aee95ef73b7f3fbf315 --- .../android/accessibilityservice/AccessibilityService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'core/java/android') diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java index 18e5c3d2d7cc..77b3c81dee85 100644 --- a/core/java/android/accessibilityservice/AccessibilityService.java +++ b/core/java/android/accessibilityservice/AccessibilityService.java @@ -501,6 +501,18 @@ public abstract class AccessibilityService extends Service { */ public static final int GLOBAL_ACTION_KEYCODE_HEADSETHOOK = 10; + /** + * Action to trigger the Accessibility Button + * @hide + */ + public static final int GLOBAL_ACTION_ACCESSIBILITY_BUTTON = 11; + + /** + * Action to bring up the Accessibility Button's chooser menu + * @hide + */ + public static final int GLOBAL_ACTION_ACCESSIBILITY_BUTTON_CHOOSER = 12; + private static final String LOG_TAG = "AccessibilityService"; /** -- cgit v1.2.3