Logically revert "Directly show the layout selection screen."
This is logical revert of a CL [1] that was recently re-introduced as part of my recent CL [2]. Reason for revert: Directly showing the layout selection screen when there is no hardware keyboard is selected yet is not something people had been familiar with. That behavior had been enabled only in a short period during Android N development cycle and was never enabled in most of production builds. To avoid confusions, let's revert back to the true Android M behavior by logically reverting that change. [1]: I4483dfc89afc8d148b2cfa7c6a5f66d2a02f712a17b6319884
[2]: I7a2ed6dd39dcd8207d3d94e12cd01d5d67ba4bb57129b374bb
Change-Id: If0529e20cbff432d38d9b2dd74eeb3af0da5baf1 Bug: 66498367 Fix: 75318417 Test: Manually verified
This commit is contained in:
@@ -55,7 +55,6 @@ public class KeyboardLayoutDialogFragment extends InstrumentedDialogFragment
|
|||||||
private int mInputDeviceId = -1;
|
private int mInputDeviceId = -1;
|
||||||
private InputManager mIm;
|
private InputManager mIm;
|
||||||
private KeyboardLayoutAdapter mAdapter;
|
private KeyboardLayoutAdapter mAdapter;
|
||||||
private boolean mHasShownLayoutSelectionScreen;
|
|
||||||
|
|
||||||
public KeyboardLayoutDialogFragment() {
|
public KeyboardLayoutDialogFragment() {
|
||||||
}
|
}
|
||||||
@@ -187,7 +186,6 @@ public class KeyboardLayoutDialogFragment extends InstrumentedDialogFragment
|
|||||||
dialog.getListView().setItemChecked(data.current, true);
|
dialog.getListView().setItemChecked(data.current, true);
|
||||||
}
|
}
|
||||||
updateSwitchHintVisibility();
|
updateSwitchHintVisibility();
|
||||||
showSetupKeyboardLayoutsIfNecessary();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -222,17 +220,6 @@ public class KeyboardLayoutDialogFragment extends InstrumentedDialogFragment
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showSetupKeyboardLayoutsIfNecessary() {
|
|
||||||
AlertDialog dialog = (AlertDialog)getDialog();
|
|
||||||
if (dialog != null
|
|
||||||
&& mAdapter.getCount() == 1 && mAdapter.getItem(0) == null
|
|
||||||
&& !mHasShownLayoutSelectionScreen) {
|
|
||||||
mHasShownLayoutSelectionScreen = true;
|
|
||||||
((OnSetupKeyboardLayoutsListener)getTargetFragment()).onSetupKeyboardLayouts(
|
|
||||||
mInputDeviceIdentifier);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final class KeyboardLayoutAdapter extends ArrayAdapter<KeyboardLayout> {
|
private static final class KeyboardLayoutAdapter extends ArrayAdapter<KeyboardLayout> {
|
||||||
private final LayoutInflater mInflater;
|
private final LayoutInflater mInflater;
|
||||||
private int mCheckedItem = -1;
|
private int mCheckedItem = -1;
|
||||||
|
@@ -187,14 +187,11 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showKeyboardLayoutDialog(InputDeviceIdentifier inputDeviceIdentifier) {
|
private void showKeyboardLayoutDialog(InputDeviceIdentifier inputDeviceIdentifier) {
|
||||||
KeyboardLayoutDialogFragment fragment = (KeyboardLayoutDialogFragment)
|
KeyboardLayoutDialogFragment fragment = new KeyboardLayoutDialogFragment(
|
||||||
getFragmentManager().findFragmentByTag("keyboardLayout");
|
inputDeviceIdentifier);
|
||||||
if (fragment == null) {
|
|
||||||
fragment = new KeyboardLayoutDialogFragment(inputDeviceIdentifier);
|
|
||||||
fragment.setTargetFragment(this, 0);
|
fragment.setTargetFragment(this, 0);
|
||||||
fragment.show(getActivity().getFragmentManager(), "keyboardLayout");
|
fragment.show(getActivity().getFragmentManager(), "keyboardLayout");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void registerShowVirtualKeyboardSettingsObserver() {
|
private void registerShowVirtualKeyboardSettingsObserver() {
|
||||||
unregisterShowVirtualKeyboardSettingsObserver();
|
unregisterShowVirtualKeyboardSettingsObserver();
|
||||||
|
Reference in New Issue
Block a user