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

Commit 136f736e authored by ESWAR MAGATAPALLI (xWF)'s avatar ESWAR MAGATAPALLI (xWF) Committed by Android (Google) Code Review
Browse files

Revert "[audio] Avoid startOp when restrictions in place"

This reverts commit 4b555e86.

Reason for revert: Droidmonitor created revert due to b/400836974. Will be verifying through ABTD before submission.

Change-Id: If722040a54cca085b892744fd40fae24826321b0
parent 4b555e86
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -172,20 +172,9 @@ static int checkRecordingInternal(const AttributionSourceState &attributionSourc
        permission::PermissionChecker permissionChecker;
        int permitted;
        if (start) {
            // Do a double-check, where we first check without actually starting in order to handle
            // the behavior of AppOps where ops are sometimes started but paused for SOFT_DENIED.
            // Since there is no way to maintain reference consensus due to this behavior, avoid
            // starting an op when a restriction is in place by first checking. Technically racy,
            // but very unlikely.
            // TODO(b/294609684) To be removed when the pause state for an OP is removed.
            permitted = permissionChecker.checkPermissionForPreflightFromDatasource(
                    sAndroidPermissionRecordAudio, resolvedAttributionSource.value(), msg,
                    attributedOpCode);
            if (permitted == PERMISSION_GRANTED) {
            permitted = permissionChecker.checkPermissionForStartDataDeliveryFromDatasource(
                    sAndroidPermissionRecordAudio, resolvedAttributionSource.value(), msg,
                    attributedOpCode);
            }
        } else {
            permitted = permissionChecker.checkPermissionForPreflightFromDatasource(
                    sAndroidPermissionRecordAudio, resolvedAttributionSource.value(), msg,