summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/pm
diff options
context:
space:
mode:
authorBen Cheng <bccheng@android.com>2010-02-08 16:06:32 -0800
committerBen Cheng <bccheng@android.com>2010-02-10 14:51:31 -0800
commit23085b781e145ed684e7270af1d5ced6800b8eff (patch)
tree43629e3d545d343314af074dc66e63f628d780ff /core/java/android/content/pm
parent60586f2ec65d16d185767fce4311d3ed0e9112ac (diff)
downloadframeworks_base-23085b781e145ed684e7270af1d5ced6800b8eff.zip
frameworks_base-23085b781e145ed684e7270af1d5ced6800b8eff.tar.gz
frameworks_base-23085b781e145ed684e7270af1d5ced6800b8eff.tar.bz2
Support per-application switch to execute the VM in safe mode.
The new attribute can be set by adding android:safeMode="true" in AndroidManifest.xml with the SDK. Tested with pairing locally compiled SDK with Eclipse and verified that the JIT (the only component currently included in the safe mode) is indeed disabled with the new attribute. Bug: 2267583
Diffstat (limited to 'core/java/android/content/pm')
-rw-r--r--core/java/android/content/pm/ApplicationInfo.java24
-rw-r--r--core/java/android/content/pm/PackageParser.java6
2 files changed, 22 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 &lt;application&gt; 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;