diff options
author | Daniel Sandler <dsandler@android.com> | 2011-11-16 22:33:44 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-16 22:33:44 -0800 |
commit | d5decdccc64c59ad62de86c70dbe9ead12150cdc (patch) | |
tree | 67a1ed3ffdf7726eb13bf18859e16143051c7e52 /policy/src/com/android/internal | |
parent | 8fc3540fdf759ff3bb03b00e81d94d6c4102d530 (diff) | |
parent | 11ddf533a2165ca68002d3b48e312271b3d0dedb (diff) | |
download | frameworks_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-x | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 31 |
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; } |