2009-03-13 22:11:42 +00:00
|
|
|
/*
|
2013-01-08 06:41:46 +00:00
|
|
|
* Copyright (C) 2013 The Android Open Source Project
|
2011-01-19 08:44:39 +00:00
|
|
|
*
|
2013-01-21 12:52:57 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2010-01-28 18:09:44 +00:00
|
|
|
*
|
2013-01-21 12:52:57 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2010-01-28 18:09:44 +00:00
|
|
|
*
|
2009-03-13 22:11:42 +00:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
2013-01-21 12:52:57 +00:00
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2009-03-13 22:11:42 +00:00
|
|
|
*/
|
|
|
|
|
2013-07-22 03:43:37 +00:00
|
|
|
package com.android.inputmethod.latin.settings;
|
2009-03-13 22:11:42 +00:00
|
|
|
|
2013-01-08 07:35:21 +00:00
|
|
|
import android.content.Context;
|
|
|
|
import android.content.SharedPreferences;
|
2013-03-05 03:54:13 +00:00
|
|
|
import android.content.pm.ApplicationInfo;
|
2013-01-08 07:35:21 +00:00
|
|
|
import android.content.res.Resources;
|
|
|
|
import android.preference.PreferenceManager;
|
2013-06-06 01:57:47 +00:00
|
|
|
import android.util.Log;
|
2013-01-08 07:35:21 +00:00
|
|
|
|
2013-07-22 03:43:37 +00:00
|
|
|
import com.android.inputmethod.latin.AudioAndHapticFeedbackManager;
|
|
|
|
import com.android.inputmethod.latin.InputAttributes;
|
|
|
|
import com.android.inputmethod.latin.R;
|
2013-07-24 01:37:07 +00:00
|
|
|
import com.android.inputmethod.latin.utils.AdditionalSubtypeUtils;
|
2013-08-02 11:22:00 +00:00
|
|
|
import com.android.inputmethod.latin.utils.DebugLogUtils;
|
2013-06-23 16:11:32 +00:00
|
|
|
import com.android.inputmethod.latin.utils.LocaleUtils;
|
|
|
|
import com.android.inputmethod.latin.utils.ResourceUtils;
|
2013-07-24 06:58:11 +00:00
|
|
|
import com.android.inputmethod.latin.utils.RunInLocale;
|
2013-01-08 07:35:21 +00:00
|
|
|
|
2013-01-08 09:20:31 +00:00
|
|
|
import java.util.HashMap;
|
2013-01-08 07:35:21 +00:00
|
|
|
import java.util.Locale;
|
2013-08-02 11:22:00 +00:00
|
|
|
import java.util.concurrent.locks.ReentrantLock;
|
2013-01-08 07:35:21 +00:00
|
|
|
|
|
|
|
public final class Settings implements SharedPreferences.OnSharedPreferenceChangeListener {
|
2013-06-06 01:57:47 +00:00
|
|
|
private static final String TAG = Settings.class.getSimpleName();
|
2011-12-09 07:41:05 +00:00
|
|
|
// In the same order as xml/prefs.xml
|
2011-12-09 08:58:51 +00:00
|
|
|
public static final String PREF_GENERAL_SETTINGS = "general_settings";
|
2011-12-09 07:41:05 +00:00
|
|
|
public static final String PREF_AUTO_CAP = "auto_cap";
|
2010-12-09 12:06:26 +00:00
|
|
|
public static final String PREF_VIBRATE_ON = "vibrate_on";
|
|
|
|
public static final String PREF_SOUND_ON = "sound_on";
|
2011-12-09 08:58:51 +00:00
|
|
|
public static final String PREF_POPUP_ON = "popup_on";
|
|
|
|
public static final String PREF_VOICE_MODE = "voice_mode";
|
|
|
|
public static final String PREF_CORRECTION_SETTINGS = "correction_settings";
|
2013-04-15 09:46:57 +00:00
|
|
|
public static final String PREF_EDIT_PERSONAL_DICTIONARY = "edit_personal_dictionary";
|
2011-12-09 07:41:05 +00:00
|
|
|
public static final String PREF_CONFIGURE_DICTIONARIES_KEY = "configure_dictionaries_key";
|
2010-12-11 08:06:24 +00:00
|
|
|
public static final String PREF_AUTO_CORRECTION_THRESHOLD = "auto_correction_threshold";
|
2011-12-09 07:41:05 +00:00
|
|
|
public static final String PREF_SHOW_SUGGESTIONS_SETTING = "show_suggestions_setting";
|
2011-12-09 08:58:51 +00:00
|
|
|
public static final String PREF_MISC_SETTINGS = "misc_settings";
|
2012-05-18 12:28:09 +00:00
|
|
|
public static final String PREF_LAST_USER_DICTIONARY_WRITE_TIME =
|
|
|
|
"last_user_dictionary_write_time";
|
2011-12-09 07:41:05 +00:00
|
|
|
public static final String PREF_ADVANCED_SETTINGS = "pref_advanced_settings";
|
2012-07-27 06:32:29 +00:00
|
|
|
public static final String PREF_KEY_USE_CONTACTS_DICT = "pref_key_use_contacts_dict";
|
2012-12-04 06:24:55 +00:00
|
|
|
public static final String PREF_KEY_USE_DOUBLE_SPACE_PERIOD =
|
|
|
|
"pref_key_use_double_space_period";
|
2013-04-23 03:19:31 +00:00
|
|
|
public static final String PREF_BLOCK_POTENTIALLY_OFFENSIVE =
|
|
|
|
"pref_key_block_potentially_offensive";
|
2012-09-20 01:32:56 +00:00
|
|
|
public static final String PREF_SHOW_LANGUAGE_SWITCH_KEY =
|
|
|
|
"pref_show_language_switch_key";
|
2012-02-18 01:46:01 +00:00
|
|
|
public static final String PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST =
|
|
|
|
"pref_include_other_imes_in_language_switch_list";
|
2012-04-18 13:13:29 +00:00
|
|
|
public static final String PREF_CUSTOM_INPUT_STYLES = "custom_input_styles";
|
2011-05-11 11:51:07 +00:00
|
|
|
public static final String PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY =
|
|
|
|
"pref_key_preview_popup_dismiss_delay";
|
2012-04-05 11:49:37 +00:00
|
|
|
public static final String PREF_BIGRAM_PREDICTIONS = "next_word_prediction";
|
2012-11-09 03:44:40 +00:00
|
|
|
public static final String PREF_GESTURE_SETTINGS = "gesture_typing_settings";
|
2012-07-20 08:49:06 +00:00
|
|
|
public static final String PREF_GESTURE_INPUT = "gesture_input";
|
2013-01-24 07:08:33 +00:00
|
|
|
public static final String PREF_SLIDING_KEY_INPUT_PREVIEW = "pref_sliding_key_input_preview";
|
2013-01-18 03:19:59 +00:00
|
|
|
public static final String PREF_KEY_LONGPRESS_TIMEOUT = "pref_key_longpress_timeout";
|
2011-12-09 08:58:51 +00:00
|
|
|
public static final String PREF_VIBRATION_DURATION_SETTINGS =
|
2011-09-28 11:11:05 +00:00
|
|
|
"pref_vibration_duration_settings";
|
2011-10-11 07:39:11 +00:00
|
|
|
public static final String PREF_KEYPRESS_SOUND_VOLUME =
|
|
|
|
"pref_keypress_sound_volume";
|
2012-07-27 06:32:29 +00:00
|
|
|
public static final String PREF_GESTURE_PREVIEW_TRAIL = "pref_gesture_preview_trail";
|
2012-10-02 01:30:03 +00:00
|
|
|
public static final String PREF_GESTURE_FLOATING_PREVIEW_TEXT =
|
|
|
|
"pref_gesture_floating_preview_text";
|
2013-03-05 03:54:13 +00:00
|
|
|
public static final String PREF_SHOW_SETUP_WIZARD_ICON = "pref_show_setup_wizard_icon";
|
2011-12-09 07:41:05 +00:00
|
|
|
|
|
|
|
public static final String PREF_INPUT_LANGUAGE = "input_language";
|
|
|
|
public static final String PREF_SELECTED_LANGUAGES = "selected_languages";
|
|
|
|
public static final String PREF_DEBUG_SETTINGS = "debug_settings";
|
2013-03-13 04:08:34 +00:00
|
|
|
public static final String PREF_KEY_IS_INTERNAL = "pref_key_is_internal";
|
2013-01-08 07:35:21 +00:00
|
|
|
|
2013-01-08 09:20:31 +00:00
|
|
|
// This preference key is deprecated. Use {@link #PREF_SHOW_LANGUAGE_SWITCH_KEY} instead.
|
|
|
|
// This is being used only for the backward compatibility.
|
|
|
|
private static final String PREF_SUPPRESS_LANGUAGE_SWITCH_KEY =
|
|
|
|
"pref_suppress_language_switch_key";
|
|
|
|
|
2013-03-19 07:49:19 +00:00
|
|
|
public static final String PREF_SEND_FEEDBACK = "send_feedback";
|
2013-04-22 09:00:59 +00:00
|
|
|
public static final String PREF_ABOUT_KEYBOARD = "about_keyboard";
|
2013-03-19 07:49:19 +00:00
|
|
|
|
2013-01-08 07:35:21 +00:00
|
|
|
private Resources mRes;
|
|
|
|
private SharedPreferences mPrefs;
|
|
|
|
private SettingsValues mSettingsValues;
|
2013-08-02 11:22:00 +00:00
|
|
|
private final ReentrantLock mSettingsValuesLock = new ReentrantLock();
|
2013-01-08 07:35:21 +00:00
|
|
|
|
|
|
|
private static final Settings sInstance = new Settings();
|
|
|
|
|
|
|
|
public static Settings getInstance() {
|
|
|
|
return sInstance;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void init(final Context context) {
|
|
|
|
sInstance.onCreate(context);
|
|
|
|
}
|
|
|
|
|
|
|
|
private Settings() {
|
|
|
|
// Intentional empty constructor for singleton.
|
|
|
|
}
|
|
|
|
|
|
|
|
private void onCreate(final Context context) {
|
|
|
|
mRes = context.getResources();
|
|
|
|
mPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
mPrefs.registerOnSharedPreferenceChangeListener(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onDestroy() {
|
|
|
|
mPrefs.unregisterOnSharedPreferenceChangeListener(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSharedPreferenceChanged(final SharedPreferences prefs, final String key) {
|
2013-08-02 11:22:00 +00:00
|
|
|
mSettingsValuesLock.lock();
|
|
|
|
try {
|
|
|
|
if (mSettingsValues == null) {
|
|
|
|
// TODO: Introduce a static function to register this class and ensure that
|
|
|
|
// loadSettings must be called before "onSharedPreferenceChanged" is called.
|
|
|
|
Log.w(TAG, "onSharedPreferenceChanged called before loadSettings.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
loadSettings(mSettingsValues.mLocale, mSettingsValues.mInputAttributes);
|
|
|
|
} finally {
|
|
|
|
mSettingsValuesLock.unlock();
|
2013-06-06 01:57:47 +00:00
|
|
|
}
|
2013-01-08 07:35:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void loadSettings(final Locale locale, final InputAttributes inputAttributes) {
|
2013-08-02 11:22:00 +00:00
|
|
|
mSettingsValuesLock.lock();
|
|
|
|
try {
|
|
|
|
final SharedPreferences prefs = mPrefs;
|
|
|
|
final RunInLocale<SettingsValues> job = new RunInLocale<SettingsValues>() {
|
|
|
|
@Override
|
|
|
|
protected SettingsValues job(final Resources res) {
|
|
|
|
return new SettingsValues(prefs, locale, res, inputAttributes);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
mSettingsValues = job.runInLocale(mRes, locale);
|
|
|
|
} finally {
|
|
|
|
mSettingsValuesLock.unlock();
|
|
|
|
}
|
2013-01-08 07:35:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: Remove this method and add proxy method to SettingsValues.
|
|
|
|
public SettingsValues getCurrent() {
|
|
|
|
return mSettingsValues;
|
|
|
|
}
|
2013-01-08 09:20:31 +00:00
|
|
|
|
2013-03-13 04:08:34 +00:00
|
|
|
public boolean isInternal() {
|
|
|
|
return mSettingsValues.mIsInternal;
|
|
|
|
}
|
|
|
|
|
2013-04-10 07:38:37 +00:00
|
|
|
public String getWordSeparators() {
|
|
|
|
return mSettingsValues.mWordSeparators;
|
|
|
|
}
|
|
|
|
|
2013-06-25 08:45:26 +00:00
|
|
|
public boolean isWordSeparator(final int code) {
|
|
|
|
return mSettingsValues.isWordSeparator(code);
|
|
|
|
}
|
|
|
|
|
2013-04-23 03:19:31 +00:00
|
|
|
public boolean getBlockPotentiallyOffensive() {
|
|
|
|
return mSettingsValues.mBlockPotentiallyOffensive;
|
|
|
|
}
|
|
|
|
|
2013-01-08 09:20:31 +00:00
|
|
|
// Accessed from the settings interface, hence public
|
2013-01-22 04:29:30 +00:00
|
|
|
public static boolean readKeypressSoundEnabled(final SharedPreferences prefs,
|
|
|
|
final Resources res) {
|
|
|
|
return prefs.getBoolean(Settings.PREF_SOUND_ON,
|
|
|
|
res.getBoolean(R.bool.config_default_sound_enabled));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean readVibrationEnabled(final SharedPreferences prefs,
|
|
|
|
final Resources res) {
|
|
|
|
final boolean hasVibrator = AudioAndHapticFeedbackManager.getInstance().hasVibrator();
|
|
|
|
return hasVibrator && prefs.getBoolean(PREF_VIBRATE_ON,
|
|
|
|
res.getBoolean(R.bool.config_default_vibration_enabled));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean readAutoCorrectEnabled(final String currentAutoCorrectionSetting,
|
|
|
|
final Resources res) {
|
|
|
|
final String autoCorrectionOff = res.getString(
|
|
|
|
R.string.auto_correction_threshold_mode_index_off);
|
|
|
|
return !currentAutoCorrectionSetting.equals(autoCorrectionOff);
|
|
|
|
}
|
|
|
|
|
2013-04-23 03:19:31 +00:00
|
|
|
public static boolean readBlockPotentiallyOffensive(final SharedPreferences prefs,
|
|
|
|
final Resources res) {
|
|
|
|
return prefs.getBoolean(Settings.PREF_BLOCK_POTENTIALLY_OFFENSIVE,
|
|
|
|
res.getBoolean(R.bool.config_block_potentially_offensive));
|
|
|
|
}
|
|
|
|
|
2013-01-22 04:29:30 +00:00
|
|
|
public static boolean readFromBuildConfigIfGestureInputEnabled(final Resources res) {
|
|
|
|
return res.getBoolean(R.bool.config_gesture_input_enabled_by_build_config);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean readGestureInputEnabled(final SharedPreferences prefs,
|
|
|
|
final Resources res) {
|
|
|
|
return readFromBuildConfigIfGestureInputEnabled(res)
|
|
|
|
&& prefs.getBoolean(Settings.PREF_GESTURE_INPUT, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean readFromBuildConfigIfToShowKeyPreviewPopupSettingsOption(
|
|
|
|
final Resources res) {
|
|
|
|
return res.getBoolean(R.bool.config_enable_show_option_of_key_preview_popup);
|
|
|
|
}
|
|
|
|
|
2013-01-08 09:20:31 +00:00
|
|
|
public static boolean readKeyPreviewPopupEnabled(final SharedPreferences prefs,
|
|
|
|
final Resources res) {
|
2013-01-22 04:29:30 +00:00
|
|
|
final boolean defaultKeyPreviewPopup = res.getBoolean(
|
|
|
|
R.bool.config_default_key_preview_popup);
|
|
|
|
if (!readFromBuildConfigIfToShowKeyPreviewPopupSettingsOption(res)) {
|
|
|
|
return defaultKeyPreviewPopup;
|
|
|
|
}
|
|
|
|
return prefs.getBoolean(PREF_POPUP_ON, defaultKeyPreviewPopup);
|
2013-01-08 09:20:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static int readKeyPreviewPopupDismissDelay(final SharedPreferences prefs,
|
|
|
|
final Resources res) {
|
|
|
|
return Integer.parseInt(prefs.getString(PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY,
|
|
|
|
Integer.toString(res.getInteger(
|
|
|
|
R.integer.config_key_preview_linger_timeout))));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean readShowsLanguageSwitchKey(final SharedPreferences prefs) {
|
|
|
|
if (prefs.contains(PREF_SUPPRESS_LANGUAGE_SWITCH_KEY)) {
|
|
|
|
final boolean suppressLanguageSwitchKey = prefs.getBoolean(
|
|
|
|
PREF_SUPPRESS_LANGUAGE_SWITCH_KEY, false);
|
|
|
|
final SharedPreferences.Editor editor = prefs.edit();
|
|
|
|
editor.remove(PREF_SUPPRESS_LANGUAGE_SWITCH_KEY);
|
|
|
|
editor.putBoolean(PREF_SHOW_LANGUAGE_SWITCH_KEY, !suppressLanguageSwitchKey);
|
|
|
|
editor.apply();
|
|
|
|
}
|
|
|
|
return prefs.getBoolean(PREF_SHOW_LANGUAGE_SWITCH_KEY, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String readPrefAdditionalSubtypes(final SharedPreferences prefs,
|
|
|
|
final Resources res) {
|
2013-07-24 01:37:07 +00:00
|
|
|
final String predefinedPrefSubtypes = AdditionalSubtypeUtils.createPrefSubtypes(
|
2013-01-08 09:20:31 +00:00
|
|
|
res.getStringArray(R.array.predefined_subtypes));
|
|
|
|
return prefs.getString(PREF_CUSTOM_INPUT_STYLES, predefinedPrefSubtypes);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void writePrefAdditionalSubtypes(final SharedPreferences prefs,
|
|
|
|
final String prefSubtypes) {
|
|
|
|
prefs.edit().putString(Settings.PREF_CUSTOM_INPUT_STYLES, prefSubtypes).apply();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static float readKeypressSoundVolume(final SharedPreferences prefs,
|
|
|
|
final Resources res) {
|
|
|
|
final float volume = prefs.getFloat(PREF_KEYPRESS_SOUND_VOLUME, -1.0f);
|
2013-01-10 03:06:00 +00:00
|
|
|
return (volume >= 0) ? volume : readDefaultKeypressSoundVolume(res);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static float readDefaultKeypressSoundVolume(final Resources res) {
|
2013-01-08 09:20:31 +00:00
|
|
|
return Float.parseFloat(
|
|
|
|
ResourceUtils.getDeviceOverrideValue(res, R.array.keypress_volumes));
|
|
|
|
}
|
|
|
|
|
2013-01-18 03:19:59 +00:00
|
|
|
public static int readKeyLongpressTimeout(final SharedPreferences prefs,
|
|
|
|
final Resources res) {
|
|
|
|
final int ms = prefs.getInt(PREF_KEY_LONGPRESS_TIMEOUT, -1);
|
|
|
|
return (ms >= 0) ? ms : readDefaultKeyLongpressTimeout(res);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int readDefaultKeyLongpressTimeout(final Resources res) {
|
|
|
|
return res.getInteger(R.integer.config_default_longpress_key_timeout);
|
|
|
|
}
|
|
|
|
|
2013-01-10 03:06:00 +00:00
|
|
|
public static int readKeypressVibrationDuration(final SharedPreferences prefs,
|
2013-01-08 09:20:31 +00:00
|
|
|
final Resources res) {
|
|
|
|
final int ms = prefs.getInt(PREF_VIBRATION_DURATION_SETTINGS, -1);
|
2013-01-10 03:06:00 +00:00
|
|
|
return (ms >= 0) ? ms : readDefaultKeypressVibrationDuration(res);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int readDefaultKeypressVibrationDuration(final Resources res) {
|
2013-01-08 09:20:31 +00:00
|
|
|
return Integer.parseInt(
|
|
|
|
ResourceUtils.getDeviceOverrideValue(res, R.array.keypress_vibration_durations));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean readUsabilityStudyMode(final SharedPreferences prefs) {
|
|
|
|
return prefs.getBoolean(DebugSettings.PREF_USABILITY_STUDY_MODE, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static long readLastUserHistoryWriteTime(final SharedPreferences prefs,
|
|
|
|
final String locale) {
|
|
|
|
final String str = prefs.getString(PREF_LAST_USER_DICTIONARY_WRITE_TIME, "");
|
|
|
|
final HashMap<String, Long> map = LocaleUtils.localeAndTimeStrToHashMap(str);
|
|
|
|
if (map.containsKey(locale)) {
|
|
|
|
return map.get(locale);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void writeLastUserHistoryWriteTime(final SharedPreferences prefs,
|
|
|
|
final String locale) {
|
|
|
|
final String oldStr = prefs.getString(PREF_LAST_USER_DICTIONARY_WRITE_TIME, "");
|
|
|
|
final HashMap<String, Long> map = LocaleUtils.localeAndTimeStrToHashMap(oldStr);
|
|
|
|
map.put(locale, System.currentTimeMillis());
|
|
|
|
final String newStr = LocaleUtils.localeAndTimeHashMapToStr(map);
|
|
|
|
prefs.edit().putString(PREF_LAST_USER_DICTIONARY_WRITE_TIME, newStr).apply();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean readUseFullscreenMode(final Resources res) {
|
|
|
|
return res.getBoolean(R.bool.config_use_fullscreen_mode);
|
|
|
|
}
|
2013-03-05 03:54:13 +00:00
|
|
|
|
|
|
|
public static boolean readShowSetupWizardIcon(final SharedPreferences prefs,
|
|
|
|
final Context context) {
|
2013-04-10 02:42:16 +00:00
|
|
|
final boolean enableSetupWizardByConfig = context.getResources().getBoolean(
|
|
|
|
R.bool.config_setup_wizard_available);
|
|
|
|
if (!enableSetupWizardByConfig) {
|
|
|
|
return false;
|
|
|
|
}
|
2013-03-05 03:54:13 +00:00
|
|
|
if (!prefs.contains(Settings.PREF_SHOW_SETUP_WIZARD_ICON)) {
|
|
|
|
final ApplicationInfo appInfo = context.getApplicationInfo();
|
|
|
|
final boolean isApplicationInSystemImage =
|
|
|
|
(appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
|
|
|
|
// Default value
|
|
|
|
return !isApplicationInSystemImage;
|
|
|
|
}
|
|
|
|
return prefs.getBoolean(Settings.PREF_SHOW_SETUP_WIZARD_ICON, false);
|
|
|
|
}
|
2013-03-13 04:08:34 +00:00
|
|
|
|
|
|
|
public static boolean isInternal(final SharedPreferences prefs) {
|
|
|
|
return prefs.getBoolean(Settings.PREF_KEY_IS_INTERNAL, false);
|
|
|
|
}
|
2013-08-02 06:22:17 +00:00
|
|
|
|
|
|
|
public static boolean readUseOnlyPersonalizationDictionaryForDebug(
|
|
|
|
final SharedPreferences prefs) {
|
|
|
|
return prefs.getBoolean(
|
|
|
|
DebugSettings.PREF_USE_ONLY_PERSONALIZATION_DICTIONARY_FOR_DEBUG, false);
|
|
|
|
}
|
2011-10-27 15:33:15 +00:00
|
|
|
}
|