summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
authorTarandeep Singh <tarandeep@google.com>2019-01-29 18:09:15 -0800
committerTarandeep Singh <tarandeep@google.com>2019-02-04 12:41:24 -0800
commit46d59f0ecb19fc586aecbe3008fd4661f20e98ef (patch)
tree444b1fff5b83e206457329263c21867911eb8bce /core/java/android/inputmethodservice/InputMethodService.java
parent215929b6f268f60738753df1bf68556d1edc8076 (diff)
Link InsetsController to IME (IME transitons 4/n)
With this change, InsetsController.show/hide now links to IME. This also takes care of animating IME along with other types. Insets API are reactive i.e. they remain in sync with state of IME. Test: atest InsetsControllerTest Test: atest ImeInsetsConsumerTest Bug: 118118435 Change-Id: Ib3997487bd19351d1d23bc70173fc9bdfd23a704
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 333cfbd400dd..ab630fd7467b 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -592,7 +592,6 @@ public class InputMethodService extends AbstractInputMethodService {
final boolean wasVisible = mIsPreRendered
? mDecorViewVisible && mWindowVisible : isInputViewShown();
if (mIsPreRendered) {
- // TODO: notify visibility to insets consumer.
if (DEBUG) {
Log.v(TAG, "Making IME window invisible");
}
@@ -658,6 +657,11 @@ public class InputMethodService extends AbstractInputMethodService {
}
}
+ private void notifyImeHidden() {
+ setImeWindowStatus(IME_ACTIVE | IME_INVISIBLE, mBackDisposition);
+ onPreRenderedWindowVisibilityChanged(false /* setVisible */);
+ }
+
private void setImeWindowStatus(int visibilityFlags, int backDisposition) {
mPrivOps.setImeWindowStatus(visibilityFlags, backDisposition);
}
@@ -760,6 +764,14 @@ public class InputMethodService extends AbstractInputMethodService {
}
InputMethodService.this.onUpdateCursorAnchorInfo(info);
}
+
+ /**
+ * Notify IME that window is hidden.
+ * @hide
+ */
+ public final void notifyImeHidden() {
+ InputMethodService.this.notifyImeHidden();
+ }
}
/**