From c8c9c286b475887edd916dc7cd4a06e8116dc77f Mon Sep 17 00:00:00 2001 From: lumark Date: Mon, 3 Dec 2018 16:11:16 +0800 Subject: [PATCH] IMM#showInputMethodPickerFromSystem for supporting multi-display. Derived from IMM#showInputMethodPicker(bool) @hide function, rename it as showInputMethodPickerFromSystem and added displayId parameter to let system caller can deside which display to show input method picker dialog. Bug: 120050928 Test: manual, verify the IME switcher dialog can be shown on the external display when: 1) Launch CryptKeeper activity to the external display via command: adb shell am start -e "com.android.settings.CryptKeeper.DEBUG_FORCE_VIEW" \ "password" -n com.android.settings/.CryptKeeper --display 1 --windowingMode 1 2) Pressing the IME switcher button in CryptKeeper activity. Test: atest InputMethodManagerTest#testShowInputMethodPicker Change-Id: I58f4e7b00eb271d426ba5b1125e9f129dac53f1d --- src/com/android/settings/CryptKeeper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java index 1f331d7a635..6c369ef8c44 100644 --- a/src/com/android/settings/CryptKeeper.java +++ b/src/com/android/settings/CryptKeeper.java @@ -773,9 +773,10 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList if (imeSwitcher != null && hasMultipleEnabledIMEsOrSubtypes(imm, false)) { imeSwitcher.setVisibility(View.VISIBLE); imeSwitcher.setOnClickListener(new OnClickListener() { - @Override + @Override public void onClick(View v) { - imm.showInputMethodPicker(false /* showAuxiliarySubtypes */); + imm.showInputMethodPickerFromSystem(false /* showAuxiliarySubtypes */, + v.getDisplay().getDisplayId()); } }); }