From 002dfe73e1716fe590554662aeaffb74337263fd Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Fri, 13 Aug 2021 16:03:12 -0700 Subject: [PATCH] Allow SHELL_UID to disable Bluetooth for testing Bug: 189952422 Test: atest VtsHalBluetoothV1_0TargetTest Change-Id: Id45a43b824b2be49fb38686f9582484931024187 Merged-In: Id45a43b824b2be49fb38686f9582484931024187 --- .../core/java/com/android/server/BluetoothManagerService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java index b7c61a0d25cfb..dc7904ddf8ecb 100644 --- a/services/core/java/com/android/server/BluetoothManagerService.java +++ b/services/core/java/com/android/server/BluetoothManagerService.java @@ -2479,7 +2479,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub { try { foregroundUser = ActivityManager.getCurrentUser(); valid = (callingUser == foregroundUser) || parentUser == foregroundUser - || callingAppId == Process.NFC_UID || callingAppId == mSystemUiUid; + || callingAppId == Process.NFC_UID || callingAppId == mSystemUiUid + || callingAppId == Process.SHELL_UID; if (DBG && !valid) { Slog.d(TAG, "checkIfCallerIsForegroundUser: valid=" + valid + " callingUser=" + callingUser + " parentUser=" + parentUser + " foregroundUser="