Merge "SurfaceTexture.cpp: use proper nativehelper headers" into oc-dev-plus-aosp
diff --git a/Android.mk b/Android.mk
index 8b74585..88a5b66 100644
--- a/Android.mk
+++ b/Android.mk
@@ -965,7 +965,7 @@
-since $(SRC_API_DIR)/23.txt 23 \
-since $(SRC_API_DIR)/24.txt 24 \
-since $(SRC_API_DIR)/25.txt 25 \
- -since ./frameworks/base/api/current.txt O \
+ -since $(SRC_API_DIR)/26.txt 26 \
-werror -hide 111 -hide 113 -hide 121 \
-overview $(LOCAL_PATH)/core/java/overview.html \
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 79a67fe..de0d5d76 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -303,10 +303,12 @@
public static final String DISALLOW_DEBUGGING_FEATURES = "no_debugging_features";
/**
- * Specifies if a user is disallowed from configuring VPN.
- * The default value is <code>false</code>.
- * This restriction has an effect in a managed profile only from
- * {@link android.os.Build.VERSION_CODES#M}
+ * Specifies if a user is disallowed from configuring a VPN. The default value is
+ * <code>false</code>. This restriction has an effect when set by device owners and, in Android
+ * 6.0 ({@linkplain android.os.Build.VERSION_CODES#M API level 23}) or higher, profile owners.
+ * <p>This restriction also prevents VPNs from starting. However, in Android 7.0
+ * ({@linkplain android.os.Build.VERSION_CODES#N API level 24}) or higher, the system does
+ * start always-on VPNs created by the device or profile owner.
*
* <p>Key for user restrictions.
* <p>Type: Boolean
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 41cfc0a..d5f059e 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -4004,10 +4004,15 @@
// reader
synchronized (mPackages) {
final BasePermission p = mSettings.mPermissions.get(name);
+ if (p == null) {
+ return null;
+ }
// If the caller is an app that targets pre 26 SDK drop protection flags.
final PermissionInfo permissionInfo = generatePermissionInfo(p, flags);
- permissionInfo.protectionLevel = adjustPermissionProtectionFlagsLPr(
- permissionInfo.protectionLevel, packageName, callingUid);
+ if (permissionInfo != null) {
+ permissionInfo.protectionLevel = adjustPermissionProtectionFlagsLPr(
+ permissionInfo.protectionLevel, packageName, callingUid);
+ }
return permissionInfo;
}
}