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
This commit is contained in:
Winson Chung committed 2020-10-05 17:55:55 +00:00
1 parent a5130482ae
commit 0c943966d3
1 file changed
+5 -2
@@ -732,8 +732,11 @@ 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
mInputEventReceiver.setBatchingEnabled(true);
// 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) {