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

Commit 90c76dd5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Check for device type match when changing audio device info in route." into main

parents 189e840a b9aa081c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -151,3 +151,14 @@ flag {
    purpose: PURPOSE_BUGFIX
  }
}

# OWNER=tgunn TARGET=25Q2
flag {
  name: "check_device_type_on_route_change"
  namespace: "telecom"
  description: "When comparing devices on route change, also consider device type."
  bug: "388509460"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+10 −1
Original line number Diff line number Diff line
@@ -291,8 +291,17 @@ public class AudioRoute {
            for (AudioDeviceInfo deviceInfo : devices) {
                // It's possible for the AudioDeviceInfo to be updated for the BT device so adjust
                // mInfo accordingly.
                // Note: we need to check the device type as well since a dual mode (LE and HFP) BT
                // device can change type during a call if the user toggles LE for the device.
                boolean isSameDeviceType =
                        !pendingAudioRoute.getFeatureFlags().checkDeviceTypeOnRouteChange() ||
                                (pendingAudioRoute.getFeatureFlags().checkDeviceTypeOnRouteChange()
                                        && mAudioRouteType
                                        == DEVICE_INFO_TYPE_TO_AUDIO_ROUTE_TYPE.get(
                                        deviceInfo.getType()));
                if (BT_AUDIO_ROUTE_TYPES.contains(mAudioRouteType) && mBluetoothAddress
                        .equals(deviceInfo.getAddress())) {
                        .equals(deviceInfo.getAddress())
                        && isSameDeviceType) {
                    mInfo = deviceInfo;
                }
                if (deviceInfo.equals(mInfo)) {