2024-06-17 02:18:04 -04:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2024-06-13 15:08:09 -04:00
|
|
|
From: Yi-an Chen <theianchen@google.com>
|
2024-06-16 15:55:36 -04:00
|
|
|
Date: Tue, 20 Feb 2024 04:34:57 +0000
|
2024-06-13 15:08:09 -04:00
|
|
|
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
|
2024-06-16 15:55:36 -04:00
|
|
|
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2b5d63b64b2b8208ccc4f62eac3d8962f981dbf8)
|
|
|
|
Merged-In: I7336f2fc78804f26e4b2a329870ecdea776595d8
|
|
|
|
Change-Id: I7336f2fc78804f26e4b2a329870ecdea776595d8
|
2024-06-13 15:08:09 -04:00
|
|
|
---
|
2024-06-16 15:55:36 -04:00
|
|
|
.../android/server/pm/permission/PermissionManagerService.java | 1 +
|
2024-06-13 15:08:09 -04:00
|
|
|
1 file changed, 1 insertion(+)
|
|
|
|
|
2024-06-16 15:55:36 -04:00
|
|
|
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
2024-06-17 02:18:04 -04:00
|
|
|
index f83c3d5145cc..eb27a13523ba 100644
|
2024-06-16 15:55:36 -04:00
|
|
|
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
|
|
|
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
2024-06-17 02:18:04 -04:00
|
|
|
@@ -645,6 +645,7 @@ public class PermissionManagerService extends IPermissionManager.Stub {
|
2024-06-13 15:08:09 -04:00
|
|
|
// TODO: switch this back to SecurityException
|
|
|
|
Slog.wtf(TAG, "Not allowed to modify non-dynamic permission "
|
|
|
|
+ permName);
|
|
|
|
+ return;
|
|
|
|
}
|
2024-06-16 15:55:36 -04:00
|
|
|
mSettings.removePermissionLocked(permName);
|
|
|
|
mPackageManagerInt.writeSettings(false);
|