diff options
author | 2014-02-19 13:17:36 +0900 | |
---|---|---|
committer | 2014-02-19 18:36:32 +0900 | |
commit | 6abc852255072e9c5741a7d8f264bec99b0ce14e (patch) | |
tree | 597ecaeab2e964100c9f557b45571357a5c9cd56 /java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java | |
parent | 0a4ac795d6fdd117b590902d7f5901f0db12d25c (diff) | |
download | latinime-6abc852255072e9c5741a7d8f264bec99b0ce14e.tar.gz latinime-6abc852255072e9c5741a7d8f264bec99b0ce14e.tar.xz latinime-6abc852255072e9c5741a7d8f264bec99b0ce14e.zip |
Turn personalization on when important notice dialog is displayed
This change must be checked in together with Ifde70b1d3b.
Bug: 10587358
Change-Id: I9dc48f9d521e0e6f6269e4f184389ba805f3053f
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/utils/ImportantNoticeUtils.java | 21 |
1 files changed, 20 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 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; + } + } } |