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

Commit 6024ca5c authored by Adam Powell's avatar Adam Powell
Browse files

Fix bug 2185026 - back button in context menu now calls onContextMenuClosed()

Change-Id: I6c16879a8ad8e4651d21f639a620a936bf991f8d
parent eb6e3edc
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -101,13 +101,21 @@ public class MenuDialogHelper implements DialogInterface.OnKeyListener, DialogIn
                        }
                    }
                }
            } else if (event.getAction() == KeyEvent.ACTION_UP
                    && event.isTracking() && !event.isCanceled()) {
            } else if (event.getAction() == KeyEvent.ACTION_UP && !event.isCanceled()) {
                Window win = mDialog.getWindow();
                if (win != null) {
                    View decor = win.getDecorView();
                    if (decor != null) {
                        KeyEvent.DispatcherState ds = decor.getKeyDispatcherState();
                        if (ds != null && ds.isTracking(event)) {
                            mMenu.close(true);
                            dialog.dismiss();
                            return true;
                        }
                    }
                }
            }
        }

        // Menu shortcut matching
        return mMenu.performShortcut(keyCode, event, 0);