Always on the valid system default ime

Bug: 6422390

Change-Id: I9af4065e4b9f9332f3b0db168dea5546727d5951
This commit is contained in:
satok
2012-05-02 20:51:49 +09:00
parent 9593b743cb
commit 472c3c93fc
2 changed files with 55 additions and 9 deletions

View File

@@ -51,7 +51,7 @@ public class InputMethodPreference extends CheckBoxPreference
private final InputMethodInfo mImi;
private final InputMethodManager mImm;
private final Intent mSettingsIntent;
private final boolean mIsSystemIme;
private final boolean mAlwaysChecked;
private AlertDialog mDialog = null;
private ImageView mInputMethodSettingsButton;
@@ -68,7 +68,7 @@ public class InputMethodPreference extends CheckBoxPreference
if (isChecked()) {
setChecked(false);
} else {
if (mIsSystemIme) {
if (mAlwaysChecked) {
setChecked(true);
} else {
showSecurityWarnDialog(mImi, InputMethodPreference.this);
@@ -87,9 +87,9 @@ public class InputMethodPreference extends CheckBoxPreference
mImm = imm;
mImi = imi;
updateSummary();
mIsSystemIme = InputMethodAndSubtypeUtil.isSystemIme(imi);
final boolean isAuxIme = InputMethodAndSubtypeUtil.isAuxiliaryIme(imi);
if (imiCount <= 1 || (mIsSystemIme && !isAuxIme)) {
mAlwaysChecked = InputMethodAndSubtypeUtil.isAlwaysCheckedIme(
imi, fragment.getActivity(), imiCount);
if (mAlwaysChecked) {
setEnabled(false);
}
}