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

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

Merge changes I2861d51d,Ifcc6971f am: 2b53c203 am: 41722652 am: 3df425a0

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

Change-Id: Id714f5d4b7ce64472d60abed1cee05451cbc189e
parents ff544fed 3df425a0
Loading
Loading
Loading
Loading
+36 −36
Original line number Diff line number Diff line
@@ -943,7 +943,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(value = {
            BluetoothStatusCodes.SUCCESS,
            BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED,
            BluetoothStatusCodes.ERROR_PROFILE_SERVICE_NOT_BOUND,
            BluetoothStatusCodes.ERROR_TIMEOUT,
            BluetoothStatusCodes.ERROR_UNKNOWN,
@@ -955,7 +954,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
    @IntDef(value = {
            BluetoothStatusCodes.ALLOWED,
            BluetoothStatusCodes.NOT_ALLOWED,
            BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED,
            BluetoothStatusCodes.ERROR_PROFILE_SERVICE_NOT_BOUND,
            BluetoothStatusCodes.ERROR_TIMEOUT,
            BluetoothStatusCodes.ERROR_UNKNOWN,
@@ -988,9 +986,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
            Log.w(TAG, "Proxy not attached to service");
            if (DBG) log(Log.getStackTraceString(new Throwable()));
            return BluetoothStatusCodes.ERROR_PROFILE_SERVICE_NOT_BOUND;
        } else if (!isEnabled()) {
            return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED;
        }
        } else if (isEnabled()) {
            try {
                final SynchronousResultReceiver recv = new SynchronousResultReceiver();
                service.setAudioRouteAllowed(allowed, mAttributionSource, recv);
@@ -1003,6 +999,9 @@ public final class BluetoothHeadset implements BluetoothProfile {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                e.rethrowFromSystemServer();
            }
        }

        Log.e(TAG, "setAudioRouteAllowed: Bluetooth disabled, but profile service still bound");
        return BluetoothStatusCodes.ERROR_UNKNOWN;
    }

@@ -1027,9 +1026,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
            Log.w(TAG, "Proxy not attached to service");
            if (DBG) log(Log.getStackTraceString(new Throwable()));
            return BluetoothStatusCodes.ERROR_PROFILE_SERVICE_NOT_BOUND;
        } else if (!isEnabled()) {
            return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED;
        }
        } else if (isEnabled()) {
            try {
                final SynchronousResultReceiver<Boolean> recv = new SynchronousResultReceiver();
                service.getAudioRouteAllowed(mAttributionSource, recv);
@@ -1042,6 +1039,9 @@ public final class BluetoothHeadset implements BluetoothProfile {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                e.rethrowFromSystemServer();
            }
        }

        Log.e(TAG, "getAudioRouteAllowed: Bluetooth disabled, but profile service still bound");
        return BluetoothStatusCodes.ERROR_UNKNOWN;
    }

@@ -1078,7 +1078,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
            BluetoothStatusCodes.ERROR_UNKNOWN,
            BluetoothStatusCodes.ERROR_PROFILE_SERVICE_NOT_BOUND,
            BluetoothStatusCodes.ERROR_TIMEOUT,
            BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED,
            BluetoothStatusCodes.ERROR_AUDIO_DEVICE_ALREADY_CONNECTED,
            BluetoothStatusCodes.ERROR_NO_ACTIVE_DEVICES,
            BluetoothStatusCodes.ERROR_NOT_ACTIVE_DEVICE,
@@ -1128,9 +1127,10 @@ public final class BluetoothHeadset implements BluetoothProfile {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                return BluetoothStatusCodes.ERROR_TIMEOUT;
            }
        } else {
            return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED;
        }

        Log.e(TAG, "connectAudio: Bluetooth disabled, but profile service still bound");
        return defaultValue;
    }

    /** @hide */
@@ -1140,7 +1140,6 @@ public final class BluetoothHeadset implements BluetoothProfile {
            BluetoothStatusCodes.ERROR_UNKNOWN,
            BluetoothStatusCodes.ERROR_PROFILE_SERVICE_NOT_BOUND,
            BluetoothStatusCodes.ERROR_TIMEOUT,
            BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED,
            BluetoothStatusCodes.ERROR_PROFILE_NOT_CONNECTED,
            BluetoothStatusCodes.ERROR_AUDIO_DEVICE_ALREADY_DISCONNECTED
    })
@@ -1183,9 +1182,10 @@ public final class BluetoothHeadset implements BluetoothProfile {
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                return BluetoothStatusCodes.ERROR_TIMEOUT;
            }
        } else {
            return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED;
        }

        Log.e(TAG, "disconnectAudio: Bluetooth disabled, but profile service still bound");
        return defaultValue;
    }

    /**