Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61f814f4 authored by fayey's avatar fayey Committed by Faye Yan
Browse files

Create voice-activation permission

 This permission will be a signature|privileged|appop type. The
 permission status will be pre-grant to privileged assistant apps via allowlist.
 The appop protection flag allows user controls on the access status via flipping the op mode via UI toggle.

 The default op mode value = MODE_DEFAULT. The permission status is
 granted if the app is allowlisted by the OEM. The inital access is
 decided by the permission status.

 When user deny the access, op mode = MODE_IGNORED, access denied.
 When user allow the access, op mode = MODE_ALLOWED, access allowed,
 regardless of permission status.

 Detailed design option seen in https://docs.google.com/document/d/15Rn363JZfe9NCexOWnPYzSkaAo4XqP4JBqCQuj9UyoY/edit?resourcekey=0-EM3T-DFn2ymF7C-1_p-3Ow#bookmark=id.5jfcta6t9r7k

Bug: 289087269
Bug: 287084170
Test: presubmit
Change-Id: Ib30ef2d8813ac5eb74457c6b8f173bffafea52ce
parent 7a740774
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2252,7 +2252,8 @@ public class AppOpsManager {
    public static final String OPSTR_USE_FULL_SCREEN_INTENT = "android:use_full_screen_intent";

    /**
     * Allows the assistant app to receive the PCC-validated hotword and be voice-triggered.
     * Allows the assistant app to be voice-triggered by detected hotwords from a trusted detection
     * service.
     *
     * @hide
     */
@@ -2379,7 +2380,8 @@ public class AppOpsManager {
            OP_RUN_USER_INITIATED_JOBS,
            OP_FOREGROUND_SERVICE_SPECIAL_USE,
            OP_CAPTURE_CONSENTLESS_BUGREPORT_ON_USERDEBUG_BUILD,
            OP_USE_FULL_SCREEN_INTENT
            OP_USE_FULL_SCREEN_INTENT,
            OP_RECEIVE_SANDBOX_TRIGGER_AUDIO
    };

    static final AppOpInfo[] sAppOpInfos = new AppOpInfo[]{
@@ -2810,7 +2812,8 @@ public class AppOpsManager {
        new AppOpInfo.Builder(OP_RECEIVE_SANDBOX_TRIGGER_AUDIO,
                OPSTR_RECEIVE_SANDBOX_TRIGGER_AUDIO,
                "RECEIVE_SANDBOX_TRIGGER_AUDIO")
                .setDefaultMode(AppOpsManager.MODE_ALLOWED).build(),
                .setPermission(Manifest.permission.RECEIVE_SANDBOX_TRIGGER_AUDIO)
                .setDefaultMode(AppOpsManager.MODE_DEFAULT).build(),
        new AppOpInfo.Builder(OP_RECEIVE_TRUSTED_PROCESS_TRAINING_DATA,
                OPSTR_RECEIVE_TRUSTED_PROCESS_TRAINING_DATA,
                "RECEIVE_TRUSTED_PROCESS_TRAINING_DATA").build()
+7 −0
Original line number Diff line number Diff line
@@ -7232,6 +7232,13 @@
                android:description="@string/permdesc_fullScreenIntent"
                android:protectionLevel="normal|appop" />

    <!-- Required for the assistant apps targeting {@link android.os.Build.VERSION_CODES#V}
         that receive voice trigger from the trusted hotword detection service.
         <p>Protection level: signature|privileged|appop
         @hide -->
    <permission android:name="android.permission.RECEIVE_SANDBOX_TRIGGER_AUDIO"
                android:protectionLevel="signature|privileged|appop" />

    <!-- @SystemApi Allows requesting the framework broadcast the
         {@link Intent#ACTION_DEVICE_CUSTOMIZATION_READY} intent.
         @hide -->