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

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

Merge "Check IME info nullability before switching" into main

parents 5e3c0c44 5f1f7852
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4233,6 +4233,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            @NonNull UserData userData) {
        final var bindingController = userData.mBindingController;
        final var currentImi = bindingController.getSelectedMethod();
        if (currentImi == null) {
            return false;
        }
        final ImeSubtypeListItem nextSubtype = userData.mSwitchingController
                .getNextInputMethodLocked(onlyCurrentIme, currentImi,
                        bindingController.getCurrentSubtype(),
@@ -4250,6 +4253,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
    private boolean shouldOfferSwitchingToNextInputMethodLocked(@NonNull UserData userData) {
        final var bindingController = userData.mBindingController;
        final var currentImi = bindingController.getSelectedMethod();
        if (currentImi == null) {
            return false;
        }
        final ImeSubtypeListItem nextSubtype = userData.mSwitchingController
                .getNextInputMethodLocked(false /* onlyCurrentIme */, currentImi,
                        bindingController.getCurrentSubtype(),
+1 −4
Original line number Diff line number Diff line
@@ -686,11 +686,8 @@ final class InputMethodSubtypeSwitchingController {
     */
    @Nullable
    public ImeSubtypeListItem getNextInputMethodLocked(boolean onlyCurrentIme,
            @Nullable InputMethodInfo imi, @Nullable InputMethodSubtype subtype,
            @NonNull InputMethodInfo imi, @Nullable InputMethodSubtype subtype,
            @SwitchMode int mode, boolean forward) {
        if (imi == null) {
            return null;
        }
        if (Flags.imeSwitcherRevamp()) {
            return mRotationList.next(imi, subtype, onlyCurrentIme,
                    isRecency(mode, forward), forward);