Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f043de93 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Fix a crash in InputMethodManagerService due to permission failure.

Clear calling identity before sending broadcast to the current user.

Bug: 7403829
Change-Id: If2b27d07d917b892470163e1303883b29a86c0e4
parent cd79b35c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1561,7 +1561,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_BEFORE, originalString);
                intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_AFTER, suggestions[index]);
                intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_HASHCODE, span.hashCode());
                final long ident = Binder.clearCallingIdentity();
                try {
                    mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT);
                } finally {
                    Binder.restoreCallingIdentity(ident);
                }
                return true;
            }
        }