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

Commit 5754e2a9 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Prevent CommunicationDeviceTracker from use in refactored audio code.

There was a use of the legacy CommunicationDeviceTracker in the new
refactored audio routing code path.  This CL prevents that invocation from
being hit.

Test: Manual test of unfocus scenario
Flag: com.android.server.telecom.flags.dont_use_communication_device_tracker
Fixes: 346472575
Change-Id: I8f1a5c2d216dff9c14397a0e36a2a1cb83f8b3e4
parent 6b2d00fc
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -89,6 +89,17 @@ flag {
  bug: "315865533"
}

# OWNER=tgunn TARGET=24Q3
flag {
  name: "dont_use_communication_device_tracker"
  namespace: "telecom"
  description: "Do not use the communication device tracker with useRefactoredAudioRouteSwitching."
  bug: "346472575"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

# OWNER=pmadapurmath TARGET=24Q3
flag {
  name: "resolve_switching_bt_devices_computation"
+9 −3
Original line number Diff line number Diff line
@@ -334,10 +334,16 @@ public class CallAudioModeStateMachine extends StateMachine {
                    mAudioManager.abandonAudioFocusForCall();
                    // Clear requested communication device after the call ends.
                    if (mFeatureFlags.clearCommunicationDeviceAfterAudioOpsComplete()) {
                        // Oh flags!  If we're using the refactored audio route switching, we should
                        // not be using the communication device tracker; that is exclusively for
                        // the old code path.
                        if (!mFeatureFlags.dontUseCommunicationDeviceTracker()
                                || !mFeatureFlags.useRefactoredAudioRouteSwitching()) {
                            mCommunicationDeviceTracker.clearCommunicationDevice(
                                    mCommunicationDeviceTracker
                                            .getCurrentLocallyRequestedCommunicationDevice());
                        }
                    }
                    return HANDLED;
                default:
                    // The forced focus switch commands are handled by BaseState.