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

Commit aec6a261 authored by Ming-Shin Lu's avatar Ming-Shin Lu Committed by Automerger Merge Worker
Browse files

Merge "Fix insets animations being skipped when the host view was invisible"...

Merge "Fix insets animations being skipped when the host view was invisible" into tm-dev am: df8e2a51 am: cea0ca8c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16972227



Change-Id: I0fcd9f52124ccd96ebb6fb2f356c0f0bd279b6a9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents baaf9ab5 cea0ca8c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1310,8 +1310,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
    }

    private void cancelAnimation(InsetsAnimationControlRunner control, boolean invokeCallback) {
        if (DEBUG) Log.d(TAG, String.format("cancelAnimation of types: %d, animType: %d",
                control.getTypes(), control.getAnimationType()));
        if (DEBUG) Log.d(TAG, String.format("cancelAnimation of types: %d, animType: %d, host: %s",
                control.getTypes(), control.getAnimationType(), mHost.getRootViewTitle()));
        if (invokeCallback) {
            control.cancel();
        }
+7 −2
Original line number Diff line number Diff line
@@ -125,10 +125,11 @@ public class ViewRootInsetsControllerHost implements InsetsController.Host {
        if (mApplier == null) {
            mApplier = new SyncRtSurfaceTransactionApplier(mViewRoot.mView);
        }
        if (mViewRoot.mView.isHardwareAccelerated()) {
        if (mViewRoot.mView.isHardwareAccelerated() && isVisibleToUser()) {
            mApplier.scheduleApply(params);
        } else {
            // Window doesn't support hardware acceleration, no synchronization for now.
            // Synchronization requires hardware acceleration for now.
            // If the window isn't visible, drawing is paused and the applier won't run.
            // TODO(b/149342281): use mViewRoot.mSurface.getNextFrameNumber() to sync on every
            //  frame instead.
            final SurfaceControl.Transaction t = new SurfaceControl.Transaction();
@@ -269,4 +270,8 @@ public class ViewRootInsetsControllerHost implements InsetsController.Host {
        }
        return null;
    }

    private boolean isVisibleToUser() {
        return mViewRoot.getHostVisibility() == View.VISIBLE;
    }
}