mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Make all the pref defaults in the code the same as defaults in XML, to be double safe, even though redundant
This commit is contained in:
parent
a5e1f2b197
commit
c49c8dfa46
|
@ -65,16 +65,16 @@ final class DecodeThread extends Thread {
|
|||
if (decodeFormats == null || decodeFormats.isEmpty()) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
decodeFormats = EnumSet.noneOf(BarcodeFormat.class);
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_1D_PRODUCT, false)) {
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_1D_PRODUCT, true)) {
|
||||
decodeFormats.addAll(DecodeFormatManager.PRODUCT_FORMATS);
|
||||
}
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_1D_INDUSTRIAL, false)) {
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_1D_INDUSTRIAL, true)) {
|
||||
decodeFormats.addAll(DecodeFormatManager.INDUSTRIAL_FORMATS);
|
||||
}
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_QR, false)) {
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_QR, true)) {
|
||||
decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
|
||||
}
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_DATA_MATRIX, false)) {
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_DATA_MATRIX, true)) {
|
||||
decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
|
||||
}
|
||||
if (prefs.getBoolean(PreferencesActivity.KEY_DECODE_AZTEC, false)) {
|
||||
|
|
|
@ -172,7 +172,7 @@ public final class LocaleManager {
|
|||
|
||||
public static String getCountry(Context context) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
String countryOverride = prefs.getString(PreferencesActivity.KEY_SEARCH_COUNTRY, null);
|
||||
String countryOverride = prefs.getString(PreferencesActivity.KEY_SEARCH_COUNTRY, "-");
|
||||
if (countryOverride != null && !countryOverride.isEmpty() && !"-".equals(countryOverride)) {
|
||||
return countryOverride;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public enum FrontLightMode {
|
|||
}
|
||||
|
||||
public static FrontLightMode readPref(SharedPreferences sharedPrefs) {
|
||||
return parse(sharedPrefs.getString(PreferencesActivity.KEY_FRONT_LIGHT_MODE, null));
|
||||
return parse(sharedPrefs.getString(PreferencesActivity.KEY_FRONT_LIGHT_MODE, OFF.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue