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

Commit c67cb454 authored by Cosmin Băieș's avatar Cosmin Băieș Committed by Android (Google) Code Review
Browse files

Merge "Allow no item selected in IME Switcher Menu" into main

parents 43f50774 79077a65
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -98,7 +98,10 @@ final class InputMethodMenuController {
        final int size = imList.size();
        mIms = new InputMethodInfo[size];
        mSubtypeIds = new int[size];
        int checkedItem = 0;
        // No items are checked by default. When we have a list of explicitly enabled subtypes,
        // the implicit subtype is no longer listed, but if it is still the selected one,
        // no items will be shown as checked.
        int checkedItem = -1;
        for (int i = 0; i < size; ++i) {
            final ImeSubtypeListItem item = imList.get(i);
            mIms[i] = item.mImi;
@@ -113,6 +116,12 @@ final class InputMethodMenuController {
            }
        }

        if (checkedItem == -1) {
            Slog.w(TAG, "Switching menu shown with no item selected"
                    + ", IME id: " + preferredInputMethodId
                    + ", subtype index: " + preferredInputMethodSubtypeId);
        }

        if (mDialogWindowContext == null) {
            mDialogWindowContext = new InputMethodDialogWindowContext();
        }