summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2011-10-27 17:46:07 -0700
committerAdam Powell <adamp@google.com>2011-11-11 12:02:01 -0800
commit63464c522915b5b12b6853d8568866c3d49008a3 (patch)
tree1609739ffdb7e36d88f86b22b2ddb96b70597667
parent7b8bec280f20e8a5863d8214bbc195497335eba6 (diff)
downloadframeworks_base-63464c522915b5b12b6853d8568866c3d49008a3.zip
frameworks_base-63464c522915b5b12b6853d8568866c3d49008a3.tar.gz
frameworks_base-63464c522915b5b12b6853d8568866c3d49008a3.tar.bz2
DO NOT MERGE Cherry pick from ics-mr1 - Bug 5275928 - Don't try to open an
overflow menu under invalid circumstances. Change-Id: Ifb847b914b880ffb21dd5fc6efa833f46466f224
-rw-r--r--core/java/com/android/internal/view/menu/ActionMenuPresenter.java6
-rw-r--r--core/java/com/android/internal/widget/ActionBarContextView.java3
2 files changed, 7 insertions, 2 deletions
diff --git a/core/java/com/android/internal/view/menu/ActionMenuPresenter.java b/core/java/com/android/internal/view/menu/ActionMenuPresenter.java
index f25d65f..530809b 100644
--- a/core/java/com/android/internal/view/menu/ActionMenuPresenter.java
+++ b/core/java/com/android/internal/view/menu/ActionMenuPresenter.java
@@ -300,6 +300,7 @@ public class ActionMenuPresenter extends BaseMenuPresenter
public boolean hideOverflowMenu() {
if (mPostedOpenRunnable != null && mMenuView != null) {
((View) mMenuView).removeCallbacks(mPostedOpenRunnable);
+ mPostedOpenRunnable = null;
return true;
}
@@ -653,10 +654,11 @@ public class ActionMenuPresenter extends BaseMenuPresenter
public void run() {
mMenu.changeMenuMode();
- if (mPopup.tryShow()) {
+ final View menuView = (View) mMenuView;
+ if (menuView != null && menuView.getWindowToken() != null && mPopup.tryShow()) {
mOverflowPopup = mPopup;
- mPostedOpenRunnable = null;
}
+ mPostedOpenRunnable = null;
}
}
}
diff --git a/core/java/com/android/internal/widget/ActionBarContextView.java b/core/java/com/android/internal/widget/ActionBarContextView.java
index 18d45f7..ed02636 100644
--- a/core/java/com/android/internal/widget/ActionBarContextView.java
+++ b/core/java/com/android/internal/widget/ActionBarContextView.java
@@ -216,6 +216,9 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi
});
final MenuBuilder menu = (MenuBuilder) mode.getMenu();
+ if (mActionMenuPresenter != null) {
+ mActionMenuPresenter.dismissPopupMenus();
+ }
mActionMenuPresenter = new ActionMenuPresenter(mContext);
mActionMenuPresenter.setReserveOverflow(true);