diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-18 19:35:32 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-06-18 19:35:32 -0700 |
commit | 8dbbe3b52f815c49be986814743a521f802b4785 (patch) | |
tree | 78ed9bc346ec5f1edfe702dbb74ea16e7b6b99af /core | |
parent | f923ed6ff76a0fd022bcc83e748e82266ba4ed1b (diff) | |
parent | 63e7155c7d1d0c3f0027400aa09e9a45f648a80d (diff) | |
download | frameworks_base-8dbbe3b52f815c49be986814743a521f802b4785.zip frameworks_base-8dbbe3b52f815c49be986814743a521f802b4785.tar.gz frameworks_base-8dbbe3b52f815c49be986814743a521f802b4785.tar.bz2 |
am 63e7155c: Merge change 4696 into donut
Merge commit '63e7155c7d1d0c3f0027400aa09e9a45f648a80d'
* commit '63e7155c7d1d0c3f0027400aa09e9a45f648a80d':
Fix targetSdkVersion, make resize mode a flag, delayed dexopt, easy ApplicationInfo.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/ActivityThread.java | 6 | ||||
-rw-r--r-- | core/java/android/app/ApplicationContext.java | 8 | ||||
-rw-r--r-- | core/java/android/content/Context.java | 4 | ||||
-rw-r--r-- | core/java/android/content/ContextWrapper.java | 6 | ||||
-rw-r--r-- | core/java/android/content/pm/ApplicationInfo.java | 19 | ||||
-rw-r--r-- | core/java/android/content/pm/IPackageManager.aidl | 7 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageManager.java | 6 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageParser.java | 50 | ||||
-rw-r--r-- | core/java/android/content/res/CompatibilityInfo.java | 3 |
9 files changed, 72 insertions, 37 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 477badb..6873379 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -187,7 +187,7 @@ public final class ActivityThread { try { appInfo = getPackageManager().getApplicationInfo( pkgInfo.getPackageName(), - PackageManager.GET_SUPPORTS_DENSITIES | PackageManager.GET_EXPANDABLE); + PackageManager.GET_SUPPORTS_DENSITIES); } catch (RemoteException e) { throw new AssertionError(e); } @@ -287,6 +287,10 @@ public final class ActivityThread { return mPackageName; } + public ApplicationInfo getApplicationInfo() { + return mApplicationInfo; + } + public boolean isSecurityViolation() { return mSecurityViolation; } diff --git a/core/java/android/app/ApplicationContext.java b/core/java/android/app/ApplicationContext.java index d08be86..3ed2893 100644 --- a/core/java/android/app/ApplicationContext.java +++ b/core/java/android/app/ApplicationContext.java @@ -286,6 +286,14 @@ class ApplicationContext extends Context { } @Override + public ApplicationInfo getApplicationInfo() { + if (mPackageInfo != null) { + return mPackageInfo.getApplicationInfo(); + } + throw new RuntimeException("Not supported in system context"); + } + + @Override public String getPackageResourcePath() { if (mPackageInfo != null) { return mPackageInfo.getResDir(); diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 4ccbf18..6c8bafc 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -16,6 +16,7 @@ package android.content; +import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.AssetManager; import android.content.res.Resources; @@ -233,6 +234,9 @@ public abstract class Context { /** Return the name of this application's package. */ public abstract String getPackageName(); + /** Return the full application info for this context's package. */ + public abstract ApplicationInfo getApplicationInfo(); + /** * {@hide} * Return the full path to this context's resource files. This is the ZIP files diff --git a/core/java/android/content/ContextWrapper.java b/core/java/android/content/ContextWrapper.java index 262204e..7513b3b 100644 --- a/core/java/android/content/ContextWrapper.java +++ b/core/java/android/content/ContextWrapper.java @@ -16,6 +16,7 @@ package android.content; +import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.AssetManager; import android.content.res.Resources; @@ -120,6 +121,11 @@ public class ContextWrapper extends Context { } @Override + public ApplicationInfo getApplicationInfo() { + return mBase.getApplicationInfo(); + } + + @Override public String getPackageResourcePath() { return mBase.getPackageResourcePath(); } diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index f10dd53..2a2cf93 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -137,6 +137,13 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { public static final int FLAG_TEST_ONLY = 1<<8; /** + * Value for {@link #flags}: true when the application's window can be + * expanded over default window size in target density (320x480 for + * 1.0 density, 480x720 for 1.5 density etc) + */ + public static final int FLAG_SUPPORTS_LARGE_SCREENS = 1<<9; + + /** * Value for {@link #flags}: this is false if the application has set * its android:allowBackup to false, true otherwise. * @@ -201,12 +208,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { public int[] supportsDensities; /** - * True when the application's window can be expanded over default window - * size in target density (320x480 for 1.0 density, 480x720 for 1.5 density etc) - */ - public boolean expandable = false; - - /** * The minimum SDK version this application targets. It may run on earilier * versions, but it knows how to work with any new behavior added at this * version. Will be {@link android.os.Build.VERSION_CODES#CUR_DEVELOPMENT} @@ -240,7 +241,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { pw.println(prefix + "manageSpaceActivityName="+manageSpaceActivityName); pw.println(prefix + "description=0x"+Integer.toHexString(descriptionRes)); pw.println(prefix + "supportsDensities=" + supportsDensities); - pw.println(prefix + "expandable=" + expandable); super.dumpBack(pw, prefix); } @@ -288,7 +288,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { manageSpaceActivityName = orig.manageSpaceActivityName; descriptionRes = orig.descriptionRes; supportsDensities = orig.supportsDensities; - expandable = orig.expandable; } @@ -321,7 +320,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeString(backupAgentName); dest.writeInt(descriptionRes); dest.writeIntArray(supportsDensities); - dest.writeInt(expandable ? 1 : 0); } public static final Parcelable.Creator<ApplicationInfo> CREATOR @@ -353,7 +351,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { backupAgentName = source.readString(); descriptionRes = source.readInt(); supportsDensities = source.createIntArray(); - expandable = source.readInt() != 0; } /** @@ -383,7 +380,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * @hide */ public void disableCompatibilityMode() { - expandable = true; + flags |= FLAG_SUPPORTS_LARGE_SCREENS; supportsDensities = ANY_DENSITIES_ARRAY; } } diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl index e90dae6..b6fc078 100644 --- a/core/java/android/content/pm/IPackageManager.aidl +++ b/core/java/android/content/pm/IPackageManager.aidl @@ -302,4 +302,11 @@ interface IPackageManager { boolean isSafeMode(); void systemReady(); boolean hasSystemUidErrors(); + + /** + * Ask the package manager to perform dex-opt (if needed) on the given + * package, if it already hasn't done mode. Only does this if running + * in the special development "no pre-dexopt" mode. + */ + boolean performDexOpt(String packageName); } diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 116b3d4..81e2112 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -181,12 +181,6 @@ public abstract class PackageManager { public static final int MATCH_DEFAULT_ONLY = 0x00010000; /** - * {@link ApplicationInfo} flag: return the - * {link ApplicationInfo#expandable} boolean flag of the package. - */ - public static final int GET_EXPANDABLE = 0x00020000; - - /** * Permission check result: this is returned by {@link #checkPermission} * if the permission has been granted to the given package. */ diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index ab8559c..ab9518e 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -777,7 +777,7 @@ public class PackageParser { targetCode = minCode = val.string.toString(); } else { // If it's not a string, it's an integer. - minVers = val.data; + targetVers = minVers = val.data; } } @@ -798,6 +798,25 @@ public class PackageParser { sa.recycle(); + if (minCode != null) { + if (!minCode.equals(mSdkCodename)) { + if (mSdkCodename != null) { + outError[0] = "Requires development platform " + minCode + + " (current platform is " + mSdkCodename + ")"; + } else { + outError[0] = "Requires development platform " + minCode + + " but this is a release platform."; + } + mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK; + return null; + } + } else if (minVers > mSdkVersion) { + outError[0] = "Requires newer sdk version #" + minVers + + " (current version is #" + mSdkVersion + ")"; + mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK; + return null; + } + if (targetCode != null) { if (!targetCode.equals(mSdkCodename)) { if (mSdkCodename != null) { @@ -817,13 +836,6 @@ public class PackageParser { pkg.applicationInfo.targetSdkVersion = targetVers; } - if (minVers > mSdkVersion) { - outError[0] = "Requires newer sdk version #" + minVers - + " (current version is #" + mSdkVersion + ")"; - mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK; - return null; - } - if (maxVers < mSdkVersion) { outError[0] = "Requires older sdk version #" + maxVers + " (current version is #" + mSdkVersion + ")"; @@ -865,7 +877,7 @@ public class PackageParser { XmlUtils.skipCurrentTag(parser); } else if (tagName.equals("expandable")) { - pkg.expandable = true; + pkg.applicationInfo.flags |= ApplicationInfo.FLAG_SUPPORTS_LARGE_SCREENS; XmlUtils.skipCurrentTag(parser); } else { Log.w(TAG, "Bad element under <manifest>: " @@ -2262,9 +2274,6 @@ public class PackageParser { public final ArrayList<Integer> supportsDensityList = new ArrayList<Integer>(); public int[] supportsDensities = null; - // If the application's window is expandable. - public boolean expandable; - // If this is a 3rd party app, this is the path of the zip file. public String mPath; @@ -2287,6 +2296,17 @@ public class PackageParser { // preferred up order. public int mPreferredOrder = 0; + // For use by package manager service to keep track of which apps + // have been installed with forward locking. + public boolean mForwardLocked; + + // For use by the package manager to keep track of the path to the + // file an app came from. + public String mScanPath; + + // For use by package manager to keep track of where it has done dexopt. + public boolean mDidDexOpt; + // Additional data supplied by callers. public Object mExtras; @@ -2439,9 +2459,6 @@ public class PackageParser { && p.supportsDensities != null) { return true; } - if ((flags & PackageManager.GET_EXPANDABLE) != 0) { - return true; - } return false; } @@ -2462,9 +2479,6 @@ public class PackageParser { if ((flags & PackageManager.GET_SUPPORTS_DENSITIES) != 0) { ai.supportsDensities = p.supportsDensities; } - if ((flags & PackageManager.GET_EXPANDABLE) != 0) { - ai.expandable = p.expandable; - } return ai; } diff --git a/core/java/android/content/res/CompatibilityInfo.java b/core/java/android/content/res/CompatibilityInfo.java index 836de39..680fef8 100644 --- a/core/java/android/content/res/CompatibilityInfo.java +++ b/core/java/android/content/res/CompatibilityInfo.java @@ -69,7 +69,8 @@ public class CompatibilityInfo { public final boolean mScalingRequired; public CompatibilityInfo(ApplicationInfo appInfo) { - mExpandable = mConfiguredExpandable = appInfo.expandable; + mExpandable = mConfiguredExpandable = + (appInfo.flags & ApplicationInfo.FLAG_SUPPORTS_LARGE_SCREENS) != 0; float packageDensityScale = -1.0f; if (appInfo.supportsDensities != null) { |