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

Commit 2ee0b63d authored by Rahul Sabnis's avatar Rahul Sabnis Committed by Automerger Merge Worker
Browse files

Merge "Mirrors calls to suspend LE Audio with those for A2DP" am: 872e2a41...

Merge "Mirrors calls to suspend LE Audio with those for A2DP" am: 872e2a41 am: ff46cfd5 am: cfb77a65 am: 40ab33b3

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2512395



Change-Id: I4f1c3dfe4a327d29677b7bba3ac2d33551e5651d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a6f5dbb1 40ab33b3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1359,6 +1359,9 @@ public class AudioDeviceInventory {
                        "LE Audio device addr=" + address + " now available").printLog(TAG));
            }

            // Reset LEA suspend state each time a new sink is connected
            mAudioSystem.setParameters("LeAudioSuspended=false");

            mConnectedDevices.put(DeviceInfo.makeDeviceListKey(device, address),
                    new DeviceInfo(device, name, address, AudioSystem.AUDIO_FORMAT_DEFAULT));
            mDeviceBroker.postAccessoryPlugMediaUnmute(device);
@@ -1404,6 +1407,9 @@ public class AudioDeviceInventory {

    @GuardedBy("mDevicesLock")
    private void makeLeAudioDeviceUnavailableLater(String address, int device, int delayMs) {
        // prevent any activity on the LEA output to avoid unwanted
        // reconnection of the sink.
        mAudioSystem.setParameters("LeAudioSuspended=true");
        // the device will be made unavailable later, so consider it disconnected right away
        mConnectedDevices.remove(DeviceInfo.makeDeviceListKey(device, address));
        // send the delayed message to make the device unavailable later
+1 −0
Original line number Diff line number Diff line
@@ -493,6 +493,7 @@ public class BtHelper {
        mScoAudioState = SCO_STATE_INACTIVE;
        broadcastScoConnectionState(AudioManager.SCO_AUDIO_STATE_DISCONNECTED);
        AudioSystem.setParameters("A2dpSuspended=false");
        AudioSystem.setParameters("LeAudioSuspended=false");
        mDeviceBroker.setBluetoothScoOn(false, "resetBluetoothSco");
    }