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

Commit 8cf4e3f4 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/32897336',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/32897336', 'googleplex-android-review.googlesource.com/32927430'] into 25Q2-release.

Change-Id: I26aa46234f8f00dc448cf152941cc33ce2ea7394
parents e863e86f 61d84da9
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -443,23 +443,23 @@ public class AudioRoute {
        }

        int result = BluetoothStatusCodes.SUCCESS;
        if (pendingAudioRoute.getCommunicationDeviceType() == TYPE_BLUETOOTH_SCO
                && !mIsScoManagedByAudio) {
        boolean shouldDisconnectSco = !mIsScoManagedByAudio
                && pendingAudioRoute.getCommunicationDeviceType() == TYPE_BLUETOOTH_SCO;
        if (shouldDisconnectSco) {
            Log.i(this, "Disconnecting SCO device via BluetoothHeadset.");
            result = bluetoothRouteManager.getDeviceManager().disconnectSco();
        } else {
        }
        // Only clear communication device if the destination route will be inactive; route to
        // route transitions do not require clearing the communication device.
        boolean onlyClearCommunicationDeviceOnInactive =
                pendingAudioRoute.getFeatureFlags().onlyClearCommunicationDeviceOnInactive();
            if (!onlyClearCommunicationDeviceOnInactive
                    || (onlyClearCommunicationDeviceOnInactive && !pendingAudioRoute.isActive())) {
        if ((!onlyClearCommunicationDeviceOnInactive && !shouldDisconnectSco)
                || !pendingAudioRoute.isActive()) {
            Log.i(this,
                    "clearCommunicationDevice: AudioManager#clearCommunicationDevice, type=%s",
                    DEVICE_TYPE_STRINGS.get(pendingAudioRoute.getCommunicationDeviceType()));
            audioManager.clearCommunicationDevice();
        }
        }

        if (result == BluetoothStatusCodes.SUCCESS) {
            if (pendingAudioRoute.getFeatureFlags().resolveActiveBtRoutingAndBtTimingIssue()) {
+2 −1
Original line number Diff line number Diff line
@@ -587,7 +587,8 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {
        // It's possible that there are multiple HFP devices connected and if we receive SCO audio
        // connected for the destination route's BT device, then we shouldn't disconnect SCO when
        // clearing the communication device for the original route if it was also a HFP device.
        boolean isScoDeviceAlreadyConnected = mScoAudioConnectedDevice != null
        // This does not apply to the route deactivation scenario.
        boolean isScoDeviceAlreadyConnected = mScoAudioConnectedDevice != null && isDestRouteActive
                && Objects.equals(mScoAudioConnectedDevice, mBluetoothRoutes.get(destRoute));
        if (mIsPending) {
            if (destRoute.equals(mPendingAudioRoute.getDestRoute())