• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

修訂4e6b2dc276c07189d36d122e9b3a7369f094335b (tree)
時間2020-04-29 04:41:29
作者Eugene Susla <eugenesusla@goog...>
CommiterAnis Assi

Log Message

RESTRICT AUTOMERGE
Prevent accessing companion records from arbitrary uids

Test: manual
Fixes: 129476618
Change-Id: I7b18cfcdf58e62a445cbb508116c6ce7c1cea8d7
(cherry picked from commit 84cccfe6cdbc57ee372ee1a0fea64c7a11c53766)

Change Summary

差異

--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -3116,6 +3116,11 @@
31163116 <permission android:name="android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS"
31173117 android:protectionLevel="signature|privileged" />
31183118
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+
31193124 <!-- @SystemApi Allows an application to use SurfaceFlinger's low level features.
31203125 <p>Not for use by third-party applications.
31213126 @hide
--- a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
+++ b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
@@ -629,6 +629,11 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
629629 + "associate USER_ID PACKAGE MAC_ADDRESS\n"
630630 + "disassociate USER_ID PACKAGE MAC_ADDRESS";
631631
632+ ShellCmd() {
633+ getContext().enforceCallingOrSelfPermission(
634+ android.Manifest.permission.MANAGE_COMPANION_DEVICES, "ShellCmd");
635+ }
636+
632637 @Override
633638 public int onCommand(String cmd) {
634639 switch (cmd) {