aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-02-17 08:04:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-02-17 08:04:11 +0000
commit4c628b9d5b05045e9bbe5be7327e28aee2309e1d (patch)
treec7e2be36a5487ab9673d2f04c190093858bd2cd8 /java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java
parent48814037484663faa0d2820b21baf9c3a1bf6bbf (diff)
parentce78a2d8ab7630cff509c2b21b4b11abd8db4795 (diff)
downloadlatinime-4c628b9d5b05045e9bbe5be7327e28aee2309e1d.tar.gz
latinime-4c628b9d5b05045e9bbe5be7327e28aee2309e1d.tar.xz
latinime-4c628b9d5b05045e9bbe5be7327e28aee2309e1d.zip
Merge "Don't show important notice on password field"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java')
-rw-r--r--java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java b/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java
index 604c36488..50a942382 100644
--- a/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java
@@ -22,6 +22,7 @@ import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.util.Log;
+import com.android.inputmethod.latin.InputAttributes;
import com.android.inputmethod.latin.R;
public final class ImportantNoticeUtils {
@@ -62,11 +63,18 @@ public final class ImportantNoticeUtils {
return context.getResources().getInteger(R.integer.config_important_notice_version);
}
- public static boolean hasNewImportantNoticeAndNotInSetupWizard(final Context context) {
+ private static boolean hasNewImportantNotice(final Context context) {
final SharedPreferences prefs = getImportantNoticePreferences(context);
final int lastVersion = prefs.getInt(KEY_IMPORTANT_NOTICE_VERSION, 0);
- return getCurrentImportantNoticeVersion(context) > lastVersion
- && !isInSystemSetupWizard(context);
+ return getCurrentImportantNoticeVersion(context) > lastVersion;
+ }
+
+ public static boolean shouldShowImportantNotice(final Context context,
+ final InputAttributes inputAttributes) {
+ if (inputAttributes == null || inputAttributes.mIsPasswordField) {
+ return false;
+ }
+ return hasNewImportantNotice(context) && !isInSystemSetupWizard(context);
}
public static void updateLastImportantNoticeVersion(final Context context) {