summaryrefslogtreecommitdiffstats
path: root/policy/src/com/android/internal
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2011-11-16 22:33:44 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-16 22:33:44 -0800
commitd5decdccc64c59ad62de86c70dbe9ead12150cdc (patch)
tree67a1ed3ffdf7726eb13bf18859e16143051c7e52 /policy/src/com/android/internal
parent8fc3540fdf759ff3bb03b00e81d94d6c4102d530 (diff)
parent11ddf533a2165ca68002d3b48e312271b3d0dedb (diff)
downloadframeworks_base-d5decdccc64c59ad62de86c70dbe9ead12150cdc.zip
frameworks_base-d5decdccc64c59ad62de86c70dbe9ead12150cdc.tar.gz
frameworks_base-d5decdccc64c59ad62de86c70dbe9ead12150cdc.tar.bz2
Merge "Disable desk dock apps." into ics-mr1
Diffstat (limited to 'policy/src/com/android/internal')
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java31
1 files changed, 25 insertions, 6 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index f0d19d1..e00a54c 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -157,6 +157,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
static final boolean SHOW_STARTING_ANIMATIONS = true;
static final boolean SHOW_PROCESSES_ON_ALT_MENU = false;
+ // Whether to allow dock apps with METADATA_DOCK_HOME to temporarily take over the Home key.
+ // No longer recommended for desk docks; still useful in car docks.
+ static final boolean ENABLE_CAR_DOCK_HOME_CAPTURE = true;
+ static final boolean ENABLE_DESK_DOCK_HOME_CAPTURE = false;
+
static final int LONG_PRESS_POWER_NOTHING = 0;
static final int LONG_PRESS_POWER_GLOBAL_ACTIONS = 1;
static final int LONG_PRESS_POWER_SHUT_OFF = 2;
@@ -3511,21 +3516,35 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
/**
- * Return an Intent to launch the currently active dock as home. Returns
- * null if the standard home should be launched.
+ * Return an Intent to launch the currently active dock app as home. Returns
+ * null if the standard home should be launched, which is the case if any of the following is
+ * true:
+ * <ul>
+ * <li>The device is not in either car mode or desk mode
+ * <li>The device is in car mode but ENABLE_CAR_DOCK_HOME_CAPTURE is false
+ * <li>The device is in desk mode but ENABLE_DESK_DOCK_HOME_CAPTURE is false
+ * <li>The device is in car mode but there's no CAR_DOCK app with METADATA_DOCK_HOME
+ * <li>The device is in desk mode but there's no DESK_DOCK app with METADATA_DOCK_HOME
+ * </ul>
* @return
*/
Intent createHomeDockIntent() {
- Intent intent;
+ Intent intent = null;
// What home does is based on the mode, not the dock state. That
// is, when in car mode you should be taken to car home regardless
// of whether we are actually in a car dock.
if (mUiMode == Configuration.UI_MODE_TYPE_CAR) {
- intent = mCarDockIntent;
+ if (ENABLE_CAR_DOCK_HOME_CAPTURE) {
+ intent = mCarDockIntent;
+ }
} else if (mUiMode == Configuration.UI_MODE_TYPE_DESK) {
- intent = mDeskDockIntent;
- } else {
+ if (ENABLE_DESK_DOCK_HOME_CAPTURE) {
+ intent = mDeskDockIntent;
+ }
+ }
+
+ if (intent == null) {
return null;
}