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

Commit 01f50f59 authored by Eric Laurent's avatar Eric Laurent Committed by Android Build Coastguard Worker
Browse files

Revert "AudioService: optimize BT device config change"

This reverts commit 023c69fc.

Reason for revert: 322938249
Bug:322938249
Test: make
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:67e7c84f438197ecc6c8572094dcd11e7aace488)
Merged-In: Ic3ddcfaf29ca79d96ef2e0ff0df180d527ea8dfd
Change-Id: Ic3ddcfaf29ca79d96ef2e0ff0df180d527ea8dfd
parent bad78169
Loading
Loading
Loading
Loading
+19 −21
Original line number Diff line number Diff line
@@ -920,16 +920,15 @@ public class AudioDeviceInventory {
                        di.mDeviceCodecFormat = codec;
                        mConnectedDevices.replace(key, di);
                        codecChange = true;
                    }
                    final int res = mAudioSystem.handleDeviceConfigChange(
                                btInfo.mAudioSystemDevice, address,
                                BtHelper.getName(btDevice), codec);
                            btInfo.mAudioSystemDevice, address, BtHelper.getName(btDevice), codec);
                    if (res != AudioSystem.AUDIO_STATUS_OK) {
                        AudioService.sDeviceLogger.enqueue(new EventLogger.StringEvent(
                                "APM handleDeviceConfigChange failed for A2DP device addr="
                                        + address + " codec="
                                        + AudioSystem.audioFormatToString(codec))
                                .printSlog(EventLogger.Event.ALOGE, TAG));

                        // force A2DP device disconnection in case of error so that AudioService
                        // state is consistent with audio policy manager state
                        setBluetoothActiveDevice(new AudioDeviceBroker.BtDeviceInfo(btInfo,
@@ -942,7 +941,6 @@ public class AudioDeviceInventory {
                                .printSlog(EventLogger.Event.ALOGI, TAG));
                    }
                }
                }
                if (!codecChange) {
                    updateBluetoothPreferredModes_l(btDevice /*connectedDevice*/);
                }