Loading core/java/android/view/InsetsAnimationControlCallbacks.java +6 −0 Original line number Diff line number Diff line Loading @@ -56,4 +56,10 @@ public interface InsetsAnimationControlCallbacks { * apply. */ void applySurfaceParams(SyncRtSurfaceTransactionApplier.SurfaceParams... params); /** * Post a message to release the Surface, guaranteed to happen after all * previous calls to applySurfaceParams. */ void releaseSurfaceControlFromRt(SurfaceControl sc); } core/java/android/view/InsetsAnimationControlImpl.java +12 −0 Original line number Diff line number Diff line Loading @@ -180,10 +180,19 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll mAnimation.setAlpha(mPendingAlpha); if (mFinished) { mController.notifyFinished(this, mShownOnFinish); releaseLeashes(); } return mFinished; } private void releaseLeashes() { for (int i = mControls.size() - 1; i >= 0; i--) { final InsetsSourceControl c = mControls.valueAt(i); if (c == null) continue; c.release(mController::releaseSurfaceControlFromRt); } } @Override public void finish(boolean shown) { if (mCancelled || mFinished) { Loading @@ -191,6 +200,7 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll } setInsetsAndAlpha(shown ? mShownInsets : mHiddenInsets, 1f /* alpha */, 1f /* fraction */); mFinished = true; mShownOnFinish = shown; } Loading @@ -207,6 +217,8 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll } mCancelled = true; mListener.onCancelled(); releaseLeashes(); } public boolean isCancelled() { Loading core/java/android/view/InsetsAnimationThreadControlRunner.java +6 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,12 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro t.apply(); t.close(); } @Override public void releaseSurfaceControlFromRt(SurfaceControl sc) { // Since we don't push the SurfaceParams to the RT we can release directly sc.release(); } }; @UiThread Loading core/java/android/view/InsetsController.java +1 −1 Original line number Diff line number Diff line Loading @@ -704,7 +704,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation } final InsetsSourceControl control = consumer.getControl(); if (control != null) { controls.put(consumer.getType(), control); controls.put(consumer.getType(), new InsetsSourceControl(control)); typesReady |= toPublicType(consumer.getType()); } else if (animationType == ANIMATION_TYPE_SHOW) { Loading services/core/java/com/android/server/wm/InsetsPolicy.java +7 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,13 @@ class InsetsPolicy { t.close(); } // Since we don't push applySurfaceParams to a Handler-queue we don't need // to push release in this case. @Override public void releaseSurfaceControlFromRt(SurfaceControl sc) { sc.release(); } @Override public void startAnimation(InsetsAnimationControlImpl controller, WindowInsetsAnimationControlListener listener, int types, Loading Loading
core/java/android/view/InsetsAnimationControlCallbacks.java +6 −0 Original line number Diff line number Diff line Loading @@ -56,4 +56,10 @@ public interface InsetsAnimationControlCallbacks { * apply. */ void applySurfaceParams(SyncRtSurfaceTransactionApplier.SurfaceParams... params); /** * Post a message to release the Surface, guaranteed to happen after all * previous calls to applySurfaceParams. */ void releaseSurfaceControlFromRt(SurfaceControl sc); }
core/java/android/view/InsetsAnimationControlImpl.java +12 −0 Original line number Diff line number Diff line Loading @@ -180,10 +180,19 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll mAnimation.setAlpha(mPendingAlpha); if (mFinished) { mController.notifyFinished(this, mShownOnFinish); releaseLeashes(); } return mFinished; } private void releaseLeashes() { for (int i = mControls.size() - 1; i >= 0; i--) { final InsetsSourceControl c = mControls.valueAt(i); if (c == null) continue; c.release(mController::releaseSurfaceControlFromRt); } } @Override public void finish(boolean shown) { if (mCancelled || mFinished) { Loading @@ -191,6 +200,7 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll } setInsetsAndAlpha(shown ? mShownInsets : mHiddenInsets, 1f /* alpha */, 1f /* fraction */); mFinished = true; mShownOnFinish = shown; } Loading @@ -207,6 +217,8 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll } mCancelled = true; mListener.onCancelled(); releaseLeashes(); } public boolean isCancelled() { Loading
core/java/android/view/InsetsAnimationThreadControlRunner.java +6 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,12 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro t.apply(); t.close(); } @Override public void releaseSurfaceControlFromRt(SurfaceControl sc) { // Since we don't push the SurfaceParams to the RT we can release directly sc.release(); } }; @UiThread Loading
core/java/android/view/InsetsController.java +1 −1 Original line number Diff line number Diff line Loading @@ -704,7 +704,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation } final InsetsSourceControl control = consumer.getControl(); if (control != null) { controls.put(consumer.getType(), control); controls.put(consumer.getType(), new InsetsSourceControl(control)); typesReady |= toPublicType(consumer.getType()); } else if (animationType == ANIMATION_TYPE_SHOW) { Loading
services/core/java/com/android/server/wm/InsetsPolicy.java +7 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,13 @@ class InsetsPolicy { t.close(); } // Since we don't push applySurfaceParams to a Handler-queue we don't need // to push release in this case. @Override public void releaseSurfaceControlFromRt(SurfaceControl sc) { sc.release(); } @Override public void startAnimation(InsetsAnimationControlImpl controller, WindowInsetsAnimationControlListener listener, int types, Loading