diff options
author | Adam Powell <adamp@google.com> | 2013-09-12 11:13:58 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-12 11:13:58 -0700 |
commit | 179ba0c04b446406d226cdfe866317d0d2bcecce (patch) | |
tree | 48611679b1114c7e391a0fc1f4ee72dfa55d3cea /policy | |
parent | 913c023387c319f6c7b1e4878a4d0d07f8624f78 (diff) | |
parent | a2906cb4d9355b7a08e7fdec1924c2dbc7fda622 (diff) | |
download | frameworks_base-179ba0c04b446406d226cdfe866317d0d2bcecce.zip frameworks_base-179ba0c04b446406d226cdfe866317d0d2bcecce.tar.gz frameworks_base-179ba0c04b446406d226cdfe866317d0d2bcecce.tar.bz2 |
am a2906cb4: Merge "Show alternate menu panel on devices with menu key" into klp-dev
* commit 'a2906cb4d9355b7a08e7fdec1924c2dbc7fda622':
Show alternate menu panel on devices with menu key
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index a3bd785..11913ee 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -22,6 +22,7 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import static android.view.WindowManager.LayoutParams.*; +import android.view.ViewConfiguration; import com.android.internal.view.RootViewSurfaceTaker; import com.android.internal.view.StandaloneActionMode; import com.android.internal.view.menu.ContextMenuBuilder; @@ -540,7 +541,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { @Override public final void openPanel(int featureId, KeyEvent event) { if (featureId == FEATURE_OPTIONS_PANEL && mActionBar != null && - mActionBar.isOverflowReserved()) { + mActionBar.isOverflowReserved() && + !ViewConfiguration.get(getContext()).hasPermanentMenuKey()) { if (mActionBar.getVisibility() == View.VISIBLE) { mActionBar.showOverflowMenu(); } @@ -549,7 +551,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } - private void openPanel(PanelFeatureState st, KeyEvent event) { + private void openPanel(final PanelFeatureState st, KeyEvent event) { // System.out.println("Open panel: isOpen=" + st.isOpen); // Already open, return @@ -673,7 +675,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { @Override public final void closePanel(int featureId) { if (featureId == FEATURE_OPTIONS_PANEL && mActionBar != null && - mActionBar.isOverflowReserved()) { + mActionBar.isOverflowReserved() && + !ViewConfiguration.get(getContext()).hasPermanentMenuKey()) { mActionBar.hideOverflowMenu(); } else if (featureId == FEATURE_CONTEXT_MENU) { closeContextMenu(); @@ -836,7 +839,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { boolean playSoundEffect = false; final PanelFeatureState st = getPanelState(featureId, true); if (featureId == FEATURE_OPTIONS_PANEL && mActionBar != null && - mActionBar.isOverflowReserved()) { + mActionBar.isOverflowReserved() && + !ViewConfiguration.get(getContext()).hasPermanentMenuKey()) { if (mActionBar.getVisibility() == View.VISIBLE) { if (!mActionBar.isOverflowMenuShowing()) { if (!isDestroyed() && preparePanel(st, event)) { @@ -1014,7 +1018,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } private void reopenMenu(boolean toggleMenuMode) { - if (mActionBar != null && mActionBar.isOverflowReserved()) { + if (mActionBar != null && mActionBar.isOverflowReserved() && + (!ViewConfiguration.get(getContext()).hasPermanentMenuKey() || + mActionBar.isOverflowMenuShowPending())) { final Callback cb = getCallback(); if (!mActionBar.isOverflowMenuShowing() || !toggleMenuMode) { if (cb != null && !isDestroyed() && mActionBar.getVisibility() == View.VISIBLE) { |