summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/inputmethod
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-02-16 18:27:27 +0900
committersatok <satok@google.com>2011-02-16 19:04:29 +0900
commit85819c8c3219a4ec87da1d8a3d87f0faeb086f04 (patch)
tree99f83a6a8b5b22bcf7b5f12e53ab84e122bf0a80 /src/com/android/settings/inputmethod
parent60d5e429d4238c22e2221d305ae8add129117e6d (diff)
downloadpackages_apps_Settings-85819c8c3219a4ec87da1d8a3d87f0faeb086f04.tar.gz
packages_apps_Settings-85819c8c3219a4ec87da1d8a3d87f0faeb086f04.tar.bz2
packages_apps_Settings-85819c8c3219a4ec87da1d8a3d87f0faeb086f04.zip
Fix a bug which can't enable mutiple non-preinstalled IMEs at a time
Bug: 3459430 Change-Id: Ieee340a92862047135a03c131517b927e1ed2f5e
Diffstat (limited to 'src/com/android/settings/inputmethod')
-rw-r--r--src/com/android/settings/inputmethod/InputMethodConfig.java45
1 files changed, 21 insertions, 24 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodConfig.java b/src/com/android/settings/inputmethod/InputMethodConfig.java
index f2bdafd47..2cfe35d5f 100644
--- a/src/com/android/settings/inputmethod/InputMethodConfig.java
+++ b/src/com/android/settings/inputmethod/InputMethodConfig.java
@@ -104,31 +104,28 @@ public class InputMethodConfig extends SettingsPreferenceFragment {
private void showSecurityWarnDialog(InputMethodInfo imi, final CheckBoxPreference chkPref,
final String imiId) {
- if (mDialog == null) {
- mDialog = (new AlertDialog.Builder(getActivity()))
- .setTitle(android.R.string.dialog_alert_title)
- .setIcon(android.R.drawable.ic_dialog_alert)
- .setCancelable(true)
- .setPositiveButton(android.R.string.ok,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- chkPref.setChecked(true);
- for (Preference pref: mInputMethodPrefsMap.get(imiId)) {
- pref.setEnabled(true);
- }
- }
- })
- .setNegativeButton(android.R.string.cancel,
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- }
- })
- .create();
- } else {
- if (mDialog.isShowing()) {
- mDialog.dismiss();
- }
+ if (mDialog != null && mDialog.isShowing()) {
+ mDialog.dismiss();
}
+ mDialog = (new AlertDialog.Builder(getActivity()))
+ .setTitle(android.R.string.dialog_alert_title)
+ .setIcon(android.R.drawable.ic_dialog_alert)
+ .setCancelable(true)
+ .setPositiveButton(android.R.string.ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ chkPref.setChecked(true);
+ for (Preference pref: mInputMethodPrefsMap.get(imiId)) {
+ pref.setEnabled(true);
+ }
+ }
+ })
+ .setNegativeButton(android.R.string.cancel,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ }
+ })
+ .create();
mDialog.setMessage(getResources().getString(R.string.ime_security_warning,
imi.getServiceInfo().applicationInfo.loadLabel(getPackageManager())));
mDialog.show();