summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2011-10-13 11:33:24 -0700
committerAdam Powell <adamp@google.com>2011-10-13 15:51:25 -0700
commitc6d51889c27cfa815f001cdf25792e98446e300f (patch)
tree2fbd9a1269b34cc0f7a090aa6cf975bb308f3b24 /policy
parenta6708c6a462d2a30e51e7ded2559a4054cb651fc (diff)
downloadframeworks_base-c6d51889c27cfa815f001cdf25792e98446e300f.zip
frameworks_base-c6d51889c27cfa815f001cdf25792e98446e300f.tar.gz
frameworks_base-c6d51889c27cfa815f001cdf25792e98446e300f.tar.bz2
Bug 5312828 - Menu button not responding
Increase tolerance for apps calling invalidateOptionsMenu at inconvenient times. Change-Id: I712b20002afd0f056c3f05b160c5fa9c2ef0b552
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindow.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index de8d41a2..af86ae9 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -349,8 +349,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
}
// Already prepared (isPrepared will be reset to false later)
- if (st.isPrepared)
+ if (st.isPrepared) {
return true;
+ }
if ((mPreparedPanel != null) && (mPreparedPanel != st)) {
// Another Panel is prepared and possibly open, so close it
@@ -800,14 +801,23 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
closePanel(st, true);
} else if (st.isPrepared) {
+ boolean show = true;
+ if (st.refreshMenuContent) {
+ // Something may have invalidated the menu since we prepared it.
+ // Re-prepare it to refresh.
+ st.isPrepared = false;
+ show = preparePanel(st, event);
+ }
- // Write 'menu opened' to event log
- EventLog.writeEvent(50001, 0);
+ if (show) {
+ // Write 'menu opened' to event log
+ EventLog.writeEvent(50001, 0);
- // Show menu
- openPanel(st, event);
+ // Show menu
+ openPanel(st, event);
- playSoundEffect = true;
+ playSoundEffect = true;
+ }
}
}