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

Commit 14d102c6 authored by Santiago Seifert's avatar Santiago Seifert Committed by Android (Google) Code Review
Browse files

Merge "Disable calls to setBluetoothA2dpOn()" into main

parents b9b0e164 fa9d4baf
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -10,6 +10,16 @@ flag {
    bug: "275185436"
}

flag {
    name: "disable_set_bluetooth_ad2p_on_calls"
    namespace: "media_better_together"
    description: "Prevents calls to AudioService.setBluetoothA2dpOn(), known to cause incorrect audio routing to the built-in speakers."
    bug: "294968421"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "enable_audio_input_device_routing_and_volume_control"
    namespace: "media_better_together"
+1 −1
Original line number Diff line number Diff line
@@ -7214,7 +7214,7 @@ public class AudioService extends IAudioService.Stub
        final int pid = Binder.getCallingPid();
        final String eventSource = new StringBuilder("setBluetoothA2dpOn(").append(on)
                .append(") from u/pid:").append(uid).append("/")
                .append(pid).toString();
                .append(pid).append(" src:AudioService.setBtA2dpOn").toString();
        new MediaMetrics.Item(MediaMetrics.Name.AUDIO_DEVICE
                + MediaMetrics.SEPARATOR + "setBluetoothA2dpOn")
+6 −2
Original line number Diff line number Diff line
@@ -302,7 +302,9 @@ public final class MediaRouterService extends IMediaRouterService.Stub

        final long token = Binder.clearCallingIdentity();
        try {
            if (!Flags.disableSetBluetoothAd2pOnCalls()) {
                mAudioService.setBluetoothA2dpOn(on);
            }
        } catch (RemoteException ex) {
            Slog.w(TAG, "RemoteException while calling setBluetoothA2dpOn. on=" + on);
        } finally {
@@ -677,8 +679,10 @@ public final class MediaRouterService extends IMediaRouterService.Stub
                if (DEBUG) {
                    Slog.d(TAG, "restoreBluetoothA2dp(" + a2dpOn + ")");
                }
                if (!Flags.disableSetBluetoothAd2pOnCalls()) {
                    mAudioService.setBluetoothA2dpOn(a2dpOn);
                }
            }
        } catch (RemoteException e) {
            Slog.w(TAG, "RemoteException while calling setBluetoothA2dpOn.");
        }