summaryrefslogtreecommitdiff
path: root/service/java/com/android/server/bluetooth/BluetoothManagerService.java
diff options
context:
space:
mode:
Diffstat (limited to 'service/java/com/android/server/bluetooth/BluetoothManagerService.java')
-rw-r--r--service/java/com/android/server/bluetooth/BluetoothManagerService.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/service/java/com/android/server/bluetooth/BluetoothManagerService.java b/service/java/com/android/server/bluetooth/BluetoothManagerService.java
index 5e066b996a..73c35895a3 100644
--- a/service/java/com/android/server/bluetooth/BluetoothManagerService.java
+++ b/service/java/com/android/server/bluetooth/BluetoothManagerService.java
@@ -69,6 +69,7 @@ import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
+import android.os.ParcelFileDescriptor;
import android.os.PowerExemptionManager;
import android.os.Process;
import android.os.RemoteCallbackList;
@@ -1025,7 +1026,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
// Check if packageName belongs to callingUid
final int callingUid = Binder.getCallingUid();
final boolean isCallerSystem = UserHandle.getAppId(callingUid) == Process.SYSTEM_UID;
- if (!isCallerSystem) {
+ if (!isCallerSystem && callingUid != Process.SHELL_UID) {
checkPackage(callingUid, attributionSource.getPackageName());
if (requireForeground && !checkIfCallerIsForegroundUser()) {
@@ -3049,6 +3050,14 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
attributionSource, message);
}
+ @Override
+ public int handleShellCommand(@NonNull ParcelFileDescriptor in,
+ @NonNull ParcelFileDescriptor out, @NonNull ParcelFileDescriptor err,
+ @NonNull String[] args) {
+ return new BluetoothShellCommand(this, mContext).exec(this, in.getFileDescriptor(),
+ out.getFileDescriptor(), err.getFileDescriptor(), args);
+ }
+
static @NonNull Bundle getTempAllowlistBroadcastOptions() {
final long duration = 10_000;
final BroadcastOptions bOptions = BroadcastOptions.makeBasic();