Loading core/java/android/content/pm/ApplicationInfo.java +11 −2 Original line number Diff line number Diff line Loading @@ -297,12 +297,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * the normal application lifecycle. * * <p>Comes from the * {@link android.R.styleable#AndroidManifestApplication_heavyWeight android:heavyWeight} * {@link android.R.styleable#AndroidManifestApplication_cantSaveState android:cantSaveState} * attribute of the <application> tag. * * {@hide} */ public static final int CANT_SAVE_STATE = 1<<27; public static final int FLAG_CANT_SAVE_STATE = 1<<27; /** * Flags associated with the application. Any combination of Loading Loading @@ -381,6 +381,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public boolean enabled = true; /** * For convenient access to package's install location. * @hide */ public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; public void dump(Printer pw, String prefix) { super.dumpFront(pw, prefix); if (className != null) { Loading Loading @@ -457,6 +463,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { uid = orig.uid; targetSdkVersion = orig.targetSdkVersion; enabled = orig.enabled; installLocation = orig.installLocation; manageSpaceActivityName = orig.manageSpaceActivityName; descriptionRes = orig.descriptionRes; } Loading Loading @@ -489,6 +496,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeInt(uid); dest.writeInt(targetSdkVersion); dest.writeInt(enabled ? 1 : 0); dest.writeInt(installLocation); dest.writeString(manageSpaceActivityName); dest.writeString(backupAgentName); dest.writeInt(descriptionRes); Loading Loading @@ -521,6 +529,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { uid = source.readInt(); targetSdkVersion = source.readInt(); enabled = source.readInt() != 0; installLocation = source.readInt(); manageSpaceActivityName = source.readString(); backupAgentName = source.readString(); descriptionRes = source.readInt(); Loading core/java/android/content/pm/PackageParser.java +6 −5 Original line number Diff line number Diff line Loading @@ -787,6 +787,7 @@ public class PackageParser { pkg.installLocation = sa.getInteger( com.android.internal.R.styleable.AndroidManifest_installLocation, PARSE_DEFAULT_INSTALL_LOCATION); pkg.applicationInfo.installLocation = pkg.installLocation; // Resource boolean are -1, so 1 means we don't know the value. int supportsSmallScreens = 1; Loading Loading @@ -1600,7 +1601,7 @@ public class PackageParser { if (sa.getBoolean( com.android.internal.R.styleable.AndroidManifestApplication_cantSaveState, false)) { ai.flags |= ApplicationInfo.CANT_SAVE_STATE; ai.flags |= ApplicationInfo.FLAG_CANT_SAVE_STATE; // A heavy-weight application can not be in a custom process. // We can do direct compare because we intern all strings. Loading Loading @@ -1897,7 +1898,7 @@ public class PackageParser { sa.recycle(); if (receiver && (owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { if (receiver && (owner.applicationInfo.flags&ApplicationInfo.FLAG_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) { Loading Loading @@ -2185,7 +2186,7 @@ public class PackageParser { sa.recycle(); if ((owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { if ((owner.applicationInfo.flags&ApplicationInfo.FLAG_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) { Loading Loading @@ -2425,7 +2426,7 @@ public class PackageParser { sa.recycle(); if ((owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { if ((owner.applicationInfo.flags&ApplicationInfo.FLAG_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) { Loading services/java/com/android/server/am/ActivityStack.java +2 −2 Original line number Diff line number Diff line Loading @@ -515,7 +515,7 @@ public class ActivityStack { r.info, r.icicle, results, newIntents, !andResume, mService.isNextTransitionForward()); if ((app.info.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { if ((app.info.flags&ApplicationInfo.FLAG_CANT_SAVE_STATE) != 0) { // This may be a heavy-weight process! Note that the package // manager will ensure that only activity can run in the main // process of the .apk, which is the only thing that will be Loading Loading @@ -2442,7 +2442,7 @@ public class ActivityStack { final long origId = Binder.clearCallingIdentity(); if (mMainStack && aInfo != null && (aInfo.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { (aInfo.applicationInfo.flags&ApplicationInfo.FLAG_CANT_SAVE_STATE) != 0) { // This may be a heavy-weight process! Check to see if we already // have another, different heavy-weight process running. if (aInfo.processName.equals(aInfo.applicationInfo.packageName)) { Loading Loading
core/java/android/content/pm/ApplicationInfo.java +11 −2 Original line number Diff line number Diff line Loading @@ -297,12 +297,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * the normal application lifecycle. * * <p>Comes from the * {@link android.R.styleable#AndroidManifestApplication_heavyWeight android:heavyWeight} * {@link android.R.styleable#AndroidManifestApplication_cantSaveState android:cantSaveState} * attribute of the <application> tag. * * {@hide} */ public static final int CANT_SAVE_STATE = 1<<27; public static final int FLAG_CANT_SAVE_STATE = 1<<27; /** * Flags associated with the application. Any combination of Loading Loading @@ -381,6 +381,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { */ public boolean enabled = true; /** * For convenient access to package's install location. * @hide */ public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; public void dump(Printer pw, String prefix) { super.dumpFront(pw, prefix); if (className != null) { Loading Loading @@ -457,6 +463,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { uid = orig.uid; targetSdkVersion = orig.targetSdkVersion; enabled = orig.enabled; installLocation = orig.installLocation; manageSpaceActivityName = orig.manageSpaceActivityName; descriptionRes = orig.descriptionRes; } Loading Loading @@ -489,6 +496,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { dest.writeInt(uid); dest.writeInt(targetSdkVersion); dest.writeInt(enabled ? 1 : 0); dest.writeInt(installLocation); dest.writeString(manageSpaceActivityName); dest.writeString(backupAgentName); dest.writeInt(descriptionRes); Loading Loading @@ -521,6 +529,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { uid = source.readInt(); targetSdkVersion = source.readInt(); enabled = source.readInt() != 0; installLocation = source.readInt(); manageSpaceActivityName = source.readString(); backupAgentName = source.readString(); descriptionRes = source.readInt(); Loading
core/java/android/content/pm/PackageParser.java +6 −5 Original line number Diff line number Diff line Loading @@ -787,6 +787,7 @@ public class PackageParser { pkg.installLocation = sa.getInteger( com.android.internal.R.styleable.AndroidManifest_installLocation, PARSE_DEFAULT_INSTALL_LOCATION); pkg.applicationInfo.installLocation = pkg.installLocation; // Resource boolean are -1, so 1 means we don't know the value. int supportsSmallScreens = 1; Loading Loading @@ -1600,7 +1601,7 @@ public class PackageParser { if (sa.getBoolean( com.android.internal.R.styleable.AndroidManifestApplication_cantSaveState, false)) { ai.flags |= ApplicationInfo.CANT_SAVE_STATE; ai.flags |= ApplicationInfo.FLAG_CANT_SAVE_STATE; // A heavy-weight application can not be in a custom process. // We can do direct compare because we intern all strings. Loading Loading @@ -1897,7 +1898,7 @@ public class PackageParser { sa.recycle(); if (receiver && (owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { if (receiver && (owner.applicationInfo.flags&ApplicationInfo.FLAG_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) { Loading Loading @@ -2185,7 +2186,7 @@ public class PackageParser { sa.recycle(); if ((owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { if ((owner.applicationInfo.flags&ApplicationInfo.FLAG_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) { Loading Loading @@ -2425,7 +2426,7 @@ public class PackageParser { sa.recycle(); if ((owner.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { if ((owner.applicationInfo.flags&ApplicationInfo.FLAG_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) { Loading
services/java/com/android/server/am/ActivityStack.java +2 −2 Original line number Diff line number Diff line Loading @@ -515,7 +515,7 @@ public class ActivityStack { r.info, r.icicle, results, newIntents, !andResume, mService.isNextTransitionForward()); if ((app.info.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { if ((app.info.flags&ApplicationInfo.FLAG_CANT_SAVE_STATE) != 0) { // This may be a heavy-weight process! Note that the package // manager will ensure that only activity can run in the main // process of the .apk, which is the only thing that will be Loading Loading @@ -2442,7 +2442,7 @@ public class ActivityStack { final long origId = Binder.clearCallingIdentity(); if (mMainStack && aInfo != null && (aInfo.applicationInfo.flags&ApplicationInfo.CANT_SAVE_STATE) != 0) { (aInfo.applicationInfo.flags&ApplicationInfo.FLAG_CANT_SAVE_STATE) != 0) { // This may be a heavy-weight process! Check to see if we already // have another, different heavy-weight process running. if (aInfo.processName.equals(aInfo.applicationInfo.packageName)) { Loading