2022-10-18 17:13:17 -04:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
|
|
|
|
Date: Fri, 7 Oct 2022 20:12:26 +0300
|
|
|
|
Subject: [PATCH] srt permissions: don't auto-grant denied ones when
|
|
|
|
permissions are reset
|
|
|
|
|
|
|
|
---
|
|
|
|
.../server/pm/permission/PermissionManagerServiceImpl.java | 4 +++-
|
|
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
|
2024-06-13 18:29:22 -04:00
|
|
|
index f4064d1ab984..556443b40c3d 100644
|
2022-10-18 17:13:17 -04:00
|
|
|
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
|
|
|
|
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
|
2024-06-13 18:29:22 -04:00
|
|
|
@@ -1811,7 +1811,9 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt
|
2022-10-18 17:13:17 -04:00
|
|
|
// If this permission was granted by default or role, make sure it is.
|
|
|
|
if ((oldFlags & FLAG_PERMISSION_GRANTED_BY_DEFAULT) != 0
|
|
|
|
|| (oldFlags & FLAG_PERMISSION_GRANTED_BY_ROLE) != 0
|
|
|
|
- || isSpecialRuntimePermission(permName)) {
|
|
|
|
+ || (isSpecialRuntimePermission(permName)
|
|
|
|
+ && checkPermission(packageName, permName, userId) == PERMISSION_GRANTED)
|
|
|
|
+ ) {
|
|
|
|
// PermissionPolicyService will handle the app op for runtime permissions later.
|
|
|
|
grantRuntimePermissionInternal(packageName, permName, false,
|
|
|
|
Process.SYSTEM_UID, userId, delayingPermCallback);
|