Remove experimental settings

Bug: 5314288
Change-Id: I31cbc6da0ca5e61a5fa4a893c774f2110a5698f1
main
satok 2011-09-14 14:07:10 +09:00
parent ea843f2a24
commit c9c54a84bc
2 changed files with 54 additions and 67 deletions

View File

@ -93,66 +93,46 @@
<PreferenceCategory <PreferenceCategory
android:title="@string/misc_category" android:title="@string/misc_category"
android:key="misc_settings"> android:key="misc_settings">
<CheckBoxPreference <CheckBoxPreference
android:key="usability_study_mode" android:key="usability_study_mode"
android:title="@string/prefs_usability_study_mode" android:title="@string/prefs_usability_study_mode"
android:persistent="true" android:persistent="true"
android:defaultValue="false" /> android:defaultValue="false" />
<CheckBoxPreference <PreferenceScreen
android:key="enable_logging" android:key="pref_advanced_settings"
android:title="@string/prefs_enable_log" android:title="@string/advanced_settings"
android:summary="@string/prefs_description_log" android:summary="@string/advanced_settings_summary">
android:persistent="true" <!-- Values for popup dismiss delay are added programatically -->
android:defaultValue="true" /> <ListPreference
<ListPreference android:key="pref_key_preview_popup_dismiss_delay"
android:key="pref_keyboard_layout_20100902" android:title="@string/key_preview_popup_dismiss_delay" />
android:title="@string/keyboard_layout" <CheckBoxPreference
android:persistent="true" android:key="pref_key_use_contacts_dict"
android:entryValues="@array/keyboard_layout_modes_values" android:title="@string/use_contacts_dict"
android:entries="@array/keyboard_layout_modes" android:summary="@string/use_contacts_dict_summary"
android:defaultValue="@string/config_default_keyboard_theme_id" /> android:persistent="true"
android:defaultValue="true" />
<CheckBoxPreference
android:key="bigram_suggestion"
android:title="@string/bigram_suggestion"
android:summary="@string/bigram_suggestion_summary"
android:persistent="true"
android:defaultValue="true" />
<CheckBoxPreference
android:key="enable_span_insert"
android:title="@string/enable_span_insert"
android:summary="@string/enable_span_insert_summary"
android:persistent="true"
android:defaultValue="true" />
<!-- TODO: evaluate results and revive this option. The code
already supports it. -->
<!-- <CheckBoxPreference -->
<!-- android:key="bigram_prediction" -->
<!-- android:dependency="bigram_suggestion" -->
<!-- android:title="@string/bigram_prediction" -->
<!-- android:summary="@string/bigram_prediction_summary" -->
<!-- android:persistent="true" -->
<!-- android:defaultValue="false" /> -->
</PreferenceScreen>
</PreferenceCategory> </PreferenceCategory>
<PreferenceScreen
android:key="pref_advanced_settings"
android:title="@string/advanced_settings"
android:summary="@string/advanced_settings_summary">
<!-- Values for popup dismiss delay are added programatically -->
<ListPreference
android:key="pref_key_preview_popup_dismiss_delay"
android:title="@string/key_preview_popup_dismiss_delay" />
<CheckBoxPreference
android:key="pref_key_use_contacts_dict"
android:title="@string/use_contacts_dict"
android:summary="@string/use_contacts_dict_summary"
android:persistent="true"
android:defaultValue="true" />
<CheckBoxPreference
android:key="bigram_suggestion"
android:title="@string/bigram_suggestion"
android:summary="@string/bigram_suggestion_summary"
android:persistent="true"
android:defaultValue="true" />
<CheckBoxPreference
android:key="enable_span_insert"
android:title="@string/enable_span_insert"
android:summary="@string/enable_span_insert_summary"
android:persistent="true"
android:defaultValue="true" />
<!-- TODO: evaluate results and revive this option. The code already supports it. -->
<!-- <CheckBoxPreference -->
<!-- android:key="bigram_prediction" -->
<!-- android:dependency="bigram_suggestion" -->
<!-- android:title="@string/bigram_prediction" -->
<!-- android:summary="@string/bigram_prediction_summary" -->
<!-- android:persistent="true" -->
<!-- android:defaultValue="false" /> -->
</PreferenceScreen>
<!-- <Preference
android:title="Debug Settings"
android:key="debug_settings">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.android.inputmethod.latin"
android:targetClass="com.android.inputmethod.latin.DebugSettings" />
</Preference>-->
</PreferenceScreen> </PreferenceScreen>

View File

@ -55,6 +55,8 @@ public class Settings extends InputMethodSettingsActivity
DialogInterface.OnDismissListener, OnPreferenceClickListener { DialogInterface.OnDismissListener, OnPreferenceClickListener {
private static final String TAG = Settings.class.getSimpleName(); private static final String TAG = Settings.class.getSimpleName();
public static final boolean ENABLE_EXPERIMENTAL_SETTINGS = false;
public static final String PREF_GENERAL_SETTINGS_KEY = "general_settings"; public static final String PREF_GENERAL_SETTINGS_KEY = "general_settings";
public static final String PREF_VIBRATE_ON = "vibrate_on"; public static final String PREF_VIBRATE_ON = "vibrate_on";
public static final String PREF_SOUND_ON = "sound_on"; public static final String PREF_SOUND_ON = "sound_on";
@ -397,6 +399,8 @@ public class Settings extends InputMethodSettingsActivity
(PreferenceGroup) findPreference(PREF_GENERAL_SETTINGS_KEY); (PreferenceGroup) findPreference(PREF_GENERAL_SETTINGS_KEY);
final PreferenceGroup textCorrectionGroup = final PreferenceGroup textCorrectionGroup =
(PreferenceGroup) findPreference(PREF_CORRECTION_SETTINGS_KEY); (PreferenceGroup) findPreference(PREF_CORRECTION_SETTINGS_KEY);
final PreferenceGroup miscSettings =
(PreferenceGroup) findPreference(PREF_MISC_SETTINGS_KEY);
if (!Values.isShowSettingsKeyOption(res)) { if (!Values.isShowSettingsKeyOption(res)) {
generalSettings.removePreference(mShowSettingsKeyPreference); generalSettings.removePreference(mShowSettingsKeyPreference);
@ -437,12 +441,6 @@ public class Settings extends InputMethodSettingsActivity
} }
} }
final boolean showUsabilityModeStudyOption = res.getBoolean(
R.bool.config_enable_usability_study_mode_option);
if (!showUsabilityModeStudyOption) {
getPreferenceScreen().removePreference(findPreference(PREF_USABILITY_STUDY_MODE));
}
mKeyPreviewPopupDismissDelay = mKeyPreviewPopupDismissDelay =
(ListPreference)findPreference(PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY); (ListPreference)findPreference(PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY);
final String[] entries = new String[] { final String[] entries = new String[] {
@ -467,6 +465,15 @@ public class Settings extends InputMethodSettingsActivity
if (0 >= number) { if (0 >= number) {
textCorrectionGroup.removePreference(dictionaryLink); textCorrectionGroup.removePreference(dictionaryLink);
} }
final boolean showUsabilityModeStudyOption = res.getBoolean(
R.bool.config_enable_usability_study_mode_option);
if (!showUsabilityModeStudyOption || !ENABLE_EXPERIMENTAL_SETTINGS) {
final Preference pref = findPreference(PREF_USABILITY_STUDY_MODE);
if (pref != null) {
miscSettings.removePreference(pref);
}
}
} }
@SuppressWarnings("unused") @SuppressWarnings("unused")