summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tiger Huang <tigerhuang@google.com> 2021-01-06 20:00:39 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-01-06 20:00:39 +0000
commitcf7891ff68ee50a6e5d457c1b657bf9f41d97236 (patch)
tree6a4b39f166956924584cd6e6dca2dae7756da51b
parent716e202e57bfc3382ea033899b32430d81cdf8be (diff)
parente8bd5284d33386d1c2a7d3109d9ad6cbd08e3423 (diff)
Notify visibility change if source visibility is changed am: e8bd5284d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13292846 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I0e77b4ed58c35aa14a7eaaf089d89c13087033db
-rw-r--r--core/java/android/view/InsetsSourceConsumer.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/core/java/android/view/InsetsSourceConsumer.java b/core/java/android/view/InsetsSourceConsumer.java
index 700dc66fab55..ba40459692f7 100644
--- a/core/java/android/view/InsetsSourceConsumer.java
+++ b/core/java/android/view/InsetsSourceConsumer.java
@@ -113,13 +113,20 @@ public class InsetsSourceConsumer {
InsetsState.typeToString(control.getType()),
mController.getHost().getRootViewTitle()));
}
- // We are loosing control
if (mSourceControl == null) {
+ // We are loosing control
mController.notifyControlRevoked(this);
- // Restore server visibility.
- mState.getSource(getType()).setVisible(
- mController.getLastDispatchedState().getSource(getType()).isVisible());
+ // Check if we need to restore server visibility.
+ final InsetsSource source = mState.getSource(mType);
+ final boolean serverVisibility =
+ mController.getLastDispatchedState().getSourceOrDefaultVisibility(mType);
+ if (source.isVisible() != serverVisibility) {
+ source.setVisible(serverVisibility);
+ mController.notifyVisibilityChanged();
+ }
+
+ // For updateCompatSysUiVisibility
applyLocalVisibilityOverride();
} else {
// We are gaining control, and need to run an animation since previous state