Merge "Ensure Preference listener is unregistered"
This commit is contained in:
commit
424a976e58
2 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue