summaryrefslogtreecommitdiff
path: root/core/java/android/app/ActivityManager.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-05-11 17:34:49 -0700
committerDianne Hackborn <hackbod@google.com>2011-05-12 13:28:45 -0700
commit0f1de9adde0b52d2a385a76232bd7ac30c3eeea2 (patch)
tree6d30064324ea987411955a88cb0272ddb27d39b2 /core/java/android/app/ActivityManager.java
parentf3cdea937b8b659f959d5e77f4a17f749f85c6ae (diff)
New compat mode front end: UI and persistence.
Adds a really crappy UI for toggling compat mode. Persists compat mode selection across boots. Turns on compat mode by default for newly installed apps. Change-Id: Idc83494397bd17c41450bc9e9a05e4386c509399
Diffstat (limited to 'core/java/android/app/ActivityManager.java')
-rw-r--r--core/java/android/app/ActivityManager.java76
1 files changed, 76 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index b6581e92994e..e4499797fe96 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -59,6 +59,82 @@ public class ActivityManager {
}
/**
+ * Screen compatibility mode: the application most always run in
+ * compatibility mode.
+ * @hide
+ */
+ public static final int COMPAT_MODE_ALWAYS = -1;
+
+ /**
+ * Screen compatibility mode: the application can never run in
+ * compatibility mode.
+ * @hide
+ */
+ public static final int COMPAT_MODE_NEVER = -2;
+
+ /**
+ * Screen compatibility mode: unknown.
+ * @hide
+ */
+ public static final int COMPAT_MODE_UNKNOWN = -3;
+
+ /**
+ * Screen compatibility mode: the application currently has compatibility
+ * mode disabled.
+ * @hide
+ */
+ public static final int COMPAT_MODE_DISABLED = 0;
+
+ /**
+ * Screen compatibility mode: the application currently has compatibility
+ * mode enabled.
+ * @hide
+ */
+ public static final int COMPAT_MODE_ENABLED = 1;
+
+ /**
+ * Screen compatibility mode: request to toggle the application's
+ * compatibility mode.
+ * @hide
+ */
+ public static final int COMPAT_MODE_TOGGLE = 2;
+
+ /** @hide */
+ public int getFrontActivityScreenCompatMode() {
+ try {
+ return ActivityManagerNative.getDefault().getFrontActivityScreenCompatMode();
+ } catch (RemoteException e) {
+ // System dead, we will be dead too soon!
+ return 0;
+ }
+ }
+
+ public void setFrontActivityScreenCompatMode(int mode) {
+ try {
+ ActivityManagerNative.getDefault().setFrontActivityScreenCompatMode(mode);
+ } catch (RemoteException e) {
+ // System dead, we will be dead too soon!
+ }
+ }
+
+ public int getPackageScreenCompatMode(String packageName) {
+ try {
+ return ActivityManagerNative.getDefault().getPackageScreenCompatMode(packageName);
+ } catch (RemoteException e) {
+ // System dead, we will be dead too soon!
+ return 0;
+ }
+ }
+
+ public void setPackageScreenCompatMode(String packageName, int mode) {
+ try {
+ ActivityManagerNative.getDefault().setPackageScreenCompatMode(packageName, mode);
+ } catch (RemoteException e) {
+ // System dead, we will be dead too soon!
+ }
+ }
+
+ /**
* Return the approximate per-application memory class of the current
* device. This gives you an idea of how hard a memory limit you should
* impose on your application to let the overall system work best. The