Fix a format mismatch in IMMS#MSG_HARD_KEYBOARD_SWITCH_CHANGED
This CL addresses a regression that
InputMethodManagerService#MSG_HARD_KEYBOARD_SWITCH_CHANGED
uses different data format between the sender and the receiver, which
was introduced in Android L development cycle [1].
This issue becomes observable when and only a hardware keyboard is
attached while the IME switcher dialog is shown hence no one has
noticed it. However we will soon start relying on that signal to
render the IME switcher button in the IME process at Bug 215551357.
Let's fix this before the bug becomes much more obvious there.
[1]: I2237ded850a0d4ab43ca441d0b7df13e0958e630
b64e56aad3ffb267aec44308f57641a4c91caa83
Fix: 215449191
Test: Manually verified with a debugger.
Change-Id: I2dba087f48b37841e7a86ebbd085be0ef72b3f7a
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index ec49b47..06f56c9 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -1782,8 +1782,8 @@
com.android.internal.R.bool.show_ongoing_ime_switcher);
if (mShowOngoingImeSwitcherForPhones) {
mWindowManagerInternal.setOnHardKeyboardStatusChangeListener(available -> {
- mHandler.obtainMessage(MSG_HARD_KEYBOARD_SWITCH_CHANGED, available ? 1 : 0)
- .sendToTarget();
+ mHandler.obtainMessage(MSG_HARD_KEYBOARD_SWITCH_CHANGED,
+ available ? 1 : 0, 0 /* unused */).sendToTarget();
});
}