Added in API level 35

BrailleDisplayController.BrailleDisplayCallback


public static interface BrailleDisplayController.BrailleDisplayCallback

android.accessibilityservice.BrailleDisplayController.BrailleDisplayCallback


Interface provided to BrailleDisplayController connection methods to receive callbacks from the system.

Summary

Constants

int FLAG_ERROR_BRAILLE_DISPLAY_NOT_FOUND

A unique Braille display matching the requested properties could not be identified.

int FLAG_ERROR_CANNOT_ACCESS

The system cannot access connected HID devices.

Public methods

abstract void onConnected(byte[] hidDescriptor)

Callback to observe a successful Braille display connection.

abstract void onConnectionFailed(int errorFlags)

Callback to observe a failed Braille display connection.

abstract void onDisconnected()

Callback to observe when the currently connected Braille display is disconnected by the system.

abstract void onInput(byte[] input)

Callback to observe input bytes from the currently connected Braille display.

Constants

FLAG_ERROR_BRAILLE_DISPLAY_NOT_FOUND

Added in API level 35
public static final int FLAG_ERROR_BRAILLE_DISPLAY_NOT_FOUND

A unique Braille display matching the requested properties could not be identified.

Constant Value: 2 (0x00000002)

FLAG_ERROR_CANNOT_ACCESS

Added in API level 35
public static final int FLAG_ERROR_CANNOT_ACCESS

The system cannot access connected HID devices.

Constant Value: 1 (0x00000001)

Public methods

onConnected

Added in API level 35
public abstract void onConnected (byte[] hidDescriptor)

Callback to observe a successful Braille display connection.

The provided HID report descriptor should be used to understand the input bytes received from the Braille display via onInput(byte) and to prepare the output sent to the Braille display via BrailleDisplayController.write(byte).

Parameters
hidDescriptor byte: The HID report descriptor for this Braille display. This value cannot be null.

onConnectionFailed

Added in API level 35
public abstract void onConnectionFailed (int errorFlags)

Callback to observe a failed Braille display connection.

Parameters
errorFlags int: A bitmask of error codes for the connection failure. Value is either 0 or a combination of FLAG_ERROR_CANNOT_ACCESS, and FLAG_ERROR_BRAILLE_DISPLAY_NOT_FOUND

onDisconnected

Added in API level 35
public abstract void onDisconnected ()

Callback to observe when the currently connected Braille display is disconnected by the system.

onInput

Added in API level 35
public abstract void onInput (byte[] input)

Callback to observe input bytes from the currently connected Braille display.

Parameters
input byte: The input bytes from the Braille display, formatted according to the HID report descriptor and the HIDRAW kernel driver. This value cannot be null.