OSDN Git Service

RESTRICT AUTOMERGE
[android-x86/frameworks-base.git] / services / companion / java / com / android / server / companion / CompanionDeviceManagerService.java
index f2f01cf..aaa4626 100644 (file)
@@ -624,6 +624,11 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
                 + "associate USER_ID PACKAGE MAC_ADDRESS\n"
                 + "disassociate USER_ID PACKAGE MAC_ADDRESS";
 
+        ShellCmd() {
+            getContext().enforceCallingOrSelfPermission(
+                    android.Manifest.permission.MANAGE_COMPANION_DEVICES, "ShellCmd");
+        }
+
         @Override
         public int onCommand(String cmd) {
             switch (cmd) {