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

Commit e2437647 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "[hotword] make service exemption configurable via sysprop" into udc-dev...

Merge "[hotword] make service exemption configurable via sysprop" into udc-dev am: 4a30c1d2 am: 6b9ddf35 am: 531a6034

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23211877



Change-Id: I603a3bd1b6bc81208c90b19d519b10f998973f67
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 614c1716 531a6034
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.os.Bundle;
import android.os.IBinder;
import android.os.PackageTagsList;
import android.os.Process;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.service.voice.VoiceInteractionManagerInternal;
import android.service.voice.VoiceInteractionManagerInternal.HotwordDetectionServiceIdentity;
@@ -68,6 +69,8 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat
    private static final String ACTIVITY_RECOGNITION_TAGS =
            "android:activity_recognition_allow_listed_tags";
    private static final String ACTIVITY_RECOGNITION_TAGS_SEPARATOR = ";";
    private static final boolean SYSPROP_HOTWORD_DETECTION_SERVICE_REQUIRED =
            SystemProperties.getBoolean("ro.hotword.detection_service_required", false);

    @NonNull
    private final Object mLock = new Object();
@@ -201,8 +204,11 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat

    private static boolean isHotwordDetectionServiceRequired(PackageManager pm) {
        // The HotwordDetectionService APIs aren't ready yet for Auto or TV.
        return !(pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
                || pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK));
        if (pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
                || pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK)) {
            return false;
        }
        return SYSPROP_HOTWORD_DETECTION_SERVICE_REQUIRED;
    }

    @Override