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
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java
index afe7954..6f4f337 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.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 @@
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;