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

Commit 189e880c authored by Rahul Sabnis's avatar Rahul Sabnis Committed by Automerger Merge Worker
Browse files

Merge changes from topic "hfp-audio-state-api-cleanup" am: 2d2bcc4f

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

Change-Id: Id7fd10109191113f07ad5fdb54019bee5b4e892a
parents e61f1984 2d2bcc4f
Loading
Loading
Loading
Loading
+12 −4
Original line number Original line Diff line number Diff line
@@ -1485,12 +1485,20 @@ public class HeadsetService extends ProfileService {
    }
    }


    int disconnectAudio() {
    int disconnectAudio() {
        int disconnectResult = BluetoothStatusCodes.ERROR_NO_ACTIVE_DEVICES;
        synchronized (mStateMachines) {
        synchronized (mStateMachines) {
            List<BluetoothDevice> activeAudioDevices = getNonIdleAudioDevices();
            for (BluetoothDevice device : getNonIdleAudioDevices()) {
            BluetoothDevice activeAudioDevice =
                disconnectResult = disconnectAudio(device);
                    activeAudioDevices.get(activeAudioDevices.size() - 1);
                if (disconnectResult == BluetoothStatusCodes.SUCCESS) {
            return disconnectAudio(activeAudioDevice);
                    return disconnectResult;
                } else {
                    Log.e(TAG, "disconnectAudio() from " + device + " failed with status code "
                            + disconnectResult);
                }
            }
        }
        }
        logD("disconnectAudio() no active audio connection");
        return disconnectResult;
    }
    }


    int disconnectAudio(BluetoothDevice device) {
    int disconnectAudio(BluetoothDevice device) {