Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd71db84 authored by Adam Powell's avatar Adam Powell
Browse files

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
parent a6af40cd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;