Fix a bug which can't enable mutiple non-preinstalled IMEs at a time
Bug: 3459430 Change-Id: Ieee340a92862047135a03c131517b927e1ed2f5e
This commit is contained in:
@@ -104,31 +104,28 @@ public class InputMethodConfig extends SettingsPreferenceFragment {
|
|||||||
|
|
||||||
private void showSecurityWarnDialog(InputMethodInfo imi, final CheckBoxPreference chkPref,
|
private void showSecurityWarnDialog(InputMethodInfo imi, final CheckBoxPreference chkPref,
|
||||||
final String imiId) {
|
final String imiId) {
|
||||||
if (mDialog == null) {
|
if (mDialog != null && mDialog.isShowing()) {
|
||||||
mDialog = (new AlertDialog.Builder(getActivity()))
|
mDialog.dismiss();
|
||||||
.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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
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,
|
mDialog.setMessage(getResources().getString(R.string.ime_security_warning,
|
||||||
imi.getServiceInfo().applicationInfo.loadLabel(getPackageManager())));
|
imi.getServiceInfo().applicationInfo.loadLabel(getPackageManager())));
|
||||||
mDialog.show();
|
mDialog.show();
|
||||||
|
Reference in New Issue
Block a user