OSDN Git Service

Default minSdkVersion to '1'
authorTodd Kennedy <toddke@google.com>
Tue, 28 Jun 2016 17:31:05 +0000 (10:31 -0700)
committerTodd Kennedy <toddke@google.com>
Tue, 28 Jun 2016 17:31:05 +0000 (10:31 -0700)
Exception when targetSdkVersion is a letter API [eg 'N']. While this
is technically not according to the external docs, it's the behaviour
with prior platforms.

Bug: 29817839
Change-Id: I8382909dbe62de7b2ddfb7995ce11d5c2f43372e

core/java/android/content/pm/PackageParser.java

index adf9fe6..4da77f4 100644 (file)
@@ -1871,7 +1871,7 @@ public class PackageParser {
                     sa = res.obtainAttributes(parser,
                             com.android.internal.R.styleable.AndroidManifestUsesSdk);
 
-                    int minVers = 0;
+                    int minVers = 1;
                     String minCode = null;
                     int targetVers = 0;
                     String targetCode = null;
@@ -1898,9 +1898,6 @@ public class PackageParser {
                         } else {
                             // If it's not a string, it's an integer.
                             targetVers = val.data;
-                            if (minVers == 0) {
-                                minVers = targetVers;
-                            }
                         }
                     }