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

Commit 39c45f18 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Automerger Merge Worker
Browse files

AudioService: add missing permission checks in Bluetooth related code am:...

AudioService: add missing permission checks in Bluetooth related code am: de3a4084 am: a8a304da am: f69b0c03

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15600804

Change-Id: I3abc34082e71ee44dfefe7bc37727e43682b597e
parents c2132a07 f69b0c03
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -5271,6 +5271,10 @@ public class AudioService extends IAudioService.Stub
    // TODO investigate internal users due to deprecation of SDK API
    /** @see AudioManager#setBluetoothA2dpOn(boolean) */
    public void setBluetoothA2dpOn(boolean on) {
        if (!checkAudioSettingsPermission("setBluetoothA2dpOn()")) {
            return;
        }

        // for logging only
        final int uid = Binder.getCallingUid();
        final int pid = Binder.getCallingPid();
@@ -5296,6 +5300,10 @@ public class AudioService extends IAudioService.Stub

    /** @see AudioManager#startBluetoothSco() */
    public void startBluetoothSco(IBinder cb, int targetSdkVersion) {
        if (!checkAudioSettingsPermission("startBluetoothSco()")) {
            return;
        }

        final int uid = Binder.getCallingUid();
        final int pid = Binder.getCallingPid();
        final int scoAudioMode =
@@ -5318,6 +5326,10 @@ public class AudioService extends IAudioService.Stub

    /** @see AudioManager#startBluetoothScoVirtualCall() */
    public void startBluetoothScoVirtualCall(IBinder cb) {
        if (!checkAudioSettingsPermission("startBluetoothScoVirtualCall()")) {
            return;
        }

        final int uid = Binder.getCallingUid();
        final int pid = Binder.getCallingPid();
        final String eventSource = new StringBuilder("startBluetoothScoVirtualCall()")