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

Commit 424a976e authored by Kurt Partridge's avatar Kurt Partridge Committed by Android (Google) Code Review
Browse files

Merge "Ensure Preference listener is unregistered"

parents 64c34122 7e2c1e69
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -561,6 +561,9 @@ public final class LatinIME extends InputMethodService implements KeyboardAction
        }
        mSettings.onDestroy();
        unregisterReceiver(mReceiver);
        if (ProductionFlag.IS_EXPERIMENTAL) {
            ResearchLogger.getInstance().onDestroy();
        }
        // TODO: The experimental version is not supported by the Dictionary Pack Service yet.
        if (!ProductionFlag.IS_EXPERIMENTAL) {
            unregisterReceiver(mDictionaryPackInstallReceiver);
+6 −0
Original line number Diff line number Diff line
@@ -322,6 +322,12 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
        mMainKeyboardView = null;
    }

    public void onDestroy() {
        if (mPrefs != null) {
            mPrefs.unregisterOnSharedPreferenceChangeListener(this);
        }
    }

    private boolean hasSeenSplash() {
        return mPrefs.getBoolean(PREF_RESEARCH_HAS_SEEN_SPLASH, false);
    }