# AccessibilityWindowInfoCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/view/accessibility/AccessibilityWindowInfoCompat.java+class:androidx.core.view.accessibility.AccessibilityWindowInfoCompat) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***


```
public class AccessibilityWindowInfoCompat
```

<br />

*** ** * ** ***

Helper for accessing `https://developer.android.com/reference/android/view/accessibility/AccessibilityWindowInfo.html`.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#TYPE_ACCESSIBILITY_OVERLAY() = 4` Window type: Windows that are overlaid *only* by an `https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html` for interception of user interactions without changing the windows an accessibility service can introspect. |
| `static final int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#TYPE_APPLICATION() = 1` Window type: This is an application window. |
| `static final int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#TYPE_INPUT_METHOD() = 2` Window type: This is an input method window. |
| `static final int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#TYPE_MAGNIFICATION_OVERLAY() = 6` Window type: A system window used to show the UI for the interaction with window-based magnification, which includes the magnified content and the option menu. |
| `static final int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#TYPE_SPLIT_SCREEN_DIVIDER() = 5` Window type: A system window used to divide the screen in split-screen mode. |
| `static final int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#TYPE_SYSTEM() = 3` Window type: This is an system window. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#AccessibilityWindowInfoCompat()()` Creates a new AccessibilityWindowInfoCompat. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html obj)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getAnchor()()` Gets the node that anchors this window to another. |
| `void` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getBoundsInScreen(android.graphics.Rect)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Rect.html outBounds)` Gets the bounds of this window in the screen. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getChild(int)(int index)` Gets the child window at a given index. |
| `int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getChildCount()()` Gets the number of child windows. |
| `int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getDisplayId()()` Returns the ID of the display this window is on, for use with `https://developer.android.com/reference/android/hardware/display/DisplayManager.html#getDisplay(int)`. |
| `int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getId()()` Gets the unique window id. |
| `int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getLayer()()` Gets the layer which determines the Z-order of the window. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/os/LocaleListCompat` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getLocales()()` Returns the `https://developer.android.com/reference/android/os/LocaleList.html` of the window. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getParent()()` Gets the parent window if such. |
| `void` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getRegionInScreen(android.graphics.Region)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Region.html outRegion)` Gets the touchable region of this window in the screen. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getRoot()()` Gets the root node in the window's hierarchy. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getRoot(int)(int prefetchingStrategy)` Gets the root node in the window's hierarchy. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getTitle()()` Gets the title of the window. |
| `long` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getTransitionTimeMillis()()` Returns the `https://developer.android.com/reference/android/os/SystemClock.html#uptimeMillis()` at which the last transition happens. |
| `int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getType()()` Gets the type of the window. |
| `int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#hashCode()()` |
| `boolean` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#isAccessibilityFocused()()` Gets if this window has accessibility focus. |
| `boolean` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#isActive()()` Gets if this window is active. |
| `boolean` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#isFocused()()` Gets if this window has input focus. |
| `boolean` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#isInPictureInPictureMode()()` Check if the window is in picture-in-picture mode. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#obtain()()` Returns a cached instance if such is available or a new one is created. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#obtain(androidx.core.view.accessibility.AccessibilityWindowInfoCompat)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat info)` Returns a cached instance if such is available or a new one is created. |
| `void` | `[recycle](https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#recycle())()` **This method is deprecated.** Accessibility Object recycling is no longer necessary or functional. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#toString()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/accessibility/AccessibilityWindowInfo.html` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#unwrap()()` |

## Constants

### TYPE_ACCESSIBILITY_OVERLAY

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int TYPE_ACCESSIBILITY_OVERLAY = 4
```

Window type: Windows that are overlaid *only* by an `https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html` 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.

### TYPE_APPLICATION

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int TYPE_APPLICATION = 1
```

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

### TYPE_INPUT_METHOD

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int TYPE_INPUT_METHOD = 2
```

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

### TYPE_MAGNIFICATION_OVERLAY

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
public static final int TYPE_MAGNIFICATION_OVERLAY = 6
```

Window type: A system window used to show the UI for the interaction with window-based magnification, which includes the magnified content and the option menu.

### TYPE_SPLIT_SCREEN_DIVIDER

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int TYPE_SPLIT_SCREEN_DIVIDER = 5
```

Window type: A system window used to divide the screen in split-screen mode. This type of window is present only in split-screen mode.

### TYPE_SYSTEM

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int TYPE_SYSTEM = 3
```

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

## Public constructors

### AccessibilityWindowInfoCompat

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
public AccessibilityWindowInfoCompat()
```

Creates a new AccessibilityWindowInfoCompat.

Compatibility:

- Api \<30: Will not wrap an `https://developer.android.com/reference/android/view/accessibility/AccessibilityWindowInfo.html` instance.

## Public methods

### equals

```
public boolean equals(Object obj)
```

### getAnchor

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @Nullable AccessibilityNodeInfoCompat getAnchor()
```

Gets the node that anchors this window to another.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat` | The anchor node, or `null` if none exists. |

### getBoundsInScreen

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void getBoundsInScreen(@NonNull Rect outBounds)
```

Gets the bounds of this window in the screen.

Compatibility:

- API \<21: Does not operate.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Rect.html outBounds` | The out window bounds. |

### getChild

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @Nullable AccessibilityWindowInfoCompat getChild(int index)
```

Gets the child window at a given index.

| Parameters |
|---|---|
| `int index` | The index. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat` | The child. |

### getChildCount

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public int getChildCount()
```

Gets the number of child windows.

| Returns |
|---|---|
| `int` | The child count. |

### getDisplayId

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/core#1.9.0)

```
public int getDisplayId()
```

Returns the ID of the display this window is on, for use with `https://developer.android.com/reference/android/hardware/display/DisplayManager.html#getDisplay(int)`.

Compatibility:

- Api \<33: Will return android.view.Display.DEFAULT_DISPLAY.

| Returns |
|---|---|
| `int` | the logical display id. |

### getId

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public int getId()
```

Gets the unique window id.

| Returns |
|---|---|
| `int` | windowId The window id. |

### getLayer

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
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 |
|---|---|
| `int` | The window layer. |

### getLocales

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
public @NonNull LocaleListCompat getLocales()
```

Returns the `https://developer.android.com/reference/android/os/LocaleList.html` of the window.

Compatibility:

- Api \<34: Will return `https://developer.android.com/reference/androidx/core/os/LocaleListCompat#getEmptyLocaleList()`.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/os/LocaleListCompat` | the locales of the window. |

### getParent

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @Nullable AccessibilityWindowInfoCompat getParent()
```

Gets the parent window if such.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat` | The parent window. |

### getRegionInScreen

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/core#1.9.0)

```
public void getRegionInScreen(@NonNull Region outRegion)
```

Gets the touchable region of this window in the screen.

Compatibility:

- API \<33: Gets the bounds of this window in the screen.
- API \<21: Does not operate.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Region.html outRegion` | The out window region. |

### getRoot

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @Nullable AccessibilityNodeInfoCompat getRoot()
```

Gets the root node in the window's hierarchy.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat` | The root node. |

### getRoot

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
public @Nullable AccessibilityNodeInfoCompat getRoot(int prefetchingStrategy)
```

Gets the root node in the window's hierarchy.

| Parameters |
|---|---|
| `int prefetchingStrategy` | the prefetching strategy. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat` | The root node. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat#getParent(int)` | for a description of prefetching. |

### getTitle

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @Nullable CharSequence getTitle()
```

Gets the title of the window.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html` | The title of the window, or the application label for the window if no title was explicitly set, or `null` if neither is available. |

### getTransitionTimeMillis

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
public long getTransitionTimeMillis()
```

Returns the `https://developer.android.com/reference/android/os/SystemClock.html#uptimeMillis()` at which the last transition happens. A transition happens when `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#getBoundsInScreen(android.graphics.Rect)` is changed.

Compatibility:

- Api \<34: Will return 0.

| Returns |
|---|---|
| `long` | The transition timestamp. |

### getType

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public int getType()
```

Gets the type of the window.

| Returns |
|---|---|
| `int` | The type. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#TYPE_APPLICATION()` |   |
| `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#TYPE_INPUT_METHOD()` |   |
| `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#TYPE_SYSTEM()` |   |
| `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#TYPE_ACCESSIBILITY_OVERLAY()` |   |

### hashCode

```
public int hashCode()
```

### isAccessibilityFocused

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public boolean isAccessibilityFocused()
```

Gets if this window has accessibility focus.

| Returns |
|---|---|
| `boolean` | Whether has accessibility focus. |

### isActive

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
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 |
|---|---|
| `boolean` | Whether this is the active window. |

### isFocused

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public boolean isFocused()
```

Gets if this window has input focus.

| Returns |
|---|---|
| `boolean` | Whether has input focus. |

### isInPictureInPictureMode

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/core#1.9.0)

```
public boolean isInPictureInPictureMode()
```

Check if the window is in picture-in-picture mode.

Compatibility:

- API \<26: Returns false.

| Returns |
|---|---|
| `boolean` | `true` if the window is in picture-in-picture mode, `false` otherwise. |

### obtain

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static @Nullable AccessibilityWindowInfoCompat obtain()
```

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

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat` | An instance. |

### obtain

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static @Nullable AccessibilityWindowInfoCompat obtain(@Nullable 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 |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat info` | The other info. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat` | An instance. |

### recycle

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0) Deprecated in [1.10.0](https://developer.android.com/jetpack/androidx/releases/core#1.10.0)

```
public void [recycle](https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityWindowInfoCompat#recycle())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Accessibility Object recycling is no longer necessary or functional.

Return an instance back to be reused.

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

### toString

```
public @NonNull String toString()
```

### unwrap

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/core#1.9.0)

```
public @Nullable AccessibilityWindowInfo unwrap()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/accessibility/AccessibilityWindowInfo.html` | The unwrapped `https://developer.android.com/reference/android/view/accessibility/AccessibilityWindowInfo.html`. |