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

Commit 64b3106c authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "get and set audio route allowed APIs should have different IntDef since...

Merge "get and set audio route allowed APIs should have different IntDef since they return different sets of values" am: fcc1bce4 am: 5e0e88fa am: 47d67f1c am: 4f5ebfd8

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1991710

Change-Id: I318990a58b6920b992c4e230190dfe91529a4373
parents 4bf09b3f 4f5ebfd8
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -947,10 +947,21 @@ public final class BluetoothHeadset implements BluetoothProfile {
            BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED,
            BluetoothStatusCodes.ERROR_PROFILE_SERVICE_NOT_BOUND,
            BluetoothStatusCodes.ERROR_TIMEOUT,
            BluetoothStatusCodes.ERROR_UNKNOWN,
    })
    public @interface SetAudioRouteAllowedReturnValues {}

    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(value = {
            BluetoothStatusCodes.ALLOWED,
            BluetoothStatusCodes.NOT_ALLOWED,
            BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED,
            BluetoothStatusCodes.ERROR_PROFILE_SERVICE_NOT_BOUND,
            BluetoothStatusCodes.ERROR_TIMEOUT,
            BluetoothStatusCodes.ERROR_UNKNOWN,
    })
    public @interface AudioRouteAllowedReturnValues {}
    public @interface GetAudioRouteAllowedReturnValues {}

    /**
     * Sets whether audio routing is allowed. When set to {@code false}, the AG
@@ -971,7 +982,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
            android.Manifest.permission.BLUETOOTH_CONNECT,
            android.Manifest.permission.BLUETOOTH_PRIVILEGED,
    })
    public @AudioRouteAllowedReturnValues int setAudioRouteAllowed(boolean allowed) {
    public @SetAudioRouteAllowedReturnValues int setAudioRouteAllowed(boolean allowed) {
        if (VDBG) log("setAudioRouteAllowed");
        final IBluetoothHeadset service = mService;
        if (service == null) {
@@ -1010,7 +1021,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
            android.Manifest.permission.BLUETOOTH_CONNECT,
            android.Manifest.permission.BLUETOOTH_PRIVILEGED,
    })
    public @AudioRouteAllowedReturnValues int getAudioRouteAllowed() {
    public @GetAudioRouteAllowedReturnValues int getAudioRouteAllowed() {
        if (VDBG) log("getAudioRouteAllowed");
        final IBluetoothHeadset service = mService;
        if (service == null) {