Merge "Unregister ImeInsetsSourceConsumer when focus lost" into qt-dev
am: c1a0fbcec5
Change-Id: Idde12e81d4f41ab039823470302e099a3c225f68
This commit is contained in:
@@ -85,6 +85,7 @@ public final class ImeInsetsSourceConsumer extends InsetsSourceConsumer {
|
||||
@Override
|
||||
public void onWindowFocusLost() {
|
||||
mHasWindowFocus = false;
|
||||
getImm().unregisterImeConsumer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1950,6 +1950,23 @@ public final class InputMethodManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister for IME state callbacks and applying visibility in
|
||||
* {@link android.view.ImeInsetsSourceConsumer}.
|
||||
* @hide
|
||||
*/
|
||||
public void unregisterImeConsumer(@NonNull ImeInsetsSourceConsumer imeInsetsConsumer) {
|
||||
if (imeInsetsConsumer == null) {
|
||||
throw new IllegalStateException("ImeInsetsSourceConsumer cannot be null.");
|
||||
}
|
||||
|
||||
synchronized (mH) {
|
||||
if (mImeInsetsConsumer == imeInsetsConsumer) {
|
||||
mImeInsetsConsumer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call showSoftInput with currently focused view.
|
||||
* @return {@code true} if IME can be shown.
|
||||
|
||||
Reference in New Issue
Block a user