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

Commit 16e30f5e authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Fix right click to context menu behavior of View."

parents 7ff7cdcd 33e3036a
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -4845,11 +4845,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @hide
     */
    protected boolean performButtonActionOnTouchDown(MotionEvent event) {
        if ((event.getButtonState() & MotionEvent.BUTTON_SECONDARY) != 0) {
            if (showContextMenu(event.getX(), event.getY(), event.getMetaState())) {
        if (event.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE &&
            (event.getButtonState() & MotionEvent.BUTTON_SECONDARY) != 0) {
            showContextMenu(event.getX(), event.getY(), event.getMetaState());
            mPrivateFlags |= PFLAG_CANCEL_NEXT_UP_EVENT;
            return true;
        }
        }
        return false;
    }