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

Commit c0bca399 authored by Atneya Nair's avatar Atneya Nair
Browse files

appop: Finish all when last in chain fail

When starting an op for an attribution chain, if a later attr in the
chain fails to start, we should finish the already started ops to avoid
a split in the op state in the chain.

Test: Manual with mic indicator and recording
Test: CtsMediaAudioRecordPermissionTests
Test: CtsSensorPrivacyTestCases
Fixes: 363915467
Bug: 293603271
Flag: EXEMPT security
Change-Id: I92060d44e666fa6725411de5d714ac0d380f42ae
parent f541967d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1015,8 +1015,7 @@ public class PermissionManagerService extends IPermissionManager.Stub {
                    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
                    && result != PermissionChecker.PERMISSION_SOFT_DENIED) {
            if (startDataDelivery && result != PermissionChecker.PERMISSION_GRANTED) {
                if (attributedOp == AppOpsManager.OP_NONE) {
                    finishDataDelivery(AppOpsManager.permissionToOpCode(permission),
                            attributionSource.asState(), fromDatasource);