mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
32 lines
1.5 KiB
Diff
32 lines
1.5 KiB
Diff
|
From 88ea616cf95aff9169daec33a0a3d93a30b15727 Mon Sep 17 00:00:00 2001
|
||
|
From: Yi-an Chen <theianchen@google.com>
|
||
|
Date: Wed, 21 Feb 2024 01:56:22 +0000
|
||
|
Subject: [PATCH] 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:528a87e90ff9354581d54fd37fbe9f95cccbcdb1)
|
||
|
Merged-In: Ie2f43663bc71a06ffadb868d2d0eea5ee78f76e5
|
||
|
Change-Id: Ie2f43663bc71a06ffadb868d2d0eea5ee78f76e5
|
||
|
---
|
||
|
.../server/pm/permission/PermissionManagerServiceImpl.java | 1 +
|
||
|
1 file changed, 1 insertion(+)
|
||
|
|
||
|
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
|
||
|
index 5dc7e23c01e2..1ec3403a9d46 100644
|
||
|
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
|
||
|
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
|
||
|
@@ -681,6 +681,7 @@ public void removePermission(String permName) {
|
||
|
// TODO: switch this back to SecurityException
|
||
|
Slog.wtf(TAG, "Not allowed to modify non-dynamic permission "
|
||
|
+ permName);
|
||
|
+ return;
|
||
|
}
|
||
|
mRegistry.removePermission(permName);
|
||
|
}
|