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

Commit 8a66ff81 authored by Pranav Madapurmath's avatar Pranav Madapurmath Committed by Android (Google) Code Review
Browse files

Merge "Resolve baseline call audio routing" into main

parents f2689d49 f46effb7
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -911,7 +911,7 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {
    }

    private void handleSwitchBaselineRoute(boolean includeBluetooth, String btAddressToExclude) {
        routeTo(mIsActive, getBaseRoute(includeBluetooth, btAddressToExclude));
        routeTo(mIsActive, calculateBaselineRoute(includeBluetooth, btAddressToExclude));
    }

    private void handleSpeakerOn() {
@@ -1225,6 +1225,16 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {
        return destRoute;
    }

    private AudioRoute calculateBaselineRoute(boolean includeBluetooth, String btAddressToExclude) {
        AudioRoute destRoute = getPreferredAudioRouteFromDefault(
                includeBluetooth, btAddressToExclude);
        if (destRoute != null && !getCallSupportedRoutes().contains(destRoute)) {
            destRoute = null;
        }
        Log.i(this, "getBaseRoute - audio routing to %s", destRoute);
        return destRoute;
    }

    /**
     * Don't add additional AudioRoute when a hearing aid pair is detected. The devices have
     * separate addresses, so we need to perform explicit handling to ensure we don't