diff options
author | Markus Reumueller <reumuellermarkus@gmail.com> | 2012-12-08 18:07:30 +0100 |
---|---|---|
committer | Robert Burns <burnsra@gmail.com> | 2012-12-13 16:31:52 -0500 |
commit | 8d0aaa3342810ea2fce3fb432b60ce745a6e4d9e (patch) | |
tree | 1748c89680f17a52e17dc8bf80e9eef331460d14 /GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java | |
parent | 0d53a7c1e173de9c5d19feca3c70c5d3099fa3d5 (diff) | |
download | device_samsung_tuna-8d0aaa3342810ea2fce3fb432b60ce745a6e4d9e.zip device_samsung_tuna-8d0aaa3342810ea2fce3fb432b60ce745a6e4d9e.tar.gz device_samsung_tuna-8d0aaa3342810ea2fce3fb432b60ce745a6e4d9e.tar.bz2 |
Bugfix --> presets are not restored after reboot
Some cleanups
German Translation
PatchSet2: derp...
Change-Id: Ic85b340ea67b1c5e1b80bc62e40238bc6fde5eff
Diffstat (limited to 'GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java')
-rw-r--r-- | GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java b/GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java index 3c5aef0..b54bc58 100644 --- a/GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java +++ b/GNexusParts/src/com/cyanogenmod/settings/device/GammaTuningPreference.java @@ -30,8 +30,8 @@ import android.widget.Button; import android.util.Log; /** - * Special preference type that allows configuration of both the ring volume and - * notification volume. + * Special preference type that allows configuration of Gamma settings on Nexus + * Devices */ public class GammaTuningPreference extends DialogPreference implements OnClickListener { @@ -117,7 +117,7 @@ public class GammaTuningPreference extends DialogPreference implements OnClickLi } /** - * Restore screen color tuning from SharedPreferences. (Write to kernel.) + * Restore screen gamma tuning from SharedPreferences. (Write to kernel.) * * @param context The context to read the SharedPreferences from */ @@ -133,10 +133,14 @@ public class GammaTuningPreference extends DialogPreference implements OnClickLi for (String filePath : FILE_PATH) { String sDefaultValue = Utils.readOneLine(filePath); iValue = sharedPrefs.getInt(filePath, Integer.valueOf(sDefaultValue)); - if (bFirstTime) + if (bFirstTime){ Utils.writeValue(filePath, "0"); - else + Log.d(TAG, "restore default value: 0 File: " + filePath); + } + else{ Utils.writeValue(filePath, String.valueOf((long) iValue)); + Log.d(TAG, "restore: iValue: " + iValue + " File: " + filePath); + } } if (bFirstTime) { @@ -185,8 +189,6 @@ public class GammaTuningPreference extends DialogPreference implements OnClickLi iOffset = offsetValue; iMax = maxValue; - SharedPreferences sharedPreferences = getSharedPreferences(); - // Read original value if (Utils.fileExists(mFilePath)) { String sDefaultValue = Utils.readOneLine(mFilePath); |