Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController#nestedclasses) \| [Methods](https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController#inhmethods)

# AccessibilityButtonController

*** ** * ** ***

` public final class AccessibilityButtonController `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.accessibilityservice.AccessibilityButtonController |

<br />

*** ** * ** ***

Controller for the accessibility button within the system's navigation area

This class may be used to query the accessibility button's state and register callbacks for interactions with and state changes to the accessibility button when `https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo#FLAG_REQUEST_ACCESSIBILITY_BUTTON` is set.

**Note:** This class and `https://developer.android.com/reference/android/accessibilityservice/AccessibilityServiceInfo#FLAG_REQUEST_ACCESSIBILITY_BUTTON` should not be used as the sole means for offering functionality to users via an `https://developer.android.com/reference/android/accessibilityservice/AccessibilityService`. Some device implementations may choose not to provide a software-rendered system navigation area, making this affordance permanently unavailable.

**Note:** On device implementations where the accessibility button is supported, it may not be available at all times, such as when a foreground application uses `https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_HIDE_NAVIGATION`. A user may also choose to assign this button to another accessibility service or feature. In each of these cases, a registered `https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback`'s `https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback#onAvailabilityChanged(android.accessibilityservice.AccessibilityButtonController,%20boolean)` method will be invoked to provide notifications of changes in the accessibility button's availability to the registering service.

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback` Callback for interaction with and changes to state of the accessibility button within the system's navigation area. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController#isAccessibilityButtonAvailable()() ` Retrieves whether the accessibility button in the system's navigation area is available to the calling service. |
| ` void` | ` https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController#registerAccessibilityButtonCallback(android.accessibilityservice.AccessibilityButtonController.AccessibilityButtonCallback,%20android.os.Handler)(https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback callback, https://developer.android.com/reference/android/os/Handler handler) ` Registers the provided `https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback` for interaction and state change callbacks related to the accessibility button. |
| ` void` | ` https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController#registerAccessibilityButtonCallback(android.accessibilityservice.AccessibilityButtonController.AccessibilityButtonCallback)(https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback callback) ` Registers the provided `https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback` for interaction and state changes callbacks related to the accessibility button. |
| ` void` | ` https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController#unregisterAccessibilityButtonCallback(android.accessibilityservice.AccessibilityButtonController.AccessibilityButtonCallback)(https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback callback) ` Unregisters the provided `https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback` for interaction and state change callbacks related to the accessibility button. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### isAccessibilityButtonAvailable

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAccessibilityButtonAvailable ()
```

Retrieves whether the accessibility button in the system's navigation area is available to the calling service.

**Note:** If the service is not yet connected (e.g. `https://developer.android.com/reference/android/accessibilityservice/AccessibilityService#onServiceConnected()` has not yet been called) or the service has been disconnected, this method will have no effect and return `false`.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the accessibility button in the system's navigation area is available to the calling service, `false` otherwise <br /> |

### registerAccessibilityButtonCallback

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void registerAccessibilityButtonCallback (AccessibilityButtonController.AccessibilityButtonCallback callback, 
                Handler handler)
```

Registers the provided `https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback` for interaction and state change callbacks related to the accessibility button. The callback will occur on the specified `https://developer.android.com/reference/android/os/Handler`'s thread, or on the services's main thread if the handler is `null`.

<br />

| Parameters ||
|---|---|
| `callback` | `AccessibilityButtonController.AccessibilityButtonCallback`: the callback to add, must be non-null <br /> |
| `handler` | `Handler`: the handler on which the callback should execute, must be non-null <br /> |

### registerAccessibilityButtonCallback

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void registerAccessibilityButtonCallback (AccessibilityButtonController.AccessibilityButtonCallback callback)
```

Registers the provided `https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback` for interaction and state changes callbacks related to the accessibility button.

<br />

| Parameters ||
|---|---|
| `callback` | `AccessibilityButtonController.AccessibilityButtonCallback`: the callback to add, must be non-null <br /> |

### unregisterAccessibilityButtonCallback

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterAccessibilityButtonCallback (AccessibilityButtonController.AccessibilityButtonCallback callback)
```

Unregisters the provided `https://developer.android.com/reference/android/accessibilityservice/AccessibilityButtonController.AccessibilityButtonCallback` for interaction and state change callbacks related to the accessibility button.

<br />

| Parameters ||
|---|---|
| `callback` | `AccessibilityButtonController.AccessibilityButtonCallback`: the callback to remove, must be non-null <br /> |