Exit dream on MotionEvent.ACTION_UP.

Previously, DreamService would exit when any
MotionEvent was detected. This led to dreams
ending while the user's finger was still on
the screen.

This change adjusts the exit action to be on
ACTION_UP to correspond with the finger lifting
off the screen, matching user expectation.

Bug: verified non-interactive dream exits on
     lifting finger.
Test: 210919013
Change-Id: I767cdb179f99073c1fffc66fe492bdcbbae599c2
This commit is contained in:
Bryce Lee
2021-12-15 16:08:58 -08:00
parent a097209fef
commit b5b2dfc63d

View File

@@ -333,7 +333,7 @@ public class DreamService extends Service implements Window.Callback {
public boolean dispatchTouchEvent(MotionEvent event) {
// TODO: create more flexible version of mInteractive that allows clicks
// but finish()es on any other kind of activity
if (!mInteractive) {
if (!mInteractive && event.getActionMasked() == MotionEvent.ACTION_UP) {
if (mDebug) Slog.v(TAG, "Waking up on touchEvent");
wakeUp();
return true;