summaryrefslogtreecommitdiffstats
path: root/services/java/com
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-05-08 12:06:44 -0700
committerDianne Hackborn <hackbod@google.com>2009-05-08 15:15:36 -0700
commit851a54143c15a1c33361efae2db3f7f45059b472 (patch)
treec9e6ced5424530ff9a40f5471afb969e15cac35e /services/java/com
parented3b804f2cc61029cf2969cbfa499ea230c22bb0 (diff)
downloadframeworks_base-851a54143c15a1c33361efae2db3f7f45059b472.zip
frameworks_base-851a54143c15a1c33361efae2db3f7f45059b472.tar.gz
frameworks_base-851a54143c15a1c33361efae2db3f7f45059b472.tar.bz2
Implement targetSdkVersion and maxSdkVersion, plus version code names.
This adds new attributes for specifying a targetSdkVersion and maxSdkVersion. There is a new ApplicationInfo flag that is set if the application has set its targetSdkVersion to the current platform or later. Also you can now use a string for minSdkVersion and targetSdkVerion, to indicate you are building against a development tree instead of an official platform.
Diffstat (limited to 'services/java/com')
-rw-r--r--services/java/com/android/server/PackageManagerService.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index a60f059..237b70d 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -59,6 +59,7 @@ import android.content.pm.ServiceInfo;
import android.content.pm.Signature;
import android.net.Uri;
import android.os.Binder;
+import android.os.Build;
import android.os.Bundle;
import android.os.HandlerThread;
import android.os.Parcel;
@@ -140,8 +141,9 @@ class PackageManagerService extends IPackageManager.Stub {
Process.THREAD_PRIORITY_BACKGROUND);
final Handler mHandler;
- final int mSdkVersion = SystemProperties.getInt(
- "ro.build.version.sdk", 0);
+ 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;
@@ -1751,7 +1753,7 @@ class PackageManagerService extends IPackageManager.Stub {
parseFlags |= mDefParseFlags;
PackageParser pp = new PackageParser(scanFile.getPath());
pp.setSeparateProcesses(mSeparateProcesses);
- pp.setSdkVersion(mSdkVersion);
+ pp.setSdkVersion(mSdkVersion, mSdkCodename);
final PackageParser.Package pkg = pp.parsePackage(scanFile,
destCodeFile.getAbsolutePath(), mMetrics, parseFlags);
if (pkg == null) {
@@ -3693,7 +3695,7 @@ class PackageManagerService extends IPackageManager.Stub {
parseFlags |= mDefParseFlags;
PackageParser pp = new PackageParser(tmpPackageFile.getPath());
pp.setSeparateProcesses(mSeparateProcesses);
- pp.setSdkVersion(mSdkVersion);
+ pp.setSdkVersion(mSdkVersion, mSdkCodename);
final PackageParser.Package pkg = pp.parsePackage(tmpPackageFile,
destPackageFile.getAbsolutePath(), mMetrics, parseFlags);
if (pkg == null) {