diff options
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/content/pm/ApplicationInfo.java | 24 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageParser.java | 6 | ||||
-rw-r--r-- | core/java/android/os/Process.java | 3 |
3 files changed, 25 insertions, 8 deletions
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java index 6591313..123d9b7 100644 --- a/core/java/android/content/pm/ApplicationInfo.java +++ b/core/java/android/content/pm/ApplicationInfo.java @@ -178,12 +178,20 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13; /** + * Value for {@link #flags}: set to true if this application would like to + * request the VM to operate under the safe mode. Comes from + * {@link android.R.styleable#AndroidManifestApplication_safeMode + * android:safeMode} of the <application> tag. + */ + public static final int FLAG_VM_SAFE_MODE = 1<<14; + + /** * Value for {@link #flags}: this is false if the application has set * its android:allowBackup to false, true otherwise. * * {@hide} */ - public static final int FLAG_ALLOW_BACKUP = 1<<14; + public static final int FLAG_ALLOW_BACKUP = 1<<15; /** * Value for {@link #flags}: this is false if the application has set @@ -194,7 +202,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * {@hide} */ - public static final int FLAG_KILL_AFTER_RESTORE = 1<<15; + public static final int FLAG_KILL_AFTER_RESTORE = 1<<16; /** * Value for {@link #flags}: this is true if the application has set @@ -205,7 +213,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * {@hide} */ - public static final int FLAG_RESTORE_NEEDS_APPLICATION = 1<<16; + public static final int FLAG_RESTORE_NEEDS_APPLICATION = 1<<17; /** * Value for {@link #flags}: this is true if the application has set @@ -215,7 +223,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * {@hide} */ - public static final int FLAG_NEVER_ENCRYPT = 1<<17; + public static final int FLAG_NEVER_ENCRYPT = 1<<18; /** * Value for {@link #flags}: Set to true if the application has been @@ -223,7 +231,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * {@hide} */ - public static final int FLAG_FORWARD_LOCK = 1<<18; + public static final int FLAG_FORWARD_LOCK = 1<<19; /** * Value for {@link #flags}: Set to true if the application is @@ -231,7 +239,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * {@hide} */ - public static final int FLAG_ON_SDCARD = 1<<19; + public static final int FLAG_ON_SDCARD = 1<<20; /** * Value for {@link #flags}: Set to true if the application is @@ -239,7 +247,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * * {@hide} */ - public static final int FLAG_NATIVE_DEBUGGABLE = 1<<20; + public static final int FLAG_NATIVE_DEBUGGABLE = 1<<21; /** * Flags associated with the application. Any combination of @@ -250,7 +258,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable { * {@link #FLAG_TEST_ONLY}, {@link #FLAG_SUPPORTS_SMALL_SCREENS}, * {@link #FLAG_SUPPORTS_NORMAL_SCREENS}, * {@link #FLAG_SUPPORTS_LARGE_SCREENS}, {@link #FLAG_RESIZEABLE_FOR_SCREENS}, - * {@link #FLAG_SUPPORTS_SCREEN_DENSITIES} + * {@link #FLAG_SUPPORTS_SCREEN_DENSITIES}, {@link #FLAG_VM_SAFE_MODE} */ public int flags = 0; diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 0a6195f..d97b3dd 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -1429,6 +1429,12 @@ public class PackageParser { } if (sa.getBoolean( + com.android.internal.R.styleable.AndroidManifestApplication_safeMode, + false)) { + ai.flags |= ApplicationInfo.FLAG_VM_SAFE_MODE; + } + + if (sa.getBoolean( com.android.internal.R.styleable.AndroidManifestApplication_hasCode, true)) { ai.flags |= ApplicationInfo.FLAG_HAS_CODE; diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java index 699ddb2..4887783 100644 --- a/core/java/android/os/Process.java +++ b/core/java/android/os/Process.java @@ -504,6 +504,9 @@ public class Process { argsForZygote.add("--runtime-init"); argsForZygote.add("--setuid=" + uid); argsForZygote.add("--setgid=" + gid); + if ((debugFlags & Zygote.DEBUG_ENABLE_SAFEMODE) != 0) { + argsForZygote.add("--enable-safemode"); + } if ((debugFlags & Zygote.DEBUG_ENABLE_DEBUGGER) != 0) { argsForZygote.add("--enable-debugger"); } |