Merge "Logically revert "Directly show the layout selection screen."" into pi-dev

am: cb601396d4

Change-Id: I4ed2afd0c84e3419a598612653c7347978a2e9f8
This commit is contained in:
Yohei Yukawa
2018-03-21 15:21:01 +00:00
committed by android-build-merger
2 changed files with 4 additions and 20 deletions

View File

@@ -55,7 +55,6 @@ public class KeyboardLayoutDialogFragment extends InstrumentedDialogFragment
private int mInputDeviceId = -1;
private InputManager mIm;
private KeyboardLayoutAdapter mAdapter;
private boolean mHasShownLayoutSelectionScreen;
public KeyboardLayoutDialogFragment() {
}
@@ -187,7 +186,6 @@ public class KeyboardLayoutDialogFragment extends InstrumentedDialogFragment
dialog.getListView().setItemChecked(data.current, true);
}
updateSwitchHintVisibility();
showSetupKeyboardLayoutsIfNecessary();
}
@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 final LayoutInflater mInflater;
private int mCheckedItem = -1;

View File

@@ -187,14 +187,11 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
}
private void showKeyboardLayoutDialog(InputDeviceIdentifier inputDeviceIdentifier) {
KeyboardLayoutDialogFragment fragment = (KeyboardLayoutDialogFragment)
getFragmentManager().findFragmentByTag("keyboardLayout");
if (fragment == null) {
fragment = new KeyboardLayoutDialogFragment(inputDeviceIdentifier);
KeyboardLayoutDialogFragment fragment = new KeyboardLayoutDialogFragment(
inputDeviceIdentifier);
fragment.setTargetFragment(this, 0);
fragment.show(getActivity().getFragmentManager(), "keyboardLayout");
}
}
private void registerShowVirtualKeyboardSettingsObserver() {
unregisterShowVirtualKeyboardSettingsObserver();