summaryrefslogtreecommitdiffstats
path: root/policy/src
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2011-02-10 17:30:36 -0800
committerAdam Powell <adamp@google.com>2011-02-10 17:57:48 -0800
commitef5a440d0a02aa34388d975c58fb7a30e56a0f5c (patch)
tree5917af7db83aa1f67d4168b10387fdbf48260cf9 /policy/src
parent8132a8caf36f6c13d679f7275be8e2fd5afd52ba (diff)
downloadframeworks_base-ef5a440d0a02aa34388d975c58fb7a30e56a0f5c.zip
frameworks_base-ef5a440d0a02aa34388d975c58fb7a30e56a0f5c.tar.gz
frameworks_base-ef5a440d0a02aa34388d975c58fb7a30e56a0f5c.tar.bz2
Fix bug 2955651 - can open normal menu during action modes
Prevent the usual menu pipeline from trying to open the action bar overflow menu when the action bar is not visible. Change-Id: I0708d142ad271368baa79351b97aad1533636fe7
Diffstat (limited to 'policy/src')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindow.java26
1 files changed, 15 insertions, 11 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 958a5e2..79b5ced 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -424,9 +424,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
public final void openPanel(int featureId, KeyEvent event) {
if (featureId == FEATURE_OPTIONS_PANEL && mActionBar != null &&
mActionBar.isOverflowReserved()) {
- // Invalidate the options menu, we want a prepare event that the app can respond to.
- invalidatePanelMenu(FEATURE_OPTIONS_PANEL);
- mActionBar.showOverflowMenu();
+ if (mActionBar.getVisibility() == View.VISIBLE) {
+ // Invalidate the options menu, we want a prepare event that the app can respond to.
+ invalidatePanelMenu(FEATURE_OPTIONS_PANEL);
+ mActionBar.showOverflowMenu();
+ }
} else {
openPanel(getPanelState(featureId, true), event);
}
@@ -696,14 +698,16 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
final PanelFeatureState st = getPanelState(featureId, true);
if (featureId == FEATURE_OPTIONS_PANEL && mActionBar != null &&
mActionBar.isOverflowReserved()) {
- if (!mActionBar.isOverflowMenuShowing()) {
- final Callback cb = getCallback();
- if (cb != null &&
- cb.onPreparePanel(featureId, st.createdPanelView, st.menu)) {
- playSoundEffect = mActionBar.showOverflowMenu();
+ if (mActionBar.getVisibility() == View.VISIBLE) {
+ if (!mActionBar.isOverflowMenuShowing()) {
+ final Callback cb = getCallback();
+ if (cb != null &&
+ cb.onPreparePanel(featureId, st.createdPanelView, st.menu)) {
+ playSoundEffect = mActionBar.showOverflowMenu();
+ }
+ } else {
+ playSoundEffect = mActionBar.hideOverflowMenu();
}
- } else {
- playSoundEffect = mActionBar.hideOverflowMenu();
}
} else {
if (st.isOpen || st.isHandled) {
@@ -911,7 +915,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
if (mActionBar != null) {
final Callback cb = getCallback();
if (!mActionBar.isOverflowMenuShowing() || !toggleMenuMode) {
- if (cb != null) {
+ if (cb != null && mActionBar.getVisibility() == View.VISIBLE) {
final PanelFeatureState st = getPanelState(FEATURE_OPTIONS_PANEL, true);
if (cb.onPreparePanel(FEATURE_OPTIONS_PANEL, st.createdPanelView, st.menu)) {
cb.onMenuOpened(FEATURE_ACTION_BAR, st.menu);