Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +24 −6 Original line number Diff line number Diff line Loading @@ -1378,7 +1378,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { // Clear always-on configuration if it wasn't set by the admin. if (adminConfiguredVpnPkg == null) { mInjector.getVpnManager().setAlwaysOnVpnPackageForUser(userId, null, false, null); VpnManager vpnManager = mInjector.getVpnManager(); if (vpnManager != null) { vpnManager.setAlwaysOnVpnPackageForUser(userId, null, false, null); } } // Clear app authorizations to establish VPNs. When DISALLOW_CONFIG_VPN is enforced apps Loading Loading @@ -1789,6 +1792,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { return mContext.getSystemService(ConnectivityManager.class); } @Nullable VpnManager getVpnManager() { return mContext.getSystemService(VpnManager.class); } Loading Loading @@ -7704,7 +7708,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } } // If some package is uninstalled after the check above, it will be ignored by CM. if (!mInjector.getVpnManager().setAlwaysOnVpnPackageForUser( VpnManager vpnManager = mInjector.getVpnManager(); if (vpnManager == null || !mInjector.getVpnManager().setAlwaysOnVpnPackageForUser( userId, vpnPackage, lockdown, lockdownAllowlist)) { throw new UnsupportedOperationException(); } Loading Loading @@ -7753,8 +7759,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); VpnManager vpnManager = mInjector.getVpnManager(); if (vpnManager == null) { return null; } return mInjector.binderWithCleanCallingIdentity( () -> mInjector.getVpnManager().getAlwaysOnVpnPackageForUser(caller.getUserId())); () -> vpnManager.getAlwaysOnVpnPackageForUser(caller.getUserId())); } @Override Loading @@ -7781,8 +7791,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { isDefaultDeviceOwner(caller) || isProfileOwner(caller)); } VpnManager vpnManager = mInjector.getVpnManager(); if (vpnManager == null) { return false; } return mInjector.binderWithCleanCallingIdentity( () -> mInjector.getVpnManager().isVpnLockdownEnabled(caller.getUserId())); () -> vpnManager.isVpnLockdownEnabled(caller.getUserId())); } @Override Loading @@ -7804,8 +7818,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); VpnManager vpnManager = mInjector.getVpnManager(); if (vpnManager == null) { return null; } return mInjector.binderWithCleanCallingIdentity( () -> mInjector.getVpnManager().getVpnLockdownAllowlist(caller.getUserId())); () -> vpnManager.getVpnLockdownAllowlist(caller.getUserId())); } private void forceWipeDeviceNoLock(boolean wipeExtRequested, String reason, boolean wipeEuicc, Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +24 −6 Original line number Diff line number Diff line Loading @@ -1378,7 +1378,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { // Clear always-on configuration if it wasn't set by the admin. if (adminConfiguredVpnPkg == null) { mInjector.getVpnManager().setAlwaysOnVpnPackageForUser(userId, null, false, null); VpnManager vpnManager = mInjector.getVpnManager(); if (vpnManager != null) { vpnManager.setAlwaysOnVpnPackageForUser(userId, null, false, null); } } // Clear app authorizations to establish VPNs. When DISALLOW_CONFIG_VPN is enforced apps Loading Loading @@ -1789,6 +1792,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { return mContext.getSystemService(ConnectivityManager.class); } @Nullable VpnManager getVpnManager() { return mContext.getSystemService(VpnManager.class); } Loading Loading @@ -7704,7 +7708,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } } // If some package is uninstalled after the check above, it will be ignored by CM. if (!mInjector.getVpnManager().setAlwaysOnVpnPackageForUser( VpnManager vpnManager = mInjector.getVpnManager(); if (vpnManager == null || !mInjector.getVpnManager().setAlwaysOnVpnPackageForUser( userId, vpnPackage, lockdown, lockdownAllowlist)) { throw new UnsupportedOperationException(); } Loading Loading @@ -7753,8 +7759,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); VpnManager vpnManager = mInjector.getVpnManager(); if (vpnManager == null) { return null; } return mInjector.binderWithCleanCallingIdentity( () -> mInjector.getVpnManager().getAlwaysOnVpnPackageForUser(caller.getUserId())); () -> vpnManager.getAlwaysOnVpnPackageForUser(caller.getUserId())); } @Override Loading @@ -7781,8 +7791,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { isDefaultDeviceOwner(caller) || isProfileOwner(caller)); } VpnManager vpnManager = mInjector.getVpnManager(); if (vpnManager == null) { return false; } return mInjector.binderWithCleanCallingIdentity( () -> mInjector.getVpnManager().isVpnLockdownEnabled(caller.getUserId())); () -> vpnManager.isVpnLockdownEnabled(caller.getUserId())); } @Override Loading @@ -7804,8 +7818,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); VpnManager vpnManager = mInjector.getVpnManager(); if (vpnManager == null) { return null; } return mInjector.binderWithCleanCallingIdentity( () -> mInjector.getVpnManager().getVpnLockdownAllowlist(caller.getUserId())); () -> vpnManager.getVpnLockdownAllowlist(caller.getUserId())); } private void forceWipeDeviceNoLock(boolean wipeExtRequested, String reason, boolean wipeEuicc,