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

Commit 6bc7cacf authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in PopupMenu.getDragToOpenListener()" into klp-dev

parents 0ab7d4d1 99d72497
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -92,8 +92,21 @@ public class PopupMenu implements MenuBuilder.Callback, MenuPresenter.Callback {
    public OnTouchListener getDragToOpenListener() {
    public OnTouchListener getDragToOpenListener() {
        if (mDragListener == null) {
        if (mDragListener == null) {
            mDragListener = new ForwardingListener(mAnchor) {
            mDragListener = new ForwardingListener(mAnchor) {
                @Override
                protected boolean onForwardingStarted() {
                    show();
                    return true;
                }

                @Override
                protected boolean onForwardingStopped() {
                    dismiss();
                    return true;
                }

                @Override
                @Override
                public ListPopupWindow getPopup() {
                public ListPopupWindow getPopup() {
                    // This will be null until show() is called.
                    return mPopup.getPopup();
                    return mPopup.getPopup();
                }
                }
            };
            };