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

Commit 8a7af570 authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "MediaController does not check for cancelled motions in onTouchEvent,...

Merge "MediaController does not check for cancelled motions in onTouchEvent, causing nested invocations of WindowManagerGlobal.addView. Sample stack trace below."
parents d83adf00 cfe4b593
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -442,7 +442,19 @@ public class MediaController extends FrameLayout {

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        show(sDefaultTimeout);
        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
                show(0); // show until hide is called
                break;
            case MotionEvent.ACTION_UP:
                show(sDefaultTimeout); // start timeout
                break;
            case MotionEvent.ACTION_CANCEL:
                hide();
                break;
            default:
                break;
        }
        return true;
    }