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

Commit 0c943966 authored by Winson Chung's avatar Winson Chung
Browse files

Add null check for input receiver before updating batching

- A change in the system (ie. sysui crash or nav mode change) could
  cause the input monitor to be disposed before the swipe animation
  settles

Bug: 170121063
Test: Kill sysui while swiping up

Change-Id: I1417b109fecdb98fae6197c7038dbe9307470853
parent a5130482
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -732,9 +732,12 @@ public class TouchInteractionService extends Service implements PluginListener<O
    private void reset() {
        mConsumer = mUncheckedConsumer = mResetGestureInputConsumer;
        mGestureState = DEFAULT_STATE;
        // By default, use batching of the input events
        // By default, use batching of the input events, but check receiver before using in the rare
        // case that the monitor was disposed before the swipe settled
        if (mInputEventReceiver != null) {
            mInputEventReceiver.setBatchingEnabled(true);
        }
    }

    private void preloadOverview(boolean fromInit) {
        if (!mDeviceState.isUserUnlocked()) {