IT. Expert System.

Android Reference

AccessibilityInteractionClient


android.view.accessibility

Class AccessibilityInteractionClient

  • java.lang.Object
    • IAccessibilityInteractionConnectionCallback.Stub
      • android.view.accessibility.AccessibilityInteractionClient


  • public final class AccessibilityInteractionClient
    extends IAccessibilityInteractionConnectionCallback.Stub
    This class is a singleton that performs accessibility interaction which is it queries remote view hierarchies about snapshots of their views as well requests from these hierarchies to perform certain actions on their views. Rationale: The content retrieval APIs are synchronous from a client's perspective but internally they are asynchronous. The client thread calls into the system requesting an action and providing a callback to receive the result after which it waits up to a timeout for that result. The system enforces security and the delegates the request to a given view hierarchy where a message is posted (from a binder thread) describing what to be performed by the main UI thread the result of which it delivered via the mentioned callback. However, the blocked client thread and the main UI thread of the target view hierarchy can be the same thread, for example an accessibility service and an activity run in the same process, thus they are executed on the same main thread. In such a case the retrieval will fail since the UI thread that has to process the message describing the work to be done is blocked waiting for a result is has to compute! To avoid this scenario when making a call the client also passes its process and thread ids so the accessed view hierarchy can detect if the client making the request is running in its main UI thread. In such a case the view hierarchy, specifically the binder thread performing the IPC to it, does not post a message to be run on the UI thread but passes it to the singleton interaction client through which all interactions occur and the latter is responsible to execute the message before starting to wait for the asynchronous result delivered via the callback. In this case the expected result is already received so no waiting is performed.
    • Method Detail

      • getInstanceForThread

        public static AccessibilityInteractionClient getInstanceForThread(long threadId)
        Note: We keep one instance per interrogating thread since the instance contains state which can lead to undesired thread interleavings. We do not have a thread local variable since other threads should be able to look up the correct client knowing a thread id. See ViewRootImpl for details.
        Returns:
        The client for a given threadId.
      • setSameThreadMessage

        public void setSameThreadMessage(Message message)
        Sets the message to be processed if the interacted view hierarchy and the interacting client are running in the same thread.
        Parameters:
        message - The message.
      • findAccessibilityNodeInfoByAccessibilityId

        public AccessibilityNodeInfo findAccessibilityNodeInfoByAccessibilityId(int connectionId,
                                                                       int accessibilityWindowId,
                                                                       long accessibilityNodeId,
                                                                       int prefetchFlags)
        Finds an AccessibilityNodeInfo by accessibility id.
        Parameters:
        connectionId - The id of a connection for interacting with the system.
        accessibilityWindowId - A unique window id. Use AccessibilityNodeInfo.ACTIVE_WINDOW_ID to query the currently active window.
        accessibilityNodeId - A unique view id or virtual descendant id from where to start the search. Use AccessibilityNodeInfo.ROOT_NODE_ID to start from the root.
        prefetchFlags - flags to guide prefetching.
        Returns:
        An AccessibilityNodeInfo if found, null otherwise.
      • findAccessibilityNodeInfoByViewId

        public AccessibilityNodeInfo findAccessibilityNodeInfoByViewId(int connectionId,
                                                              int accessibilityWindowId,
                                                              long accessibilityNodeId,
                                                              int viewId)
        Finds an AccessibilityNodeInfo by View id. The search is performed in the window whose id is specified and starts from the node whose accessibility id is specified.
        Parameters:
        connectionId - The id of a connection for interacting with the system.
        accessibilityWindowId - A unique window id. Use AccessibilityNodeInfo.ACTIVE_WINDOW_ID to query the currently active window.
        accessibilityNodeId - A unique view id or virtual descendant id from where to start the search. Use AccessibilityNodeInfo.ROOT_NODE_ID to start from the root.
        viewId - The id of the view.
        Returns:
        An AccessibilityNodeInfo if found, null otherwise.
      • findAccessibilityNodeInfosByText

        public List<AccessibilityNodeInfo> findAccessibilityNodeInfosByText(int connectionId,
                                                                   int accessibilityWindowId,
                                                                   long accessibilityNodeId,
                                                                   String text)
        Finds AccessibilityNodeInfos by View text. The match is case insensitive containment. The search is performed in the window whose id is specified and starts from the node whose accessibility id is specified.
        Parameters:
        connectionId - The id of a connection for interacting with the system.
        accessibilityWindowId - A unique window id. Use AccessibilityNodeInfo.ACTIVE_WINDOW_ID to query the currently active window.
        accessibilityNodeId - A unique view id or virtual descendant id from where to start the search. Use AccessibilityNodeInfo.ROOT_NODE_ID to start from the root.
        text - The searched text.
        Returns:
        A list of found AccessibilityNodeInfos.
      • findFocus

        public AccessibilityNodeInfo findFocus(int connectionId,
                                      int accessibilityWindowId,
                                      long accessibilityNodeId,
                                      int focusType)
        Finds the AccessibilityNodeInfo that has the specified focus type. The search is performed in the window whose id is specified and starts from the node whose accessibility id is specified.
        Parameters:
        connectionId - The id of a connection for interacting with the system.
        accessibilityWindowId - A unique window id. Use AccessibilityNodeInfo.ACTIVE_WINDOW_ID to query the currently active window.
        accessibilityNodeId - A unique view id or virtual descendant id from where to start the search. Use AccessibilityNodeInfo.ROOT_NODE_ID to start from the root.
        focusType - The focus type.
        Returns:
        The accessibility focused AccessibilityNodeInfo.
      • focusSearch

        public AccessibilityNodeInfo focusSearch(int connectionId,
                                        int accessibilityWindowId,
                                        long accessibilityNodeId,
                                        int direction)
        Finds the accessibility focused AccessibilityNodeInfo. The search is performed in the window whose id is specified and starts from the node whose accessibility id is specified.
        Parameters:
        connectionId - The id of a connection for interacting with the system.
        accessibilityWindowId - A unique window id. Use AccessibilityNodeInfo.ACTIVE_WINDOW_ID to query the currently active window.
        accessibilityNodeId - A unique view id or virtual descendant id from where to start the search. Use AccessibilityNodeInfo.ROOT_NODE_ID to start from the root.
        direction - The direction in which to search for focusable.
        Returns:
        The accessibility focused AccessibilityNodeInfo.
      • performAccessibilityAction

        public boolean performAccessibilityAction(int connectionId,
                                         int accessibilityWindowId,
                                         long accessibilityNodeId,
                                         int action,
                                         Bundle arguments)
        Performs an accessibility action on an AccessibilityNodeInfo.
        Parameters:
        connectionId - The id of a connection for interacting with the system.
        accessibilityWindowId - A unique window id. Use AccessibilityNodeInfo.ACTIVE_WINDOW_ID to query the currently active window.
        accessibilityNodeId - A unique view id or virtual descendant id from where to start the search. Use AccessibilityNodeInfo.ROOT_NODE_ID to start from the root.
        action - The action to perform.
        arguments - Optional action arguments.
        Returns:
        Whether the action was performed.
      • clearCache

        public void clearCache()
      • setFindAccessibilityNodeInfoResult

        public void setFindAccessibilityNodeInfoResult(AccessibilityNodeInfo info,
                                              int interactionId)
      • setFindAccessibilityNodeInfosResult

        public void setFindAccessibilityNodeInfosResult(List<AccessibilityNodeInfo> infos,
                                               int interactionId)
      • setPerformAccessibilityActionResult

        public void setPerformAccessibilityActionResult(boolean succeeded,
                                               int interactionId)
      • getConnection

        public IAccessibilityServiceConnection getConnection(int connectionId)
        Gets a cached accessibility service connection.
        Parameters:
        connectionId - The connection id.
        Returns:
        The cached connection if such.
      • addConnection

        public void addConnection(int connectionId,
                         IAccessibilityServiceConnection connection)
        Adds a cached accessibility service connection.
        Parameters:
        connectionId - The connection id.
        connection - The connection.
      • removeConnection

        public void removeConnection(int connectionId)
        Removes a cached accessibility service connection.
        Parameters:
        connectionId - The connection id.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 291 / 158851200. Delta: 0.03606 с