Loading core/java/android/content/pm/PackageParser.java +24 −8 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import java.security.spec.EncodedKeySpec; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec; import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; Loading Loading @@ -147,8 +148,7 @@ public class PackageParser { private String[] mSeparateProcesses; private boolean mOnlyCoreApps; private static final int SDK_VERSION = Build.VERSION.SDK_INT; private static final String SDK_CODENAME = "REL".equals(Build.VERSION.CODENAME) ? null : Build.VERSION.CODENAME; private static final String[] SDK_CODENAMES = Build.VERSION.ACTIVE_CODENAMES; private int mParseError = PackageManager.INSTALL_SUCCEEDED; Loading Loading @@ -1200,10 +1200,18 @@ public class PackageParser { sa.recycle(); if (minCode != null) { if (!minCode.equals(SDK_CODENAME)) { if (SDK_CODENAME != null) { boolean allowedCodename = false; for (String codename : SDK_CODENAMES) { if (minCode.equals(codename)) { allowedCodename = true; break; } } if (!allowedCodename) { if (SDK_CODENAMES.length > 0) { outError[0] = "Requires development platform " + minCode + " (current platform is " + SDK_CODENAME + ")"; + " (current platform is any of " + Arrays.toString(SDK_CODENAMES) + ")"; } else { outError[0] = "Requires development platform " + minCode + " but this is a release platform."; Loading @@ -1219,10 +1227,18 @@ public class PackageParser { } if (targetCode != null) { if (!targetCode.equals(SDK_CODENAME)) { if (SDK_CODENAME != null) { boolean allowedCodename = false; for (String codename : SDK_CODENAMES) { if (targetCode.equals(codename)) { allowedCodename = true; break; } } if (!allowedCodename) { if (SDK_CODENAMES.length > 0) { outError[0] = "Requires development platform " + targetCode + " (current platform is " + SDK_CODENAME + ")"; + " (current platform is any of " + Arrays.toString(SDK_CODENAMES) + ")"; } else { outError[0] = "Requires development platform " + targetCode + " but this is a release platform."; Loading core/java/android/os/Build.java +12 −4 Original line number Diff line number Diff line Loading @@ -118,14 +118,22 @@ public class Build { */ public static final String CODENAME = getString("ro.build.version.codename"); private static final String[] ALL_CODENAMES = getString("ro.build.version.all_codenames").split(","); /** * @hide */ public static final String[] ACTIVE_CODENAMES = "REL".equals(ALL_CODENAMES[0]) ? new String[0] : ALL_CODENAMES; /** * The SDK version to use when accessing resources. * Use the current SDK version code. If we are a development build, * also allow the previous SDK version + 1. * Use the current SDK version code. For every active development codename * we are operating under, we bump the assumed resource platform version by 1. * @hide */ public static final int RESOURCES_SDK_INT = SDK_INT + ("REL".equals(CODENAME) ? 0 : 1); public static final int RESOURCES_SDK_INT = SDK_INT + ACTIVE_CODENAMES.length; } /** Loading services/core/java/com/android/server/pm/PackageManagerService.java +0 −2 Original line number Diff line number Diff line Loading @@ -275,8 +275,6 @@ public class PackageManagerService extends IPackageManager.Stub { final PackageHandler mHandler; final int mSdkVersion = Build.VERSION.SDK_INT; final String mSdkCodename = "REL".equals(Build.VERSION.CODENAME) ? null : Build.VERSION.CODENAME; final Context mContext; final boolean mFactoryTest; Loading Loading
core/java/android/content/pm/PackageParser.java +24 −8 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import java.security.spec.EncodedKeySpec; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec; import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; Loading Loading @@ -147,8 +148,7 @@ public class PackageParser { private String[] mSeparateProcesses; private boolean mOnlyCoreApps; private static final int SDK_VERSION = Build.VERSION.SDK_INT; private static final String SDK_CODENAME = "REL".equals(Build.VERSION.CODENAME) ? null : Build.VERSION.CODENAME; private static final String[] SDK_CODENAMES = Build.VERSION.ACTIVE_CODENAMES; private int mParseError = PackageManager.INSTALL_SUCCEEDED; Loading Loading @@ -1200,10 +1200,18 @@ public class PackageParser { sa.recycle(); if (minCode != null) { if (!minCode.equals(SDK_CODENAME)) { if (SDK_CODENAME != null) { boolean allowedCodename = false; for (String codename : SDK_CODENAMES) { if (minCode.equals(codename)) { allowedCodename = true; break; } } if (!allowedCodename) { if (SDK_CODENAMES.length > 0) { outError[0] = "Requires development platform " + minCode + " (current platform is " + SDK_CODENAME + ")"; + " (current platform is any of " + Arrays.toString(SDK_CODENAMES) + ")"; } else { outError[0] = "Requires development platform " + minCode + " but this is a release platform."; Loading @@ -1219,10 +1227,18 @@ public class PackageParser { } if (targetCode != null) { if (!targetCode.equals(SDK_CODENAME)) { if (SDK_CODENAME != null) { boolean allowedCodename = false; for (String codename : SDK_CODENAMES) { if (targetCode.equals(codename)) { allowedCodename = true; break; } } if (!allowedCodename) { if (SDK_CODENAMES.length > 0) { outError[0] = "Requires development platform " + targetCode + " (current platform is " + SDK_CODENAME + ")"; + " (current platform is any of " + Arrays.toString(SDK_CODENAMES) + ")"; } else { outError[0] = "Requires development platform " + targetCode + " but this is a release platform."; Loading
core/java/android/os/Build.java +12 −4 Original line number Diff line number Diff line Loading @@ -118,14 +118,22 @@ public class Build { */ public static final String CODENAME = getString("ro.build.version.codename"); private static final String[] ALL_CODENAMES = getString("ro.build.version.all_codenames").split(","); /** * @hide */ public static final String[] ACTIVE_CODENAMES = "REL".equals(ALL_CODENAMES[0]) ? new String[0] : ALL_CODENAMES; /** * The SDK version to use when accessing resources. * Use the current SDK version code. If we are a development build, * also allow the previous SDK version + 1. * Use the current SDK version code. For every active development codename * we are operating under, we bump the assumed resource platform version by 1. * @hide */ public static final int RESOURCES_SDK_INT = SDK_INT + ("REL".equals(CODENAME) ? 0 : 1); public static final int RESOURCES_SDK_INT = SDK_INT + ACTIVE_CODENAMES.length; } /** Loading
services/core/java/com/android/server/pm/PackageManagerService.java +0 −2 Original line number Diff line number Diff line Loading @@ -275,8 +275,6 @@ public class PackageManagerService extends IPackageManager.Stub { final PackageHandler mHandler; final int mSdkVersion = Build.VERSION.SDK_INT; final String mSdkCodename = "REL".equals(Build.VERSION.CODENAME) ? null : Build.VERSION.CODENAME; final Context mContext; final boolean mFactoryTest; Loading