summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/view/InsetsSourceConsumer.java39
1 files changed, 15 insertions, 24 deletions
diff --git a/core/java/android/view/InsetsSourceConsumer.java b/core/java/android/view/InsetsSourceConsumer.java
index 477e35b6e655..391d757365e6 100644
--- a/core/java/android/view/InsetsSourceConsumer.java
+++ b/core/java/android/view/InsetsSourceConsumer.java
@@ -310,21 +310,22 @@ public class InsetsSourceConsumer {
}
final boolean requestedVisible = (mController.getRequestedVisibleTypes() & mType) != 0;
+ // If we don't have control or the leash (in case of the IME), we enforce the
+ // visibility to be hidden, as otherwise we would let the app know too early.
+ if (mSourceControl == null) {
+ if (DEBUG) {
+ Log.d(TAG, TextUtils.formatSimple(
+ "applyLocalVisibilityOverride: No control in %s for type %s, "
+ + "requestedVisible=%s",
+ mController.getHost().getRootViewTitle(),
+ WindowInsets.Type.toString(mType), requestedVisible));
+ }
+ return false;
+ }
if (Flags.refactorInsetsController()) {
- // If we don't have control or the leash (in case of the IME), we enforce the
- // visibility to be hidden, as otherwise we would let the app know too early.
- if (mSourceControl == null) {
- if (DEBUG) {
- Log.d(TAG, TextUtils.formatSimple(
- "applyLocalVisibilityOverride: No control in %s for type %s, "
- + "requestedVisible=%s",
- mController.getHost().getRootViewTitle(),
- WindowInsets.Type.toString(mType), requestedVisible));
- }
- return false;
- // TODO(b/323136120) add a flag to the control, to define whether a leash is needed
- } else if (mId != InsetsSource.ID_IME_CAPTION_BAR
- && mSourceControl.getLeash() == null) {
+ // TODO(b/323136120) add a flag to the control, to define whether a leash is
+ // needed and make it generic for all types
+ if (mId == InsetsSource.ID_IME && mSourceControl.getLeash() == null) {
if (DEBUG) {
Log.d(TAG, TextUtils.formatSimple(
"applyLocalVisibilityOverride: Set the source visibility to false, as"
@@ -338,16 +339,6 @@ public class InsetsSourceConsumer {
// changed state
return wasVisible;
}
- } else {
- // If we don't have control, we are not able to change the visibility.
- if (mSourceControl == null) {
- if (DEBUG) {
- Log.d(TAG, "applyLocalVisibilityOverride: No control in "
- + mController.getHost().getRootViewTitle()
- + " requestedVisible=" + requestedVisible);
- }
- return false;
- }
}
if (source.isVisible() == requestedVisible) {
return false;