summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sally Yuen <sallyyuen@google.com> 2020-04-06 23:54:03 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-04-06 23:54:03 +0000
commit3987ae1ad80d1ca2f68901770cbf6a87ddc7162c (patch)
treedcb13f16f7d9086e6f187baf0d1c59438d68550b
parente0c12903db649afb91f5f8efe111d40c092faf4d (diff)
parentca5c9214161cb7a1f098de3c949212c3eb6aa015 (diff)
Merge "Make the system action API more clear with documentation" into rvc-dev
-rw-r--r--core/java/android/accessibilityservice/AccessibilityService.java7
-rw-r--r--core/java/android/view/accessibility/AccessibilityManager.java9
2 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java
index d4f511280553..67334f554df7 100644
--- a/core/java/android/accessibilityservice/AccessibilityService.java
+++ b/core/java/android/accessibilityservice/AccessibilityService.java
@@ -1819,6 +1819,13 @@ public abstract class AccessibilityService extends Service {
/**
* Returns a list of system actions available in the system right now.
+ * <p>
+ * System actions that correspond to the global action constants will have matching action IDs.
+ * For example, an with id {@link #GLOBAL_ACTION_BACK} will perform the back action.
+ * </p>
+ * <p>
+ * These actions should be called by {@link #performGlobalAction}.
+ * </p>
*
* @return A list of available system actions.
*/
diff --git a/core/java/android/view/accessibility/AccessibilityManager.java b/core/java/android/view/accessibility/AccessibilityManager.java
index dc87453bd867..6a109253a27c 100644
--- a/core/java/android/view/accessibility/AccessibilityManager.java
+++ b/core/java/android/view/accessibility/AccessibilityManager.java
@@ -1275,7 +1275,14 @@ public final class AccessibilityManager {
/**
* Register the provided {@link RemoteAction} with the given actionId
- *
+ * <p>
+ * To perform established system actions, an accessibility service uses the GLOBAL_ACTION
+ * constants in {@link android.accessibilityservice.AccessibilityService}. To provide a
+ * customized implementation for one of these actions, the id of the registered system action
+ * must match that of the corresponding GLOBAL_ACTION constant. For example, to register a
+ * Back action, {@code actionId} must be
+ * {@link android.accessibilityservice.AccessibilityService#GLOBAL_ACTION_BACK}
+ * </p>
* @param action The remote action to be registered with the given actionId as system action.
* @param actionId The id uniquely identify the system action.
* @hide