summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-07-21 14:17:47 -0700
committerTadashi G. Takaoka <takaoka@google.com>2014-07-21 14:56:22 -0700
commit229ed1a784a78a713908a0f452238c7345920aaf (patch)
treeb238b1f52e2ad69f11601f083bcc0b0f5ce3a2c4 /src
parentc0bffe7148173fef2d7c7098c8f791cac710b62f (diff)
downloadpackages_apps_Settings-229ed1a784a78a713908a0f452238c7345920aaf.zip
packages_apps_Settings-229ed1a784a78a713908a0f452238c7345920aaf.tar.gz
packages_apps_Settings-229ed1a784a78a713908a0f452238c7345920aaf.tar.bz2
Remove unused and unnecessary code from subtype enabler
Change-Id: I9935b5bda8ae7cd1ce2d20ee6c4622eeb9a02b6a
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java71
1 files changed, 0 insertions, 71 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
index d14d08b..4019bb4 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
@@ -16,9 +16,7 @@
package com.android.settings.inputmethod;
-import android.app.AlertDialog;
import android.content.Context;
-import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
@@ -32,7 +30,6 @@ import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodSubtype;
-import com.android.internal.inputmethod.InputMethodUtils;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -52,7 +49,6 @@ public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment {
// TODO: Change mInputMethodInfoList to Map
private List<InputMethodInfo> mInputMethodInfoList;
private Collator mCollator;
- private AlertDialog mDialog = null;
@Override
public void onCreate(final Bundle icicle) {
@@ -142,82 +138,15 @@ public class InputMethodAndSubtypeEnabler extends SettingsPreferenceFragment {
}
}
- final String id = chkPref.getKey();
// Turns off a subtype.
if (!chkPref.isChecked()) {
- // TODO: Because no preference on this screen has {@link InputMethodInfo} id as a key,
- // the following setSubtypesPreferenceEnabled call is effectively no-operation and
- // can be removed.
- InputMethodAndSubtypeUtil.setSubtypesPreferenceEnabled(
- this, mInputMethodInfoList, id, false);
updateAutoSelectionPreferences();
return super.onPreferenceTreeClick(preferenceScreen, preference);
}
- // Turns on a subtype.
- final InputMethodInfo imi = getInputMethodInfoById(id);
- // TODO: Because no preference on this screen has {@link InputMethodInfo} id as a key,
- // <code>imi</code> is always null and the following code can be removed.
- if (imi == null) {
- return super.onPreferenceTreeClick(preferenceScreen, preference);
- }
- // Turns on a system IME's subtype.
- if (InputMethodUtils.isSystemIme(imi)) {
- InputMethodAndSubtypeUtil.setSubtypesPreferenceEnabled(
- this, mInputMethodInfoList, id, true);
- // This is a built-in IME, so no need to warn.
- return super.onPreferenceTreeClick(preferenceScreen, preference);
- }
- // Turns on a 3rd party IME's subtype.
- // Turns off a subtype before showing a security warning dialog.
- chkPref.setChecked(false);
- if (mDialog != null && mDialog.isShowing()) {
- mDialog.dismiss();
- }
- final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
- builder.setCancelable(true);
- builder.setTitle(android.R.string.dialog_alert_title);
- final CharSequence label = imi.getServiceInfo().applicationInfo
- .loadLabel(getPackageManager());
- builder.setMessage(getString(R.string.ime_security_warning, label));
- builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(final DialogInterface dialog, final int which) {
- // The user explicitly enable the subtype.
- chkPref.setChecked(true);
- InputMethodAndSubtypeUtil.setSubtypesPreferenceEnabled(
- InputMethodAndSubtypeEnabler.this, mInputMethodInfoList, id, true);
- }
- });
- builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(final DialogInterface dialog, final int which) {}
- });
- mDialog = builder.create();
- mDialog.show();
return super.onPreferenceTreeClick(preferenceScreen, preference);
}
- private InputMethodInfo getInputMethodInfoById(final String imiId) {
- final int imiCount = mInputMethodInfoList.size();
- for (int index = 0; index < imiCount; ++index) {
- final InputMethodInfo imi = mInputMethodInfoList.get(index);
- if (imi.getId().equals(imiId)) {
- return imi;
- }
- }
- return null;
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- if (mDialog != null) {
- mDialog.dismiss();
- mDialog = null;
- }
- }
-
private void addInputMethodSubtypePreferences(final InputMethodInfo imi,
final PreferenceScreen root) {
final Context context = getActivity();