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

Commit 767d1e5a authored by wilsonshih's avatar wilsonshih
Browse files

Fix IME crash when leave VR mode.

System server crash when there is no selected input method and leave VR
mode. To avoid crash, we can try to update selected input method from
settings.

Fix: 121271327
Test: Manually remove input methods from device then run
ActivityManagerVrDisplayTests, system server should not crash when leave
VR mode.

Change-Id: I32a7f10d4f69700c2506d65b360fef5806c0e655
parent f846f215
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -403,12 +403,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
    };

    private void restoreNonVrImeFromSettingsNoCheck() {
        mIsVrImeStarted = false;
        // switch back to non-VR InputMethod from settings.
        synchronized (mMethodMap) {
            final String lastInputId = mSettings.getSelectedInputMethod();
            setInputMethodLocked(lastInputId,
                    mSettings.getSelectedInputMethodSubtypeId(lastInputId));
            if (!mIsVrImeStarted) return;
            mIsVrImeStarted = false;
            updateFromSettingsLocked(false);
        }
    }