Commit a5ce12d9 authored by Yuichiro Hanada's avatar Yuichiro Hanada Committed by Commit Bot

Fix keyboard type when Android IME is used.

After crrev.com/c/1291350, OnKeyboardEnabledChanged is called with false
when Android IME is used.
This CL is a workaround for it. For longer term solution, please see
the linked bug.

Bug: 897655
Test: Gboard shows up in tablet mode.
Change-Id: I1047716212f1a4ec782b108fe02cdbef29aa2c6d
Reviewed-on: https://chromium-review.googlesource.com/c/1293106
Commit-Queue: Yuichiro Hanada <yhanada@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601851}
parent 39d3c649
......@@ -336,8 +336,13 @@ void Keyboard::OnSurfaceFocused(Surface* gained_focus) {
// keyboard::KeyboardControllerObserver overrides:
void Keyboard::OnKeyboardEnabledChanged(bool enabled) {
if (device_configuration_delegate_)
device_configuration_delegate_->OnKeyboardTypeChanged(!enabled);
if (device_configuration_delegate_) {
// Ignore kAndroidDisabled which affects |enabled| and just test for a11y
// and touch enabled keyboards. TODO(yhanada): Fix this using an Android
// specific KeyboardUI implementation. https://crbug.com/897655.
bool is_physical = !IsVirtualKeyboardEnabled();
device_configuration_delegate_->OnKeyboardTypeChanged(is_physical);
}
}
////////////////////////////////////////////////////////////////////////////////
......
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