Merge "Fix setSystemBarsAppearances" into sc-v2-dev

This commit is contained in:
Tiger Huang
2022-03-25 06:15:12 +00:00
committed by Android (Google) Code Review

View File

@@ -171,8 +171,9 @@ public class ViewRootInsetsControllerHost implements InsetsController.Host {
public void setSystemBarsAppearance(int appearance, int mask) { public void setSystemBarsAppearance(int appearance, int mask) {
mViewRoot.mWindowAttributes.privateFlags |= PRIVATE_FLAG_APPEARANCE_CONTROLLED; mViewRoot.mWindowAttributes.privateFlags |= PRIVATE_FLAG_APPEARANCE_CONTROLLED;
final InsetsFlags insetsFlags = mViewRoot.mWindowAttributes.insetsFlags; final InsetsFlags insetsFlags = mViewRoot.mWindowAttributes.insetsFlags;
if (insetsFlags.appearance != appearance) { final int newAppearance = (insetsFlags.appearance & ~mask) | (appearance & mask);
insetsFlags.appearance = (insetsFlags.appearance & ~mask) | (appearance & mask); if (insetsFlags.appearance != newAppearance) {
insetsFlags.appearance = newAppearance;
mViewRoot.mWindowAttributesChanged = true; mViewRoot.mWindowAttributesChanged = true;
mViewRoot.scheduleTraversals(); mViewRoot.scheduleTraversals();
} }