Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8eeefefc authored by alanv's avatar alanv
Browse files

Add performAccessibilityAction to AccessibilityDelegate.

Change-Id: I43dff2ced959af5d8a9ce9ed18858a6e74cb35c6
parent 911b0c0b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24381,6 +24381,7 @@ package android.view {
    method public void onInitializeAccessibilityNodeInfo(android.view.View, android.view.accessibility.AccessibilityNodeInfo);
    method public void onPopulateAccessibilityEvent(android.view.View, android.view.accessibility.AccessibilityEvent);
    method public boolean onRequestSendAccessibilityEvent(android.view.ViewGroup, android.view.View, android.view.accessibility.AccessibilityEvent);
    method public boolean performAccessibilityAction(android.view.View, int, android.os.Bundle);
    method public void sendAccessibilityEvent(android.view.View, int);
    method public void sendAccessibilityEventUnchecked(android.view.View, android.view.accessibility.AccessibilityEvent);
  }
+39 −0
Original line number Diff line number Diff line
@@ -6463,12 +6463,31 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
    /**
     * Performs the specified accessibility action on the view. For
     * possible accessibility actions look at {@link AccessibilityNodeInfo}.
    * <p>
    * If an {@link AccessibilityDelegate} has been specified via calling
    * {@link #setAccessibilityDelegate(AccessibilityDelegate)} its
    * {@link AccessibilityDelegate#performAccessibilityAction(View, int, Bundle)}
    * is responsible for handling this call.
    * </p>
     *
     * @param action The action to perform.
     * @param arguments Optional action arguments.
     * @return Whether the action was performed.
     */
    public boolean performAccessibilityAction(int action, Bundle arguments) {
      if (mAccessibilityDelegate != null) {
          return mAccessibilityDelegate.performAccessibilityAction(this, action, arguments);
      } else {
          return performAccessibilityActionInternal(action, arguments);
      }
    }
   /**
    * @see #performAccessibilityAction(int, Bundle)
    *
    * Note: Called from the default {@link AccessibilityDelegate}.
    */
    boolean performAccessibilityActionInternal(int action, Bundle arguments) {
        switch (action) {
            case AccessibilityNodeInfo.ACTION_CLICK: {
                if (isClickable()) {
@@ -17411,6 +17430,26 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
            host.sendAccessibilityEventInternal(eventType);
        }
        /**
         * Performs the specified accessibility action on the view. For
         * possible accessibility actions look at {@link AccessibilityNodeInfo}.
         * <p>
         * The default implementation behaves as
         * {@link View#performAccessibilityAction(int, Bundle)
         *  View#performAccessibilityAction(int, Bundle)} for the case of
         *  no accessibility delegate been set.
         * </p>
         *
         * @param action The action to perform.
         * @return Whether the action was performed.
         *
         * @see View#performAccessibilityAction(int, Bundle)
         *      View#performAccessibilityAction(int, Bundle)
         */
        public boolean performAccessibilityAction(View host, int action, Bundle args) {
            return host.performAccessibilityActionInternal(action, args);
        }
        /**
         * Sends an accessibility event. This method behaves exactly as
         * {@link #sendAccessibilityEvent(View, int)} but takes as an argument an