aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod
diff options
context:
space:
mode:
authorChieu Nguyen <cvnguyen@google.com>2015-03-18 22:42:23 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-18 22:42:23 +0000
commit56391ce7c7ee1d8ed86d83ac1e49d1714154f126 (patch)
tree56fdb6b016ca6fde358b4ae0a2fe136292ded7da /java/src/com/android/inputmethod
parentfe316820b9e1d8d52ca86e7fd1787ac4f574fa0c (diff)
parentb56f7d8ca47e5936afe0459928bae49cae6e3615 (diff)
downloadlatinime-56391ce7c7ee1d8ed86d83ac1e49d1714154f126.tar.gz
latinime-56391ce7c7ee1d8ed86d83ac1e49d1714154f126.tar.xz
latinime-56391ce7c7ee1d8ed86d83ac1e49d1714154f126.zip
am b56f7d8c: Merge "Disable message if personalization is disabled."
* commit 'b56f7d8ca47e5936afe0459928bae49cae6e3615': Disable message if personalization is disabled.
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java2
-rw-r--r--java/src/com/android/inputmethod/latin/settings/SettingsValues.java4
-rw-r--r--java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java3
-rw-r--r--java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java8
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;
}