From 4c101c3f68308e82b10415441447d1586bf8030a Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Tue, 31 Mar 2020 14:43:25 -0700 Subject: [PATCH 1/2] InsetsSourceConsumer: Release directly Since we copy the InsetSourceControl to the animation runner, we don't need to release the InsetsSourceConsumer copy from the render thread, as it wont be used there. Bug: 150805473 Test: Existing tests pass. Change-Id: I03cb69e17e036237410472e8b4601b61fc40bc0e --- core/java/android/view/InsetsSourceConsumer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/view/InsetsSourceConsumer.java b/core/java/android/view/InsetsSourceConsumer.java index 360195df6625e..69bab4df2caee 100644 --- a/core/java/android/view/InsetsSourceConsumer.java +++ b/core/java/android/view/InsetsSourceConsumer.java @@ -121,7 +121,7 @@ public class InsetsSourceConsumer { } } if (lastControl != null) { - lastControl.release(mController::releaseSurfaceControlFromRt); + lastControl.release(SurfaceControl::release); } } From 53be42a75db7e2682c20e74c10bfe001a1723a92 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Tue, 31 Mar 2020 14:44:36 -0700 Subject: [PATCH 2/2] InsetAnimationThreadControlRunner: Don't copy controls The controls are copied previously in collectSourceControls and so this copy is unnecessary. Bug: 150805473 Test: Existing tests pass Change-Id: I98b51b4372ace95036e25e806d1ab646d2df7879 --- core/java/android/view/InsetsAnimationThreadControlRunner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/view/InsetsAnimationThreadControlRunner.java b/core/java/android/view/InsetsAnimationThreadControlRunner.java index 40ffa7ef48bf7..3870f26e9990b 100644 --- a/core/java/android/view/InsetsAnimationThreadControlRunner.java +++ b/core/java/android/view/InsetsAnimationThreadControlRunner.java @@ -91,7 +91,7 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro @AnimationType int animationType, Handler mainThreadHandler) { mMainThreadHandler = mainThreadHandler; mOuterCallbacks = controller; - mControl = new InsetsAnimationControlImpl(copyControls(controls), frame, state, listener, + mControl = new InsetsAnimationControlImpl(controls, frame, state, listener, types, mCallbacks, durationMs, interpolator, animationType); InsetsAnimationThread.getHandler().post(() -> listener.onReady(mControl, types)); }