summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-09-14 18:55:58 +0900
committersatok <satok@google.com>2011-09-14 21:37:04 +0900
commitf17db9f5257011d5331d27a6da7d4e6fddde1e08 (patch)
tree9f7939dcd82ee0261d07201011a4a9b6b5e0c833 /core/java/android/inputmethodservice/InputMethodService.java
parentaab55bf3e323b73062bd932682886b19c062a8a0 (diff)
Call onFinishInputView in onDestroy
onFinishInputView is called in InputMethodService#hideWindow but not in onDestroy. For closing IMS safely, onFinishInputView should be called in onDestroy. Bug: 5265534 Bug: 4697071 Change-Id: I2947b62326e3e0644f1c079eafc839a9981e902b
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index d2efffffe97f..60188eab2250 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -687,6 +687,7 @@ public class InputMethodService extends AbstractInputMethodService {
super.onDestroy();
mRootView.getViewTreeObserver().removeOnComputeInternalInsetsListener(
mInsetsComputer);
+ finishViews();
if (mWindowAdded) {
// Disable exit animation for the current IME window
// to avoid the race condition between the exit and enter animations
@@ -695,7 +696,7 @@ public class InputMethodService extends AbstractInputMethodService {
mWindow.dismiss();
}
}
-
+
/**
* Take care of handling configuration changes. Subclasses of
* InputMethodService generally don't need to deal directly with
@@ -1436,7 +1437,7 @@ public class InputMethodService extends AbstractInputMethodService {
}
}
- public void hideWindow() {
+ private void finishViews() {
if (mInputViewStarted) {
if (DEBUG) Log.v(TAG, "CALL: onFinishInputView");
onFinishInputView(false);
@@ -1446,6 +1447,10 @@ public class InputMethodService extends AbstractInputMethodService {
}
mInputViewStarted = false;
mCandidatesViewStarted = false;
+ }
+
+ public void hideWindow() {
+ finishViews();
mImm.setImeWindowStatus(mToken, 0, mBackDisposition);
if (mWindowVisible) {
mWindow.hide();