Commit 87b43498 authored by Yuichiro Hanada's avatar Yuichiro Hanada Committed by Commit Bot

Check IMM and the active state of IMM before using it.

As we found out in crrev.com/c/1774906, IMM instance or the active state
of it can be stale in some condition.
This CL is a workaround for the crash until we fix the root cause.

Bug: 1000556
Change-Id: Ia1fb798d5308b752c5a30a0ac9c4fc172fe7f315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810878
Commit-Queue: Yuichiro Hanada <yhanada@chromium.org>
Reviewed-by: default avatarKeith Lee <keithlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699244}
parent 0fbe3753
......@@ -358,9 +358,14 @@ void ArcInputMethodManagerService::OnImeInfoChanged(
using chromeos::input_method::InputMethodDescriptors;
using chromeos::input_method::InputMethodManager;
InputMethodManager* imm = InputMethodManager::Get();
if (!imm || !imm->GetActiveIMEState()) {
LOG(WARNING) << "InputMethodManager is not ready yet.";
return;
}
base::AutoReset<bool> in_updating(&is_updating_imm_entry_, true);
scoped_refptr<InputMethodManager::State> state =
InputMethodManager::Get()->GetActiveIMEState();
scoped_refptr<InputMethodManager::State> state = imm->GetActiveIMEState();
const std::string active_ime_id = state->GetCurrentInputMethod().id();
// Remove the old registered entry.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment