OmniGears: fix wrong custom header reset
Change-Id: I142ef2036d30b2f1d6c0676258d835c3d8a4aad7
diff --git a/src/org/omnirom/omnigears/interfacesettings/StyleSettings.java b/src/org/omnirom/omnigears/interfacesettings/StyleSettings.java
index 26e2c78..d8b94e5 100644
--- a/src/org/omnirom/omnigears/interfacesettings/StyleSettings.java
+++ b/src/org/omnirom/omnigears/interfacesettings/StyleSettings.java
@@ -57,12 +57,10 @@
private static final String TAG = "StyleSettings";
private static final String CUSTOM_WALL_BROWSE = "custom_wall_browse";
private static final String CUSTOM_HEADER_BROWSE = "custom_header_browse";
- private static final String CUSTOM_HEADER_IMAGE = "status_bar_custom_header";
private static final String DAYLIGHT_HEADER_PACK = "daylight_header_pack";
private static final String CUSTOM_HEADER_IMAGE_SHADOW = "status_bar_custom_header_shadow";
private static final String CUSTOM_HEADER_PROVIDER = "custom_header_provider";
private static final String STATUS_BAR_CUSTOM_HEADER = "status_bar_custom_header";
- private static final String CUSTOM_HEADER_ENABLED = "status_bar_custom_header";
private static final String SYSTEMUI_THEME_STYLE = "systemui_theme_style";
private static final String FILE_HEADER_SELECT = "file_header_select";
@@ -103,7 +101,7 @@
mHeaderBrowse = findPreference(CUSTOM_HEADER_BROWSE);
- mHeaderEnabled = (SystemSettingSwitchPreference) findPreference(CUSTOM_HEADER_ENABLED);
+ mHeaderEnabled = (SystemSettingSwitchPreference) findPreference(STATUS_BAR_CUSTOM_HEADER);
mHeaderEnabled.setOnPreferenceChangeListener(this);
mDaylightHeaderPack = (ListPreference) findPreference(DAYLIGHT_HEADER_PACK);
@@ -144,12 +142,8 @@
if (headerEnabled) {
String settingHeaderPackage = Settings.System.getString(getContentResolver(),
Settings.System.STATUS_BAR_DAYLIGHT_HEADER_PACK);
- int valueIndex = mDaylightHeaderPack.findIndexOfValue(settingHeaderPackage);
- if (valueIndex == -1) {
- // no longer found
- Settings.System.putInt(getContentResolver(),
- Settings.System.STATUS_BAR_CUSTOM_HEADER, 0);
- } else {
+ if (settingHeaderPackage != null) {
+ int valueIndex = mDaylightHeaderPack.findIndexOfValue(settingHeaderPackage);
mDaylightHeaderPack.setValueIndex(valueIndex >= 0 ? valueIndex : 0);
mDaylightHeaderPack.setSummary(mDaylightHeaderPack.getEntry());
}