diff options
author | 2014-03-20 11:23:42 +0900 | |
---|---|---|
committer | 2014-03-20 11:48:28 +0900 | |
commit | f96bffa69e5fa01b0bf53fb3af8c8b3539852322 (patch) | |
tree | 751761f947e05c8d7be30ce77717ed742ea3e571 | |
parent | 14e908c3486ae5996e66625e959ff45c5f3740ef (diff) | |
download | latinime-f96bffa69e5fa01b0bf53fb3af8c8b3539852322.tar.gz latinime-f96bffa69e5fa01b0bf53fb3af8c8b3539852322.tar.xz latinime-f96bffa69e5fa01b0bf53fb3af8c8b3539852322.zip |
Suppress important notice when its title message is empty
Bug: 13422608
Change-Id: Ied16e87381e82d8539269ddd90d737f80c2a94c0
-rw-r--r-- | java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java b/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java index ca8bef397..7d937a9d2 100644 --- a/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java @@ -20,6 +20,7 @@ import android.content.Context; import android.content.SharedPreferences; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; +import android.text.TextUtils; import android.util.Log; import com.android.inputmethod.latin.InputAttributes; @@ -82,7 +83,17 @@ public final class ImportantNoticeUtils { if (inputAttributes == null || inputAttributes.mIsPasswordField) { return false; } - return hasNewImportantNotice(context) && !isInSystemSetupWizard(context); + if (isInSystemSetupWizard(context)) { + return false; + } + if (!hasNewImportantNotice(context)) { + return false; + } + final String importantNoticeTitle = getNextImportantNoticeTitle(context); + if (TextUtils.isEmpty(importantNoticeTitle)) { + return false; + } + return true; } public static void updateLastImportantNoticeVersion(final Context context) { |