summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2013-04-04 11:10:24 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-04-04 11:10:24 -0700
commit5677e78863cc00bbe5ef0fa66f3e1da287b18f97 (patch)
treeff1b91cffa071f7b3c1dafd628416052a1da1317 /policy
parent2a54c185a64b247ff261de962e3a4e0ddf4c2ff0 (diff)
parent2987c218e351c76941f09bddb3eb46a572ca6644 (diff)
downloadframeworks_base-5677e78863cc00bbe5ef0fa66f3e1da287b18f97.zip
frameworks_base-5677e78863cc00bbe5ef0fa66f3e1da287b18f97.tar.gz
frameworks_base-5677e78863cc00bbe5ef0fa66f3e1da287b18f97.tar.bz2
am 2987c218: am 728827ff: Merge "Uphold common ordering expectations around action bar Home/Up dispatch" into jb-mr2-dev
* commit '2987c218e351c76941f09bddb3eb46a572ca6644': Uphold common ordering expectations around action bar Home/Up dispatch
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindow.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index ad5e20b..6b28e8e 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -380,6 +380,15 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
st.createdPanelView = cb.onCreatePanelView(st.featureId);
}
+ final boolean isActionBarMenu =
+ (st.featureId == FEATURE_OPTIONS_PANEL || st.featureId == FEATURE_ACTION_BAR);
+
+ if (isActionBarMenu && mActionBar != null) {
+ // Enforce ordering guarantees around events so that the action bar never
+ // dispatches menu-related events before the panel is prepared.
+ mActionBar.setMenuPrepared();
+ }
+
if (st.createdPanelView == null) {
// Init the panel state's menu--return false if init failed
if (st.menu == null || st.refreshMenuContent) {
@@ -389,7 +398,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
}
}
- if (mActionBar != null) {
+ if (isActionBarMenu && mActionBar != null) {
if (mActionMenuPresenterCallback == null) {
mActionMenuPresenterCallback = new ActionMenuPresenterCallback();
}
@@ -405,7 +414,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
// Ditch the menu created above
st.setMenu(null);
- if (mActionBar != null) {
+ if (isActionBarMenu && mActionBar != null) {
// Don't show it in the action bar either
mActionBar.setMenu(null, mActionMenuPresenterCallback);
}
@@ -430,7 +439,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
}
if (!cb.onPreparePanel(st.featureId, st.createdPanelView, st.menu)) {
- if (mActionBar != null) {
+ if (isActionBarMenu && mActionBar != null) {
// The app didn't want to show the menu for now but it still exists.
// Clear it out of the action bar.
mActionBar.setMenu(null, mActionMenuPresenterCallback);