From fe39d576dcd515d7fcd678a2ed6a621185cc69e3 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Thu, 20 Feb 2014 15:25:07 +0900 Subject: Support versioned important notice This change must be checked in together with If38a754d00. Bug: 10587358 Change-Id: I91580f9468bc5ee7ed1694d7852a60dc6793dac0 --- java/src/com/android/inputmethod/latin/LatinIME.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java') diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 47137e7fb..f2fa32923 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1190,15 +1190,28 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen new AlertDialog.Builder(context, AlertDialog.THEME_HOLO_DARK); builder.setMessage(ImportantNoticeUtils.getNextImportantNoticeContents(context)); builder.setPositiveButton(android.R.string.ok, null /* listener */); + final int nextVersion = ImportantNoticeUtils.getNextImportantNoticeVersion(context); final OnClickListener onClickListener = new OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int position) { - if (position == DialogInterface.BUTTON_NEGATIVE) { - launchSettings(); + switch (nextVersion) { + case ImportantNoticeUtils.VERSION_TO_ENABLE_PERSONALIZED_SUGGESTIONS: + if (position == DialogInterface.BUTTON_NEGATIVE) { + launchSettings(); + } + break; + default: + break; } } }; - builder.setNegativeButton(R.string.go_to_settings, onClickListener); + switch (nextVersion) { + case ImportantNoticeUtils.VERSION_TO_ENABLE_PERSONALIZED_SUGGESTIONS: + builder.setNegativeButton(R.string.go_to_settings, onClickListener); + break; + default: + break; + } final AlertDialog importantNoticeDialog = builder.create(); importantNoticeDialog.setOnShowListener(new OnShowListener() { @Override -- cgit v1.2.3-83-g751a