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

Commit 57ba37a9 authored by Yi-an Chen's avatar Yi-an Chen Committed by Android Build Coastguard Worker
Browse files

Fix error handling for non-dynamic permissions

We only allow removing dynamic permissions. When removePermission() is
called for a non-dynamic permission, in addition to logging it, we
should also return early to avoid the removePermission() call.

Test: manual
Bug: 321555066
Fixes: 321711213
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2b5d63b64b2b8208ccc4f62eac3d8962f981dbf8)
Merged-In: I7336f2fc78804f26e4b2a329870ecdea776595d8
Change-Id: I7336f2fc78804f26e4b2a329870ecdea776595d8
parent 64e7a391
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -691,6 +691,7 @@ public class PermissionManagerService extends IPermissionManager.Stub {
                // TODO: switch this back to SecurityException
                Slog.wtf(TAG, "Not allowed to modify non-dynamic permission "
                        + permName);
                return;
            }
            mRegistry.removePermission(permName);
        }