Ensure that SOFT_DENIED doesn't result in a call to finishOp

Bug: 190385491
Test: atest SensorPrivacyMicrophoneTest
Change-Id: Ib739d9fe0d9aae46199f6e7f3c2f4e0f51396b51
This commit is contained in:
Nate Myren
2021-06-08 12:34:21 -07:00
parent 1de80b1d70
commit 9099a0611c

View File

@@ -5495,7 +5495,8 @@ public class PermissionManagerService extends IPermissionManager.Stub {
final int result = checkPermission(mContext, permission, attributionSource, message,
forDataDelivery, startDataDelivery, fromDatasource, attributedOp);
// Finish any started op if some step in the attribution chain failed.
if (startDataDelivery && result != PermissionChecker.PERMISSION_GRANTED) {
if (startDataDelivery && result != PermissionChecker.PERMISSION_GRANTED
&& result != PermissionChecker.PERMISSION_SOFT_DENIED) {
if (attributedOp == AppOpsManager.OP_NONE) {
finishDataDelivery(AppOpsManager.permissionToOpCode(permission),
attributionSource.asState(), fromDatasource);