summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorTiger Huang <tigerhuang@google.com>2022-03-25 06:15:12 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-03-25 06:15:12 +0000
commitbaedc4fdda39332d5a06e6ff8b5a83e48bd5f37f (patch)
tree80b5d40f5532551d4c0cb96b979e828e50dd5de5 /core
parent0c19f57c37ac18300df8b453380712d881423232 (diff)
parent43047efed7fe21c4b149362d9a259fe648d0045d (diff)
Merge "Fix setSystemBarsAppearances" into sc-v2-dev
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/ViewRootInsetsControllerHost.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/view/ViewRootInsetsControllerHost.java b/core/java/android/view/ViewRootInsetsControllerHost.java
index efffa2b05a1e..aba79d5b87c3 100644
--- a/core/java/android/view/ViewRootInsetsControllerHost.java
+++ b/core/java/android/view/ViewRootInsetsControllerHost.java
@@ -171,8 +171,9 @@ public class ViewRootInsetsControllerHost implements InsetsController.Host {
public void setSystemBarsAppearance(int appearance, int mask) {
mViewRoot.mWindowAttributes.privateFlags |= PRIVATE_FLAG_APPEARANCE_CONTROLLED;
final InsetsFlags insetsFlags = mViewRoot.mWindowAttributes.insetsFlags;
- if (insetsFlags.appearance != appearance) {
- insetsFlags.appearance = (insetsFlags.appearance & ~mask) | (appearance & mask);
+ final int newAppearance = (insetsFlags.appearance & ~mask) | (appearance & mask);
+ if (insetsFlags.appearance != newAppearance) {
+ insetsFlags.appearance = newAppearance;
mViewRoot.mWindowAttributesChanged = true;
mViewRoot.scheduleTraversals();
}