From 02486b1327e3007c62d253dd89ba9db1852b87f8 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 26 Aug 2010 14:18:37 -0700 Subject: [PATCH] Hide heavy-weight API. And give it a better name, for when it is later un-hidden. Change-Id: Iae0d3054d44f873b9f953bc41d175a47802a185e --- api/current.xml | 46 ------------------- core/java/android/app/Activity.java | 2 + .../android/content/pm/ApplicationInfo.java | 24 +++++----- .../android/content/pm/PackageParser.java | 26 ++++++----- core/res/res/values/attrs_manifest.xml | 16 ++++--- core/res/res/values/public.xml | 2 +- .../com/android/server/am/ActivityStack.java | 4 +- 7 files changed, 41 insertions(+), 79 deletions(-) diff --git a/api/current.xml b/api/current.xml index 72487eb952dbb..62ab9484d7eae 100644 --- a/api/current.xml +++ b/api/current.xml @@ -4508,17 +4508,6 @@ visibility="public" > - - - - - - - - - - true if the application - * has reported that it is heavy-weight, and thus can not participate in - * the normal application lifecycle. - * - *

Comes from the - * {@link android.R.styleable#AndroidManifestApplication_heavyWeight android:heavyWeight} - * attribute of the <application> tag. - */ - public static final int FLAG_HEAVY_WEIGHT = 1<<20; - /** * Value for {@link #flags}: this is true if the application has set * its android:neverEncrypt to true, false otherwise. It is used to specify @@ -309,6 +298,19 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public static final int FLAG_NATIVE_DEBUGGABLE = 1<<28; + /** + * Value for {@link #flags}: set to true if the application + * has reported that it is heavy-weight, and thus can not participate in + * the normal application lifecycle. + * + *

Comes from the + * {@link android.R.styleable#AndroidManifestApplication_heavyWeight android:heavyWeight} + * attribute of the <application> tag. + * + * {@hide} + */ + public static final int CANT_SAVE_STATE = 1<<27; + /** * Flags associated with the application. Any combination of * {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE}, diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 47e668d445453..2a39dc002eb68 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -1601,15 +1601,17 @@ public class PackageParser { ai.enabled = sa.getBoolean( com.android.internal.R.styleable.AndroidManifestApplication_enabled, true); - if (sa.getBoolean( - com.android.internal.R.styleable.AndroidManifestApplication_heavyWeight, - false)) { - ai.flags |= ApplicationInfo.FLAG_HEAVY_WEIGHT; - - // A heavy-weight application can not be in a custom process. - // We can do direct compare because we intern all strings. - if (ai.processName != null && ai.processName != ai.packageName) { - outError[0] = "Heavy-weight applications can not use custom processes"; + if (false) { + if (sa.getBoolean( + com.android.internal.R.styleable.AndroidManifestApplication_cantSaveState, + false)) { + ai.flags |= ApplicationInfo.CANT_SAVE_STATE; + + // A heavy-weight application can not be in a custom process. + // We can do direct compare because we intern all strings. + if (ai.processName != null && ai.processName != ai.packageName) { + outError[0] = "cantSaveState applications can not use custom processes"; + } } } } @@ -1907,7 +1909,7 @@ public class PackageParser { sa.recycle(); - if (receiver && (owner.applicationInfo.flags&ApplicationInfo.FLAG_HEAVY_WEIGHT) != 0) { + if (receiver && (owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { // A heavy-weight application can not have receives in its main process // We can do direct compare because we intern all strings. if (a.info.processName == owner.packageName) { @@ -2197,7 +2199,7 @@ public class PackageParser { sa.recycle(); - if ((owner.applicationInfo.flags&ApplicationInfo.FLAG_HEAVY_WEIGHT) != 0) { + if ((owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { // A heavy-weight application can not have providers in its main process // We can do direct compare because we intern all strings. if (p.info.processName == owner.packageName) { @@ -2438,7 +2440,7 @@ public class PackageParser { sa.recycle(); - if ((owner.applicationInfo.flags&ApplicationInfo.FLAG_HEAVY_WEIGHT) != 0) { + if ((owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { // A heavy-weight application can not have services in its main process // We can do direct compare because we intern all strings. if (s.info.processName == owner.packageName) { diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index f18d14e117d5e..fb491201ef994 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -744,15 +744,17 @@ - - + tries to launch a second such app, they will be prompted + to quit the first before doing so. While the + application is running, the user will be informed of this. + @hide --> +