Support IMEs that have no subtype in PhysicalKeyboardFragment.
With a Framework-side change [1], InputManager#{get, set}KeyboardLayoutForInputDevice() are now able to deal with null InputMethodSubtype as a valid input. With this CL, we no longer filter out IMEs that do not support subtypes in PhysicalKeyboardFragment. [1]: Ia013784a594ad3beaf30976d047f5ac0fa8185be Bug: 28182650 Change-Id: I46b9c5b018f08e3eaa4614a0893db0be91652f3c
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.settings.inputmethod;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.app.Activity;
|
||||
import android.hardware.input.InputDeviceIdentifier;
|
||||
import android.hardware.input.InputManager;
|
||||
@@ -45,6 +46,7 @@ public final class KeyboardLayoutPickerFragment2 extends SettingsPreferenceFragm
|
||||
private int mInputDeviceId = -1;
|
||||
private InputManager mIm;
|
||||
private InputMethodInfo mImi;
|
||||
@Nullable
|
||||
private InputMethodSubtype mSubtype;
|
||||
private KeyboardLayout[] mKeyboardLayouts;
|
||||
private Map<Preference, KeyboardLayout> mPreferenceMap = new HashMap<>();
|
||||
@@ -82,7 +84,7 @@ public final class KeyboardLayoutPickerFragment2 extends SettingsPreferenceFragm
|
||||
mImi = activity.getIntent().getParcelableExtra(EXTRA_INPUT_METHOD_INFO);
|
||||
mSubtype = activity.getIntent().getParcelableExtra(EXTRA_INPUT_METHOD_SUBTYPE);
|
||||
|
||||
if (mInputDeviceIdentifier == null || mImi == null || mSubtype == null) {
|
||||
if (mInputDeviceIdentifier == null || mImi == null) {
|
||||
activity.finish();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user