Skip to content

Commit f043de9

Browse files
author
Amith Yamasani
committed
Fix a crash in InputMethodManagerService due to permission failure.
Clear calling identity before sending broadcast to the current user. Bug: 7403829 Change-Id: If2b27d07d917b892470163e1303883b29a86c0e4
1 parent cd79b35 commit f043de9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

services/java/com/android/server/InputMethodManagerService.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,12 @@ public boolean notifySuggestionPicked(SuggestionSpan span, String originalString
15611561
intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_BEFORE, originalString);
15621562
intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_AFTER, suggestions[index]);
15631563
intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_HASHCODE, span.hashCode());
1564-
mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT);
1564+
final long ident = Binder.clearCallingIdentity();
1565+
try {
1566+
mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT);
1567+
} finally {
1568+
Binder.restoreCallingIdentity(ident);
1569+
}
15651570
return true;
15661571
}
15671572
}

0 commit comments

Comments
 (0)