summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-09-02 23:11:16 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-09-02 23:11:16 -0700
commite3c393d3d14dab5b1eab37d2c52b7283df253f7f (patch)
tree63e7b8becc207bc0aff95dcc2f9a53a39a03efed /services
parente2c9187b993a652fa8fdad516461ab66caa96cb4 (diff)
parentcc27870098a5b6105d6007a18bebaec8940db2d5 (diff)
downloadframeworks_base-e3c393d3d14dab5b1eab37d2c52b7283df253f7f.zip
frameworks_base-e3c393d3d14dab5b1eab37d2c52b7283df253f7f.tar.gz
frameworks_base-e3c393d3d14dab5b1eab37d2c52b7283df253f7f.tar.bz2
Merge change 23787 into eclair
* changes: Fix issue #2097313: Latin IME crashes first use
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java36
1 files changed, 24 insertions, 12 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 3c37b49..558a024 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -516,7 +516,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
synchronized (mMethodMap) {
if (!mSystemReady) {
mSystemReady = true;
- startInputInnerLocked();
+ try {
+ startInputInnerLocked();
+ } catch (RuntimeException e) {
+ Log.w(TAG, "Unexpected exception", e);
+ }
}
}
}
@@ -749,7 +753,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
if (!mSystemReady) {
// If the system is not yet ready, we shouldn't be running third
// party code.
- return new InputBindResult(null, mCurId, mCurSeq);
+ return new InputBindResult(null, mCurMethodId, mCurSeq);
}
InputMethodInfo info = mMethodMap.get(mCurMethodId);
@@ -802,17 +806,20 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
synchronized (mMethodMap) {
if (mCurIntent != null && name.equals(mCurIntent.getComponent())) {
mCurMethod = IInputMethod.Stub.asInterface(service);
+ if (mCurToken == null) {
+ Log.w(TAG, "Service connected without a token!");
+ unbindCurrentMethodLocked(false);
+ return;
+ }
+ if (DEBUG) Log.v(TAG, "Initiating attach with token: " + mCurToken);
+ executeOrSendMessage(mCurMethod, mCaller.obtainMessageOO(
+ MSG_ATTACH_TOKEN, mCurMethod, mCurToken));
if (mCurClient != null) {
- if (DEBUG) Log.v(TAG, "Initiating attach with token: " + mCurToken);
+ if (DEBUG) Log.v(TAG, "Creating first session while with client "
+ + mCurClient);
executeOrSendMessage(mCurMethod, mCaller.obtainMessageOO(
- MSG_ATTACH_TOKEN, mCurMethod, mCurToken));
- if (mCurClient != null) {
- if (DEBUG) Log.v(TAG, "Creating first session while with client "
- + mCurClient);
- executeOrSendMessage(mCurMethod, mCaller.obtainMessageOO(
- MSG_CREATE_SESSION, mCurMethod,
- new MethodCallback(mCurMethod)));
- }
+ MSG_CREATE_SESSION, mCurMethod,
+ new MethodCallback(mCurMethod)));
}
}
}
@@ -1002,6 +1009,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
mShowExplicitlyRequested = true;
mShowForced = true;
}
+
+ if (!mSystemReady) {
+ return false;
+ }
+
boolean res = false;
if (mCurMethod != null) {
executeOrSendMessage(mCurMethod, mCaller.obtainMessageIOO(
@@ -1637,7 +1649,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
+ " mShowExplicitlyRequested=" + mShowExplicitlyRequested
+ " mShowForced=" + mShowForced
+ " mInputShown=" + mInputShown);
- p.println(" mScreenOn=" + mScreenOn);
+ p.println(" mSystemReady=" + mSystemReady + " mScreenOn=" + mScreenOn);
}
if (client != null) {