diff options
| -rw-r--r-- | core/java/android/view/InsetsSourceConsumer.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/core/java/android/view/InsetsSourceConsumer.java b/core/java/android/view/InsetsSourceConsumer.java index 2dcfd899adf4..58ec9ec11e56 100644 --- a/core/java/android/view/InsetsSourceConsumer.java +++ b/core/java/android/view/InsetsSourceConsumer.java @@ -200,6 +200,15 @@ public class InsetsSourceConsumer { } boolean applyLocalVisibilityOverride() { + return applyLocalVisibilityOverride(false /* notifyWithoutControl */); + } + + /** + * @param notifyWithoutControl set it true when the caller wants to notify the visibility + * changes even if the consumer doesn't have the control. + * @return true if it needs to notify the visibility changes to the controller + */ + private boolean applyLocalVisibilityOverride(boolean notifyWithoutControl) { InsetsSource source = mState.peekSource(mType); final boolean isVisible = source != null && source.isVisible(); final boolean hasControl = mSourceControl != null; @@ -211,7 +220,7 @@ public class InsetsSourceConsumer { // If we don't have control, we are not able to change the visibility. if (!hasControl) { - return false; + return notifyWithoutControl; } if (isVisible == mRequestedVisible) { return false; @@ -293,7 +302,9 @@ public class InsetsSourceConsumer { mRequestedVisible = requestedVisible; mIsAnimationPending = false; } - if (applyLocalVisibilityOverride()) { + // We need to notify the visibility changed even if we don't have mSourceControl in order + // to update color views. + if (applyLocalVisibilityOverride(true /* notifyWithoutControl */)) { mController.notifyVisibilityChanged(); } } |