Android APIs
public class

AccessibilityWindowInfoCompat

extends Object
java.lang.Object
   ↳ android.support.v4.view.accessibility.AccessibilityWindowInfoCompat

Class Overview

Helper for accessing AccessibilityWindowInfo introduced after API level 4 in a backwards compatible fashion.

Summary

Constants
int TYPE_ACCESSIBILITY_OVERLAY Window type: Windows that are overlaid only by an AccessibilityService for interception of user interactions without changing the windows an accessibility service can introspect.
int TYPE_APPLICATION Window type: This is an application window.
int TYPE_INPUT_METHOD Window type: This is an input method window.
int TYPE_SYSTEM Window type: This is an system window.
Public Methods
boolean equals(Object obj)
Compares this instance with the specified object and indicates if they are equal.
void getBoundsInScreen(Rect outBounds)
Gets the bounds of this window in the screen.
AccessibilityWindowInfoCompat getChild(int index)
Gets the child window at a given index.
int getChildCount()
Gets the number of child windows.
int getId()
Gets the unique window id.
int getLayer()
Gets the layer which determines the Z-order of the window.
AccessibilityWindowInfoCompat getParent()
Gets the parent window if such.
AccessibilityNodeInfoCompat getRoot()
Gets the root node in the window's hierarchy.
int getType()
Gets the type of the window.
int hashCode()
Returns an integer hash code for this object.
boolean isAccessibilityFocused()
Gets if this window has accessibility focus.
boolean isActive()
Gets if this window is active.
boolean isFocused()
Gets if this window has input focus.
static AccessibilityWindowInfoCompat obtain()
Returns a cached instance if such is available or a new one is created.
static AccessibilityWindowInfoCompat obtain(AccessibilityWindowInfoCompat info)
Returns a cached instance if such is available or a new one is created.
void recycle()
Return an instance back to be reused.
String toString()
Returns a string containing a concise, human-readable description of this object.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int TYPE_ACCESSIBILITY_OVERLAY

Window type: Windows that are overlaid only by an AccessibilityService for interception of user interactions without changing the windows an accessibility service can introspect. In particular, an accessibility service can introspect only windows that a sighted user can interact with which they can touch these windows or can type into these windows. For example, if there is a full screen accessibility overlay that is touchable, the windows below it will be introspectable by an accessibility service regardless they are covered by a touchable window.

Constant Value: 4 (0x00000004)

public static final int TYPE_APPLICATION

Window type: This is an application window. Such a window shows UI for interacting with an application.

Constant Value: 1 (0x00000001)

public static final int TYPE_INPUT_METHOD

Window type: This is an input method window. Such a window shows UI for inputting text such as keyboard, suggestions, etc.

Constant Value: 2 (0x00000002)

public static final int TYPE_SYSTEM

Window type: This is an system window. Such a window shows UI for interacting with the system.

Constant Value: 3 (0x00000003)

Public Methods

public boolean equals (Object obj)

Compares this instance with the specified object and indicates if they are equal. In order to be equal, o must represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.

The default implementation returns true only if this == o. See Writing a correct equals method if you intend implementing your own equals method.

The general contract for the equals and hashCode() methods is that if equals returns true for any two objects, then hashCode() must return the same value for these objects. This means that subclasses of Object usually override either both methods or neither of them.

Parameters
obj the object to compare this instance with.
Returns
  • true if the specified object is equal to this Object; false otherwise.

public void getBoundsInScreen (Rect outBounds)

Gets the bounds of this window in the screen.

Parameters
outBounds The out window bounds.

public AccessibilityWindowInfoCompat getChild (int index)

Gets the child window at a given index.

Parameters
index The index.
Returns
  • The child.

public int getChildCount ()

Gets the number of child windows.

Returns
  • The child count.

public int getId ()

Gets the unique window id.

Returns
  • windowId The window id.

public int getLayer ()

Gets the layer which determines the Z-order of the window. Windows with greater layer appear on top of windows with lesser layer.

Returns
  • The window layer.

public AccessibilityWindowInfoCompat getParent ()

Gets the parent window if such.

Returns
  • The parent window.

public AccessibilityNodeInfoCompat getRoot ()

Gets the root node in the window's hierarchy.

Returns
  • The root node.

public int getType ()

Gets the type of the window.

Returns
  • The type.

public int hashCode ()

Returns an integer hash code for this object. By contract, any two objects for which equals(Object) returns true must return the same hash code value. This means that subclasses of Object usually override both methods or neither method.

Note that hash values must not change over time unless information used in equals comparisons also changes.

See Writing a correct hashCode method if you intend implementing your own hashCode method.

Returns
  • this object's hash code.

public boolean isAccessibilityFocused ()

Gets if this window has accessibility focus.

Returns
  • Whether has accessibility focus.

public boolean isActive ()

Gets if this window is active. An active window is the one the user is currently touching or the window has input focus and the user is not touching any window.

Returns
  • Whether this is the active window.

public boolean isFocused ()

Gets if this window has input focus.

Returns
  • Whether has input focus.

public static AccessibilityWindowInfoCompat obtain ()

Returns a cached instance if such is available or a new one is created.

Returns
  • An instance.

public static AccessibilityWindowInfoCompat obtain (AccessibilityWindowInfoCompat info)

Returns a cached instance if such is available or a new one is created. The returned instance is initialized from the given info.

Parameters
info The other info.
Returns
  • An instance.

public void recycle ()

Return an instance back to be reused.

Note: You must not touch the object after calling this function.

Throws
IllegalStateException If the info is already recycled.

public String toString ()

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.