Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 112f70ce authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Bluetooth: HID-C: Add support for error parameter for reportError"

parents c376ae71 4e716132
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -69,6 +69,18 @@ public final class BluetoothHidDevice implements BluetoothProfile {
    public static final byte REPORT_TYPE_OUTPUT = (byte) 2;
    public static final byte REPORT_TYPE_FEATURE = (byte) 3;

    /**
     * Constants representing error response for Set Report.
     *
     * @see BluetoothHidDeviceCallback#onSetReport(byte, byte, byte[])
     */
    public static final byte ERROR_RSP_SUCCESS = (byte) 0;
    public static final byte ERROR_RSP_NOT_READY = (byte) 1;
    public static final byte ERROR_RSP_INVALID_RPT_ID = (byte) 2;
    public static final byte ERROR_RSP_UNSUPPORTED_REQ = (byte) 3;
    public static final byte ERROR_RSP_INVALID_PARAM = (byte) 4;
    public static final byte ERROR_RSP_UNKNOWN = (byte) 14;

    /**
     * Constants representing protocol mode used set by host. Default is always
     * {@link #PROTOCOL_REPORT_MODE} unless notified otherwise.
@@ -386,16 +398,17 @@ public final class BluetoothHidDevice implements BluetoothProfile {
     * Sends error handshake message as reply for invalid SET_REPORT request
     * from {@link BluetoothHidDeviceCallback#onSetReport(byte, byte, byte[])}.
     *
     * @param error Error to be sent for SET_REPORT via HANDSHAKE.
     * @return
     */
    public boolean reportError() {
        Log.v(TAG, "reportError()");
    public boolean reportError(byte error) {
        Log.v(TAG, "reportError(): error = " + error);

        boolean result = false;

        if (mService != null) {
            try {
                result = mService.reportError();
                result = mService.reportError(error);
            } catch (RemoteException e) {
                Log.e(TAG, e.toString());
            }
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ interface IBluetoothHidDevice {
    boolean unregisterApp(in BluetoothHidDeviceAppConfiguration config);
    boolean sendReport(in int id, in byte[] data);
    boolean replyReport(in byte type, in byte id, in byte[] data);
    boolean reportError();
    boolean reportError(byte error);
    boolean unplug();
    boolean connect();
    boolean disconnect();