frameworks/base
修訂 | 4e6b2dc276c07189d36d122e9b3a7369f094335b (tree) |
---|---|
時間 | 2020-04-29 04:41:29 |
作者 | Eugene Susla <eugenesusla@goog...> |
Commiter | Anis Assi |
RESTRICT AUTOMERGE
Prevent accessing companion records from arbitrary uids
Test: manual
Fixes: 129476618
Change-Id: I7b18cfcdf58e62a445cbb508116c6ce7c1cea8d7
(cherry picked from commit 84cccfe6cdbc57ee372ee1a0fea64c7a11c53766)
@@ -3116,6 +3116,11 @@ | ||
3116 | 3116 | <permission android:name="android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS" |
3117 | 3117 | android:protectionLevel="signature|privileged" /> |
3118 | 3118 | |
3119 | + <!-- Allows an application to manage the companion devices. | |
3120 | + @hide --> | |
3121 | + <permission android:name="android.permission.MANAGE_COMPANION_DEVICES" | |
3122 | + android:protectionLevel="signature" /> | |
3123 | + | |
3119 | 3124 | <!-- @SystemApi Allows an application to use SurfaceFlinger's low level features. |
3120 | 3125 | <p>Not for use by third-party applications. |
3121 | 3126 | @hide |
@@ -629,6 +629,11 @@ public class CompanionDeviceManagerService extends SystemService implements Bind | ||
629 | 629 | + "associate USER_ID PACKAGE MAC_ADDRESS\n" |
630 | 630 | + "disassociate USER_ID PACKAGE MAC_ADDRESS"; |
631 | 631 | |
632 | + ShellCmd() { | |
633 | + getContext().enforceCallingOrSelfPermission( | |
634 | + android.Manifest.permission.MANAGE_COMPANION_DEVICES, "ShellCmd"); | |
635 | + } | |
636 | + | |
632 | 637 | @Override |
633 | 638 | public int onCommand(String cmd) { |
634 | 639 | switch (cmd) { |