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

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

Merge "TEMP: trust recognition service providers" into sc-dev am: 399a00ff

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

Change-Id: I683bbe037ad4f79f9d3f94b062068d2b2f9c2504
parents 0a9aca9d 399a00ff
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -3065,6 +3065,13 @@ public class AppOpsService extends IAppOpsService.Stub {
                shouldCollectAsyncNotedOp, message, shouldCollectMessage, skipProxyOperation);
    }

    // TODO b/184963112: remove once full blaming is implemented
    private boolean isRecognitionServiceTemp(int code, String packageName) {
        return code == OP_RECORD_AUDIO
                && (packageName.equals("com.google.android.googlequicksearchbox")
                || packageName.equals("com.google.android.tts"));
    }

    private SyncNotedAppOp noteProxyOperationImpl(int code, AttributionSource attributionSource,
            boolean shouldCollectAsyncNotedOp, String message, boolean shouldCollectMessage,
            boolean skipProxyOperation) {
@@ -3092,7 +3099,8 @@ public class AppOpsService extends IAppOpsService.Stub {
        final boolean isSelfBlame = Binder.getCallingUid() == proxiedUid;
        final boolean isProxyTrusted = mContext.checkPermission(
                Manifest.permission.UPDATE_APP_OPS_STATS, -1, proxyUid)
                == PackageManager.PERMISSION_GRANTED || isSelfBlame;
                == PackageManager.PERMISSION_GRANTED || isSelfBlame
                || isRecognitionServiceTemp(code, proxyPackageName);

        if (!skipProxyOperation) {
            final int proxyFlags = isProxyTrusted ? AppOpsManager.OP_FLAG_TRUSTED_PROXY