AudioService: add missing permission checks in Bluetooth related code am: de3a4084b2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15600804 Change-Id: I8557e00ccff2cf71823064232c7f45704eb811a4
This commit is contained in:
@@ -5294,6 +5294,10 @@ public class AudioService extends IAudioService.Stub
|
|||||||
// TODO investigate internal users due to deprecation of SDK API
|
// TODO investigate internal users due to deprecation of SDK API
|
||||||
/** @see AudioManager#setBluetoothA2dpOn(boolean) */
|
/** @see AudioManager#setBluetoothA2dpOn(boolean) */
|
||||||
public void setBluetoothA2dpOn(boolean on) {
|
public void setBluetoothA2dpOn(boolean on) {
|
||||||
|
if (!checkAudioSettingsPermission("setBluetoothA2dpOn()")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// for logging only
|
// for logging only
|
||||||
final int uid = Binder.getCallingUid();
|
final int uid = Binder.getCallingUid();
|
||||||
final int pid = Binder.getCallingPid();
|
final int pid = Binder.getCallingPid();
|
||||||
@@ -5319,6 +5323,10 @@ public class AudioService extends IAudioService.Stub
|
|||||||
|
|
||||||
/** @see AudioManager#startBluetoothSco() */
|
/** @see AudioManager#startBluetoothSco() */
|
||||||
public void startBluetoothSco(IBinder cb, int targetSdkVersion) {
|
public void startBluetoothSco(IBinder cb, int targetSdkVersion) {
|
||||||
|
if (!checkAudioSettingsPermission("startBluetoothSco()")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final int uid = Binder.getCallingUid();
|
final int uid = Binder.getCallingUid();
|
||||||
final int pid = Binder.getCallingPid();
|
final int pid = Binder.getCallingPid();
|
||||||
final int scoAudioMode =
|
final int scoAudioMode =
|
||||||
@@ -5341,6 +5349,10 @@ public class AudioService extends IAudioService.Stub
|
|||||||
|
|
||||||
/** @see AudioManager#startBluetoothScoVirtualCall() */
|
/** @see AudioManager#startBluetoothScoVirtualCall() */
|
||||||
public void startBluetoothScoVirtualCall(IBinder cb) {
|
public void startBluetoothScoVirtualCall(IBinder cb) {
|
||||||
|
if (!checkAudioSettingsPermission("startBluetoothScoVirtualCall()")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final int uid = Binder.getCallingUid();
|
final int uid = Binder.getCallingUid();
|
||||||
final int pid = Binder.getCallingPid();
|
final int pid = Binder.getCallingPid();
|
||||||
final String eventSource = new StringBuilder("startBluetoothScoVirtualCall()")
|
final String eventSource = new StringBuilder("startBluetoothScoVirtualCall()")
|
||||||
|
|||||||
Reference in New Issue
Block a user