From 1b068c44b3cc42c7b74d10cb52e0fe5128337746 Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Wed, 5 Jan 2022 16:26:17 -0800 Subject: [PATCH] SurfaceView: Synchronize visibility changes with VRI frame There is a flicker in wallpaper picker due to a recent change where SurfaceView creation changes were synchronized with VRI frame. This breaks wallpaper picker because wallpaper picker doesn't actually draw into the SV surface, instead they attach a surface package. The current implementation meant the SurfacePackage would be visible before it was scaled correctly. This fix applies the visibility changes along with the scaling changes. Test: steps in b/211945947 Fixes: 211945947 Change-Id: I4e5107ac2caf634429e1bec3201fdcaa8f5f92bc (cherry picked from commit 230677e7b3b8ae27e337eefbabcbedda2d5ffcfd) --- core/java/android/view/SurfaceView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 4c7bfd2526577..463ec2c04308e 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -975,9 +975,9 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall mParentSurfaceSequenceId = viewRoot.getSurfaceSequenceId(); if (mViewVisibility) { - mTmpTransaction.show(mSurfaceControl); + geometryTransaction.show(mSurfaceControl); } else { - mTmpTransaction.hide(mSurfaceControl); + geometryTransaction.hide(mSurfaceControl); } if (mSurfacePackage != null) {