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

Commit 5a953a9d authored by Nate Myren's avatar Nate Myren Committed by Automerger Merge Worker
Browse files

Merge "Allow self blames to be trusted" into rvc-qpr-dev am: 35c4f102

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

Change-Id: Ib39cbf57cdd908e0edaf9a47fc254a4689c727e2
parents debe20ed 35c4f102
Loading
Loading
Loading
Loading
+2 −1
Original line number 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.
        final boolean isTrustVoiceServiceProxy =
                AppOpsManager.isTrustedVoiceServiceProxy(mContext, proxyPackageName, code);
        final boolean isSelfBlame = Binder.getCallingUid() == proxiedUid;
        final boolean isProxyTrusted = mContext.checkPermission(
                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
                : AppOpsManager.OP_FLAG_UNTRUSTED_PROXY;