diff options
author | Adam Powell <adamp@google.com> | 2013-10-08 15:20:29 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2013-10-08 15:20:29 -0700 |
commit | fd71db84454bea8da07a79b91dc5065f645e4d14 (patch) | |
tree | 5b5cce827c77ceed4de211df012a268cf6113af8 /policy/src | |
parent | a6af40cda29837fb68507f431ee5a179db93de28 (diff) | |
download | frameworks_base-fd71db84454bea8da07a79b91dc5065f645e4d14.zip frameworks_base-fd71db84454bea8da07a79b91dc5065f645e4d14.tar.gz frameworks_base-fd71db84454bea8da07a79b91dc5065f645e4d14.tar.bz2 |
Close context menu dialogs if the menu becomes empty
If a view triggers showContextMenu while a context menu is already
shown but contributes no items to the menu the menu dialog would
become empty. Simply close the dialog if this happens.
Bug 11063885
Change-Id: I9e7c96073318c94eda5f1e1c4beb596b3d9da781
Diffstat (limited to 'policy/src')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index d8af007..eba689d 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -2338,6 +2338,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { originalView.getWindowToken()); if (helper != null) { helper.setPresenterCallback(mContextMenuCallback); + } else if (mContextMenuHelper != null) { + // No menu to show, but if we have a menu currently showing it just became blank. + // Close it. + mContextMenuHelper.dismiss(); } mContextMenuHelper = helper; return helper != null; |