From 6abc852255072e9c5741a7d8f264bec99b0ce14e Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 19 Feb 2014 13:17:36 +0900 Subject: Turn personalization on when important notice dialog is displayed This change must be checked in together with Ifde70b1d3b. Bug: 10587358 Change-Id: I9dc48f9d521e0e6f6269e4f184389ba805f3053f --- .../latin/utils/ImportantNoticeUtils.java | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java') diff --git a/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java b/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java index 50a942382..dd418b8cf 100644 --- a/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java @@ -32,6 +32,7 @@ public final class ImportantNoticeUtils { // displayed to users. private static final String PREFERENCE_NAME = "important_notice"; private static final String KEY_IMPORTANT_NOTICE_VERSION = "important_notice_version"; + public static final int VERSION_TO_ENABLE_PERSONALIZED_SUGGESTIONS = 2; // Copy of the hidden {@link Settings.Secure#USER_SETUP_COMPLETE} settings key. // The value is zero until each multiuser completes system setup wizard. @@ -59,7 +60,7 @@ public final class ImportantNoticeUtils { return context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); } - private static int getCurrentImportantNoticeVersion(final Context context) { + public static int getCurrentImportantNoticeVersion(final Context context) { return context.getResources().getInteger(R.integer.config_important_notice_version); } @@ -83,4 +84,22 @@ public final class ImportantNoticeUtils { .putInt(KEY_IMPORTANT_NOTICE_VERSION, getCurrentImportantNoticeVersion(context)) .apply(); } + + public static String getImportantNoticeTitle(final Context context) { + switch (getCurrentImportantNoticeVersion(context)) { + case VERSION_TO_ENABLE_PERSONALIZED_SUGGESTIONS: + return context.getString(R.string.important_notice_title); + default: + return null; + } + } + + public static String getImportantNoticeContents(final Context context) { + switch (getCurrentImportantNoticeVersion(context)) { + case VERSION_TO_ENABLE_PERSONALIZED_SUGGESTIONS: + return context.getString(R.string.important_notice_contents); + default: + return null; + } + } } -- cgit v1.2.3-83-g751a