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

Commit 35c4f102 authored by Nate Myren's avatar Nate Myren Committed by Android (Google) Code Review
Browse files

Merge "Allow self blames to be trusted" into rvc-qpr-dev

parents df28f95e 5ddb7fa4
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2993,9 +2993,10 @@ public class AppOpsService extends IAppOpsService.Stub {
        // voice recognizer is also the voice interactor to noteproxy op.
        // voice recognizer is also the voice interactor to noteproxy op.
        final boolean isTrustVoiceServiceProxy =
        final boolean isTrustVoiceServiceProxy =
                AppOpsManager.isTrustedVoiceServiceProxy(mContext, proxyPackageName, code);
                AppOpsManager.isTrustedVoiceServiceProxy(mContext, proxyPackageName, code);
        final boolean isSelfBlame = Binder.getCallingUid() == proxiedUid;
        final boolean isProxyTrusted = mContext.checkPermission(
        final boolean isProxyTrusted = mContext.checkPermission(
                Manifest.permission.UPDATE_APP_OPS_STATS, -1, proxyUid)
                Manifest.permission.UPDATE_APP_OPS_STATS, -1, proxyUid)
                == PackageManager.PERMISSION_GRANTED || isTrustVoiceServiceProxy;
                == PackageManager.PERMISSION_GRANTED || isTrustVoiceServiceProxy || isSelfBlame;


        final int proxyFlags = isProxyTrusted ? AppOpsManager.OP_FLAG_TRUSTED_PROXY
        final int proxyFlags = isProxyTrusted ? AppOpsManager.OP_FLAG_TRUSTED_PROXY
                : AppOpsManager.OP_FLAG_UNTRUSTED_PROXY;
                : AppOpsManager.OP_FLAG_UNTRUSTED_PROXY;