Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 690f103c authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

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]: I4483dfc89afc8d148b2cfa7c6a5f66d2a02f712a
      17b63198
 [2]: I7a2ed6dd39dcd8207d3d94e12cd01d5d67ba4bb5
      7129b374

Change-Id: If0529e20cbff432d38d9b2dd74eeb3af0da5baf1
Bug: 66498367
Fix: 75318417
Test: Manually verified
parent 8837f992
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -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;
+4 −7
Original line number Diff line number Diff line
@@ -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();