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

Commit 0c5feb22 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Remove an unnecessary null check

This is a preparation before fixing Bug 27859687.

Previously

  MyPackageMonitor#onFinishPackageChangesInternal()

skipped several tasks when

  Settings.Secure.DEFAULT_INPUT_METHOD

is empty.

This check does not make much sense and should be removed.

Bug: 27859687
Bug: 322062773
Test: atest CtsInputMethodInstallTestCases:AdditionalSubtypeLifecycleTest
Change-Id: I07e32739f486d960c9dd22476120fa35bf1899e4
parent aa0f8a40
Loading
Loading
Loading
Loading
+17 −22
Original line number Diff line number Diff line
@@ -1408,7 +1408,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                String curInputMethodId = mSettings.getSelectedInputMethod();
                final List<InputMethodInfo> methodList = mSettings.getMethodList();
                final int numImes = methodList.size();
                if (curInputMethodId != null) {
                for (int i = 0; i < numImes; i++) {
                    InputMethodInfo imi = methodList.get(i);
                    final String imiId = imi.getId();
@@ -1417,14 +1416,11 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                    }

                    int change = isPackageDisappearing(imi.getPackageName());
                        if (change == PACKAGE_TEMPORARY_CHANGE
                                || change == PACKAGE_PERMANENT_CHANGE) {
                            Slog.i(TAG, "Input method uninstalled, disabling: "
                                    + imi.getComponent());
                    if (change == PACKAGE_TEMPORARY_CHANGE || change == PACKAGE_PERMANENT_CHANGE) {
                        Slog.i(TAG, "Input method uninstalled, disabling: " + imi.getComponent());
                        setInputMethodEnabledLocked(imi.getId(), false);
                    } else if (change == PACKAGE_UPDATING) {
                            Slog.i(TAG,
                                    "Input method reinstalling, clearing additional subtypes: "
                        Slog.i(TAG, "Input method reinstalling, clearing additional subtypes: "
                                + imi.getComponent());
                        mAdditionalSubtypeMap =
                                mAdditionalSubtypeMap.cloneWithRemoveOrSelf(imi.getId());
@@ -1432,7 +1428,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                                mSettings.getMethodMap(), mSettings.getUserId());
                    }
                }
                }

                buildInputMethodListLocked(false /* resetDefaultEnabledIme */);