Add visual query detection service permissions

Add permissions for verifying client app permissions such that
VisualQueryDetectionService cannot be abused.

Bug: 261783492
Test: atest PermissionPolicyTest#platformPermissionPolicyIsUnaltered
Change-Id: I6be5020b7079e3f08a68aacf19bfeae0292428fb
This commit is contained in:
Charles Chen
2023-01-12 02:40:04 +00:00
parent 0bec75ce35
commit 1a5eaaee20
4 changed files with 14 additions and 1 deletions

View File

@@ -78,6 +78,7 @@ package android {
field public static final String BIND_TRANSLATION_SERVICE = "android.permission.BIND_TRANSLATION_SERVICE";
field public static final String BIND_TRUST_AGENT = "android.permission.BIND_TRUST_AGENT";
field public static final String BIND_TV_REMOTE_SERVICE = "android.permission.BIND_TV_REMOTE_SERVICE";
field public static final String BIND_VISUAL_QUERY_DETECTION_SERVICE = "android.permission.BIND_VISUAL_QUERY_DETECTION_SERVICE";
field public static final String BIND_WALLPAPER_EFFECTS_GENERATION_SERVICE = "android.permission.BIND_WALLPAPER_EFFECTS_GENERATION_SERVICE";
field public static final String BIND_WEARABLE_SENSING_SERVICE = "android.permission.BIND_WEARABLE_SENSING_SERVICE";
field public static final String BLUETOOTH_MAP = "android.permission.BLUETOOTH_MAP";

View File

@@ -4372,13 +4372,22 @@
<permission android:name="android.permission.BIND_HOTWORD_DETECTION_SERVICE"
android:protectionLevel="signature" />
<!-- @SystemApi Allows an application to manage hotword detection on the device.
<!-- @SystemApi Allows an application to manage hotword detection and visual query detection
on the device.
<p>Protection level: internal|preinstalled
@hide This is not a third-party API (intended for OEMs and system apps).
-->
<permission android:name="android.permission.MANAGE_HOTWORD_DETECTION"
android:protectionLevel="internal|preinstalled" />
<!-- @SystemApi Must be required by a {@link android.service.voice.VisualQueryDetectionService},
to ensure that only the system can bind to it.
<p>Protection level: signature
@hide This is not a third-party API (intended for OEMs and system apps).
-->
<permission android:name="android.permission.BIND_VISUAL_QUERY_DETECTION_SERVICE"
android:protectionLevel="signature" />
<!-- Allows an application to subscribe to keyguard locked (i.e., showing) state.
<p>Protection level: internal|role
<p>Intended for use by ROLE_ASSISTANT only.

View File

@@ -458,6 +458,7 @@ applications that come with the platform
<!-- Permission required for hotword detection service CTS tests -->
<permission name="android.permission.MANAGE_HOTWORD_DETECTION" />
<permission name="android.permission.BIND_HOTWORD_DETECTION_SERVICE" />
<permission name="android.permission.BIND_VISUAL_QUERY_DETECTION_SERVICE" />
<permission name="android.permission.MANAGE_APP_HIBERNATION"/>
<!-- Permission required for CTS test - ResourceObserverNativeTest -->
<permission name="android.permission.REGISTER_MEDIA_RESOURCE_OBSERVER" />

View File

@@ -624,6 +624,8 @@
<uses-permission android:name="android.permission.MANAGE_HOTWORD_DETECTION" />
<uses-permission android:name="android.permission.BIND_HOTWORD_DETECTION_SERVICE" />
<uses-permission android:name="android.permission.BIND_VISUAL_QUERY_DETECTION_SERVICE" />
<!-- Permission required for CTS test - KeyguardLockedStateApiTest -->
<uses-permission android:name="android.permission.SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE" />