diff options
Diffstat (limited to 'java')
4 files changed, 14 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 4ddde1926..a8aeb8795 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1450,7 +1450,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } final boolean shouldShowImportantNotice = - ImportantNoticeUtils.shouldShowImportantNotice(this); + ImportantNoticeUtils.shouldShowImportantNotice(this, currentSettingsValues); final boolean shouldShowSuggestionCandidates = currentSettingsValues.mInputAttributes.mShouldShowSuggestions && currentSettingsValues.isSuggestionsEnabledPerUserSettings(); diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java index e21b9ffca..d112e7200 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java @@ -237,6 +237,10 @@ public class SettingsValues { return mSuggestionsEnabledPerUserSettings; } + public boolean isPersonalizationEnabled() { + return mUsePersonalizedDicts; + } + public boolean isWordSeparator(final int code) { return mSpacingAndPunctuations.isWordSeparator(code); } diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java index 17525f650..7dd0f03df 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java @@ -213,7 +213,8 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick // it has been shown once already or not, and if in the setup wizard). If applicable, it shows // the notice. In all cases, it returns true if it was shown, false otherwise. public boolean maybeShowImportantNoticeTitle() { - if (!ImportantNoticeUtils.shouldShowImportantNotice(getContext())) { + final SettingsValues currentSettingsValues = Settings.getInstance().getCurrent(); + if (!ImportantNoticeUtils.shouldShowImportantNotice(getContext(), currentSettingsValues)) { return false; } if (getWidth() <= 0) { diff --git a/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java b/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java index 142548b25..df0cd8437 100644 --- a/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java @@ -25,6 +25,7 @@ import android.util.Log; import com.android.inputmethod.annotations.UsedForTesting; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.settings.SettingsValues; import java.util.concurrent.TimeUnit; @@ -105,7 +106,12 @@ public final class ImportantNoticeUtils { return elapsedTime >= TIMEOUT_OF_IMPORTANT_NOTICE; } - public static boolean shouldShowImportantNotice(final Context context) { + public static boolean shouldShowImportantNotice(final Context context, + final SettingsValues settingsValues) { + // Check to see whether personalization is enabled by the user. + if (!settingsValues.isPersonalizationEnabled()) { + return false; + } if (!hasNewImportantNotice(context)) { return false; } |