From cbaea7da267fc42f92d5e532e5b7f05c4f17e62e Mon Sep 17 00:00:00 2001 From: chiachangwang Date: Tue, 20 Sep 2022 06:57:33 +0000 Subject: [PATCH] Remove the restricted user enforcement in getAppExclusionList This change allows retrieval of the app exclusion list for callers with the SYSTEM_SETTINGS and INTERACT_ACROSS_USERS_FULL permissions, as well as allowing UID updates internally when packages are added/removed. In both cases, the retrieval of this information does not change the configuration of the system in any incorrect way, and not allowing these two use cases results in system components (Package change notifications and settings app) calls failing. Additionally, in restricted users, neither provisioning a VPN profile nor adding app bypass rules are supported, so this codepath is effectively a no-op at the moment. In the long term, if VpnManager VPNs are supported from a DevicePolicyManager standpoint, this correctly updates the restriction list when apps are added/removed. Bug: 247344442 Test: atest FrameworksNetTests Test: atest CtsMediaHostTestCases Change-Id: I9e820f89a274ea9e26e95ce0aaa6807175760186 (cherry picked from commit e5997ffb0da8a195818ef41f7c16f0d0f3716deb) Merged-In: I9e820f89a274ea9e26e95ce0aaa6807175760186 --- services/core/java/com/android/server/connectivity/Vpn.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java index 481c5db559cff..8510de4ef2017 100644 --- a/services/core/java/com/android/server/connectivity/Vpn.java +++ b/services/core/java/com/android/server/connectivity/Vpn.java @@ -4182,8 +4182,6 @@ public class Vpn { */ @NonNull public synchronized List getAppExclusionList(@NonNull String packageName) { - enforceNotRestrictedUser(); - final long oldId = Binder.clearCallingIdentity(); try { final byte[] bytes = getVpnProfileStore().get(getVpnAppExcludedForPackage(packageName));