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

Commit 0fef575c authored by Faye Yan's avatar Faye Yan Committed by Android (Google) Code Review
Browse files

Merge "Enable the voice_activation_permission_apis flag control, replace the...

Merge "Enable the voice_activation_permission_apis flag control, replace the static boolean control." into main
parents 3b410191 c0ddc95a
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -42,6 +42,7 @@ import android.os.PackageTagsList;
import android.os.Process;
import android.os.Process;
import android.os.SystemProperties;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserHandle;
import android.permission.flags.Flags;
import android.service.voice.VoiceInteractionManagerInternal;
import android.service.voice.VoiceInteractionManagerInternal;
import android.service.voice.VoiceInteractionManagerInternal.HotwordDetectionServiceIdentity;
import android.service.voice.VoiceInteractionManagerInternal.HotwordDetectionServiceIdentity;
import android.text.TextUtils;
import android.text.TextUtils;
@@ -75,9 +76,6 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat
    private static final boolean SYSPROP_HOTWORD_DETECTION_SERVICE_REQUIRED =
    private static final boolean SYSPROP_HOTWORD_DETECTION_SERVICE_REQUIRED =
            SystemProperties.getBoolean("ro.hotword.detection_service_required", false);
            SystemProperties.getBoolean("ro.hotword.detection_service_required", false);


    //TODO(b/289087412): import this from the flag value in set up in device config.
    private static final boolean IS_VOICE_ACTIVATION_OP_ENABLED = false;

    @NonNull
    @NonNull
    private final Object mLock = new Object();
    private final Object mLock = new Object();


@@ -212,7 +210,7 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat
     * @return the op that should be noted for the voice activations of the app by detected hotword.
     * @return the op that should be noted for the voice activations of the app by detected hotword.
     */
     */
    public static int getVoiceActivationOp() {
    public static int getVoiceActivationOp() {
        if (IS_VOICE_ACTIVATION_OP_ENABLED) {
        if (Flags.voiceActivationPermissionApis()) {
            return OP_RECEIVE_SANDBOX_TRIGGER_AUDIO;
            return OP_RECEIVE_SANDBOX_TRIGGER_AUDIO;
        }
        }
        return OP_RECORD_AUDIO_HOTWORD;
        return OP_RECORD_AUDIO_HOTWORD;