summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tiger Huang <tigerhuang@google.com> 2020-06-11 17:50:04 +0800
committer Tiger Huang <tigerhuang@google.com> 2020-06-11 17:50:04 +0800
commit026dec42988ff7f1d30eeb01994c6742f55ae104 (patch)
tree09c707941890f720534506ff4b3b46c3fd9813e3
parent06174db579ff1e30825568b894e6172bc4b044fa (diff)
Don't clear requested SysUI visibility if the source doesn't exist
This makes the SysUI visibility callback compatible with the legacy behavior. Fix: 158639842 Fix: 158643177 Test: atest LayoutTests#testAddingImmersiveWindow Change-Id: Ife06f8aab1b9d86790478665a33961d1b613d62d
-rw-r--r--core/java/android/view/InsetsSourceConsumer.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/view/InsetsSourceConsumer.java b/core/java/android/view/InsetsSourceConsumer.java
index ae70a4971776..3aa246441dbc 100644
--- a/core/java/android/view/InsetsSourceConsumer.java
+++ b/core/java/android/view/InsetsSourceConsumer.java
@@ -18,8 +18,8 @@ package android.view;
import static android.view.InsetsController.ANIMATION_TYPE_NONE;
import static android.view.InsetsController.AnimationType;
-import static android.view.InsetsState.getDefaultVisibility;
import static android.view.InsetsController.DEBUG;
+import static android.view.InsetsState.getDefaultVisibility;
import static android.view.InsetsState.toPublicType;
import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;
@@ -221,9 +221,10 @@ public class InsetsSourceConsumer {
final boolean hasControl = mSourceControl != null;
// We still need to let the legacy app know the visibility change even if we don't have the
- // control.
+ // control. If we don't have the source, we don't change the requested visibility for making
+ // the callback behavior compatible.
mController.updateCompatSysUiVisibility(
- mType, hasControl ? mRequestedVisible : isVisible, hasControl);
+ mType, (hasControl || source == null) ? mRequestedVisible : isVisible, hasControl);
// If we don't have control, we are not able to change the visibility.
if (!hasControl) {