Reset IME visible types only when losing control
This partially resets a change from [1], as we should only reset the
requested visible types for the IME when we are losing the control,
regardless of whether the IME window is currently available (signaled
by the leash being available).
[1]: I2fb3bf1dc057f85a9f8ad0166ec25519aa004905
Bug: 328374719
Test: n/a
Change-Id: I83c24c7c05b828b26ef51b9ae2fbf69366a3b1dc
diff --git a/core/java/android/view/ImeInsetsSourceConsumer.java b/core/java/android/view/ImeInsetsSourceConsumer.java
index b300022..6caf4d6 100644
--- a/core/java/android/view/ImeInsetsSourceConsumer.java
+++ b/core/java/android/view/ImeInsetsSourceConsumer.java
@@ -196,11 +196,11 @@
if (!super.setControl(control, showTypes, hideTypes)) {
return false;
}
- final boolean hasLeash = control != null && control.getLeash() != null;
- if (!hasLeash && !mIsRequestedVisibleAwaitingLeash) {
+ if (control == null && !mIsRequestedVisibleAwaitingLeash) {
mController.setRequestedVisibleTypes(0 /* visibleTypes */, getType());
removeSurface();
}
+ final boolean hasLeash = control != null && control.getLeash() != null;
if (hasLeash) {
mIsRequestedVisibleAwaitingLeash = false;
}