Suppress important notice when its title message is empty

Bug: 13422608
Change-Id: Ied16e87381e82d8539269ddd90d737f80c2a94c0
main
Tadashi G. Takaoka 2014-03-20 11:23:42 +09:00
parent 14e908c348
commit f96bffa69e
1 changed files with 12 additions and 1 deletions

View File

@ -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) {