From 6482df5602b083eb6b8cc512a2e71f0f297c48b9 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Wed, 26 Jun 2019 17:35:32 +0200 Subject: [PATCH] Request invalidate root when legacy nav bar bg changes ...because only invalidating the root window node will ensure that onPostDraw() will be called again. Test: Open com.planeth.rhythm Fixes: 135207159 Change-Id: I03f814eb7435d91287968f3dcb72f579ab4a35ed --- core/java/com/android/internal/policy/DecorView.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java index afe7954971045..6f4f3374ac734 100644 --- a/core/java/com/android/internal/policy/DecorView.java +++ b/core/java/com/android/internal/policy/DecorView.java @@ -84,6 +84,7 @@ import android.view.ThreadedRenderer; import android.view.View; import android.view.ViewGroup; import android.view.ViewOutlineProvider; +import android.view.ViewRootImpl; import android.view.ViewStub; import android.view.ViewTreeObserver; import android.view.Window; @@ -1150,8 +1151,15 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind navBarToRightEdge || navBarToLeftEdge, navBarToLeftEdge, 0 /* sideInset */, animate && !disallowAnimate, mForceWindowDrawsBarBackgrounds); + boolean oldDrawLegacy = mDrawLegacyNavigationBarBackground; mDrawLegacyNavigationBarBackground = mNavigationColorViewState.visible && (mWindow.getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) == 0; + if (oldDrawLegacy != mDrawLegacyNavigationBarBackground) { + ViewRootImpl vri = getViewRootImpl(); + if (vri != null) { + vri.requestInvalidateRootRenderNode(); + } + } boolean statusBarNeedsRightInset = navBarToRightEdge && mNavigationColorViewState.present;