Merge "Switch over to updated VPN warning strings" into mnc-dev
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 99c4eda..68e8307 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -2994,7 +2994,12 @@
throwIfLockdownEnabled();
synchronized(mVpns) {
- return mVpns.get(userId).prepare(oldPackage, newPackage);
+ Vpn vpn = mVpns.get(userId);
+ if (vpn != null) {
+ return vpn.prepare(oldPackage, newPackage);
+ } else {
+ return false;
+ }
}
}
@@ -3016,7 +3021,10 @@
enforceCrossUserPermission(userId);
synchronized(mVpns) {
- mVpns.get(userId).setPackageAuthorization(packageName, authorized);
+ Vpn vpn = mVpns.get(userId);
+ if (vpn != null) {
+ vpn.setPackageAuthorization(packageName, authorized);
+ }
}
}
@@ -3127,7 +3135,12 @@
public VpnConfig getVpnConfig(int userId) {
enforceCrossUserPermission(userId);
synchronized(mVpns) {
- return mVpns.get(userId).getVpnConfig();
+ Vpn vpn = mVpns.get(userId);
+ if (vpn != null) {
+ return vpn.getVpnConfig();
+ } else {
+ return null;
+ }
}
}