mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-12-14 02:14:34 -05:00
d2d0c48a25
no effective change: https://review.lineageos.org/q/topic:%22P_asb_2024-05%22 gains 8 patches: https://review.lineageos.org/q/topic:%22Q_asb_2024-06%22 https://review.lineageos.org/q/topic:%22Q_asb_2024-07%22 Signed-off-by: Tavi <tavi@divested.dev>
32 lines
1.5 KiB
Diff
32 lines
1.5 KiB
Diff
From 4b0cceb626252107c4e532afee62533e166523e5 Mon Sep 17 00:00:00 2001
|
|
From: Yi-an Chen <theianchen@google.com>
|
|
Date: Tue, 20 Feb 2024 04:34:57 +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:2b5d63b64b2b8208ccc4f62eac3d8962f981dbf8)
|
|
Merged-In: I7336f2fc78804f26e4b2a329870ecdea776595d8
|
|
Change-Id: I7336f2fc78804f26e4b2a329870ecdea776595d8
|
|
---
|
|
.../android/server/pm/permission/PermissionManagerService.java | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
|
index 2fcdec7c92d67..ed551795aad58 100644
|
|
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
|
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
|
@@ -1015,6 +1015,7 @@ private void removeDynamicPermission(
|
|
// TODO: switch this back to SecurityException
|
|
Slog.wtf(TAG, "Not allowed to modify non-dynamic permission "
|
|
+ permName);
|
|
+ return;
|
|
}
|
|
mSettings.removePermissionLocked(permName);
|
|
if (callback != null) {
|