summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author satok <satok@google.com> 2011-08-31 21:26:04 +0900
committer satok <satok@google.com> 2011-08-31 21:26:04 +0900
commitc593380d1bccbfbd45c404954b2670b65acc287f (patch)
treedd4e112536245e0cc74f71144371a0a068332ed4
parent6b14b23ad586b664aa09dfb46d627782ac00eb74 (diff)
Fix crash in setAdditionalInputMethodSubtypes
Bug: 5142455 Change-Id: I5eca4c1a3d9a964db04c819fc671670ef1b81817
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index ba2438beafbd..bb831f51d07d 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -1682,7 +1682,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
for (int i = 0; i < packageNum; ++i) {
if (packageInfos[i].equals(imi.getPackageName())) {
mFileManager.addInputMethodSubtypes(imi, subtypes);
- buildInputMethodListLocked(mMethodList, mMethodMap);
+ final long ident = Binder.clearCallingIdentity();
+ try {
+ buildInputMethodListLocked(mMethodList, mMethodMap);
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
return true;
}
}
@@ -1707,7 +1712,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
return;
}
- long ident = Binder.clearCallingIdentity();
+ final long ident = Binder.clearCallingIdentity();
try {
setInputMethodLocked(id, subtypeId);
} finally {