summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikael Gullstrand <mikael.gullstrand@sonymobile.com>2014-11-25 12:41:53 +0100
committerZoran Jovanovic <zoran.jovanovic@sonymobile.com>2015-01-26 10:03:21 +0000
commit82ae3ff4cf268f577e19c410b120314cdc11a191 (patch)
tree8541e8feceeaea0541c7bf4ae911b0f286a1d8ed
parentfc54573373ff965aa40cccdc1ab11c1c880c8930 (diff)
downloadframeworks_base-82ae3ff4cf268f577e19c410b120314cdc11a191.zip
frameworks_base-82ae3ff4cf268f577e19c410b120314cdc11a191.tar.gz
frameworks_base-82ae3ff4cf268f577e19c410b120314cdc11a191.tar.bz2
Call startInput on return from sleep mode
One manifestation of the problem was that input string disappeared when returning from sleep mode. When editing a TextView with an IME in landscape orientation, the text would disappear when returning from sleep mode. The InputMethodManager would be deactivated when the screen was put into sleep mode as well as the input connection. However when returning from sleep mode the InputMethodManager was activated, but the input connection would not be activated again. The solution is to check focus of the InputMethodManager which will create a new active input connection to use. The change is however not specific to this one problem but fundamentally addresses the issue of lack of startInput on return from sleep mode. Change-Id: I95d05110bc1cf310fad23ea1bcbc5890f642d1fc
-rw-r--r--core/java/android/view/inputmethod/InputMethodManager.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index b56378f..325ffdd 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -494,19 +494,17 @@ public final class InputMethodManager {
mIInputContext.finishComposingText();
} catch (RemoteException e) {
}
- // Check focus again in case that "onWindowFocus" is called before
- // handling this message.
- if (mServedView != null && mServedView.hasWindowFocus()) {
- // "finishComposingText" has been already called above. So we
- // should not call mServedInputConnection.finishComposingText here.
- // Also, please note that this handler thread could be different
- // from a thread that created mServedView. That could happen
- // the current activity is running in the system process.
- // In that case, we really should not call
- // mServedInputConnection.finishComposingText.
- if (checkFocusNoStartInput(mHasBeenInactive, false)) {
- startInputInner(null, 0, 0, 0);
- }
+ }
+ // Check focus again in case that "onWindowFocus" is called before
+ // handling this message.
+ if (mServedView != null && mServedView.hasWindowFocus()) {
+ // Please note that this handler thread could be different
+ // from a thread that created mServedView. That could happen
+ // the current activity is running in the system process.
+ // In that case, we really should not call
+ // mServedInputConnection.finishComposingText.
+ if (checkFocusNoStartInput(mHasBeenInactive, false)) {
+ startInputInner(null, 0, 0, 0);
}
}
}