mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
0c4db149e1
This revokes the permissions to all user installed apps on update. Likely an expected quirk of being on 20.0 without the permission. 19.1 upgrades and new 20.0 installs should be fine. TODO: update 19.1 with the SpecialRuntimePermAppUtils too Signed-off-by: Tad <tad@spotco.us>
29 lines
1.6 KiB
Diff
29 lines
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
|
|
Date: Thu, 18 Aug 2022 10:04:46 +0300
|
|
Subject: [PATCH] fix DevicePolicyManager#logoutUser() never succeeding
|
|
|
|
To succeed, userId to switch to needs to be set with setLogoutUserIdLocked(), but this is not done
|
|
in both callers of this method (both of which are "End session" buttons), making them no-ops.
|
|
---
|
|
.../server/devicepolicy/DevicePolicyManagerService.java | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
|
index 4be9c1a1d54a..a33f4fa55b53 100644
|
|
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
|
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
|
@@ -11155,6 +11155,12 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
|
Preconditions.checkCallAuthorization(canManageUsers(caller)
|
|
|| hasCallingOrSelfPermission(permission.INTERACT_ACROSS_USERS));
|
|
|
|
+ synchronized (getLockObject()) {
|
|
+ if (getLogoutUserIdUnchecked() == UserHandle.USER_NULL) {
|
|
+ setLogoutUserIdLocked(UserHandle.USER_SYSTEM);
|
|
+ }
|
|
+ }
|
|
+
|
|
int currentUserId = getCurrentForegroundUserId();
|
|
if (VERBOSE_LOG) {
|
|
Slogf.v(LOG_TAG, "logout() called by uid %d; current user is %d", caller.getUid(),
|