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

Commit f50316cb authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Do not trigger revoke-perm callbacks if no change

Revoking a permission might e.g. kill the the app. If a permission gets
revoked that was never granted there was no change, hence no need to call
the callbacks and also no need to kill the app.

Test: "pm clear" two times in a row. The second one did trigger a kill
before, not anymore.
Bug: 133830856
Change-Id: I357f2d939520ac78ef82ecf4feb7936455950fc4
parent 914de104
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2269,6 +2269,11 @@ public class PermissionManagerService {
            return;
        }

        // Permission is already revoked, no need to do anything.
        if (!permissionsState.hasRuntimePermission(permName, userId)) {
            return;
        }

        if (permissionsState.revokeRuntimePermission(bp, userId) ==
                PERMISSION_OPERATION_FAILURE) {
            return;