Handle cancelled Insets animation

If an Insets animation was cancelled before it could complete,
handle it gracefully.

Fix: 154381667
Test: Run monkey runner that on any window that has edit text
      atest InsetsControllerTests
Change-Id: I052a0455f536a1c839a2782e54f19143295ba6c6
This commit is contained in:
Taran Singh
2020-09-30 14:21:52 -07:00
parent 0c52a7600f
commit e2307d9a48

View File

@@ -108,6 +108,9 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro
mControl = new InsetsAnimationControlImpl(controls, frame, state, listener,
types, mCallbacks, durationMs, interpolator, animationType);
InsetsAnimationThread.getHandler().post(() -> {
if (mControl.isCancelled()) {
return;
}
Trace.asyncTraceBegin(Trace.TRACE_TAG_VIEW,
"InsetsAsyncAnimation: " + WindowInsets.Type.toString(types), types);
listener.onReady(mControl, types);