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

Commit 5b5d4d23 authored by Rahul Sabnis's avatar Rahul Sabnis
Browse files

Add IntDef for the return value of

BluetoothAdapter#notifyActiveDeviceChangeApplied

Tag: #feature
Bug: 266810277
Test: atest BluetoothAdapterTest
Change-Id: Ib9fff3e7d07662c88e68f6384c947a5d02594dce
parent 7a58427b
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -5217,6 +5217,18 @@ public final class BluetoothAdapter {
        return defaultValue;
    }

    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(value = {
            BluetoothStatusCodes.SUCCESS,
            BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED,
            BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ALLOWED,
            BluetoothStatusCodes.ERROR_DEVICE_NOT_BONDED,
            BluetoothStatusCodes.ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION,
            BluetoothStatusCodes.ERROR_UNKNOWN
    })
    public @interface NotifyActiveDeviceChangeAppliedReturnValues {}

    /**
     * Called by audio framework to inform the Bluetooth stack that an active device change has
     * taken effect. If this active device change is triggered by an app calling
@@ -5239,6 +5251,7 @@ public final class BluetoothAdapter {
            android.Manifest.permission.BLUETOOTH_CONNECT,
            android.Manifest.permission.BLUETOOTH_PRIVILEGED,
    })
    @NotifyActiveDeviceChangeAppliedReturnValues
    public int notifyActiveDeviceChangeApplied(@NonNull BluetoothDevice device) {
        if (DBG) Log.d(TAG, "notifyActiveDeviceChangeApplied(" + device + ")");
        Objects.requireNonNull(device, "device cannot be null");