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/VibratorTuningPreference.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/VibratorTuningPreference.java')
-rw-r--r-- | GNexusParts/src/com/cyanogenmod/settings/device/VibratorTuningPreference.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/GNexusParts/src/com/cyanogenmod/settings/device/VibratorTuningPreference.java b/GNexusParts/src/com/cyanogenmod/settings/device/VibratorTuningPreference.java index f8aec17..fce408f 100644 --- a/GNexusParts/src/com/cyanogenmod/settings/device/VibratorTuningPreference.java +++ b/GNexusParts/src/com/cyanogenmod/settings/device/VibratorTuningPreference.java @@ -31,12 +31,12 @@ import android.util.Log; import android.os.Vibrator; /** - * Special preference type that allows configuration of both the ring volume and - * notification volume. + * Special preference type that allows configuration of vibrator intensity settings on Nexus + * Devices */ public class VibratorTuningPreference extends DialogPreference implements OnClickListener { - private static final String TAG = "vibrator..."; + private static final String TAG = "VIBRATOR..."; private static final int[] SEEKBAR_ID = new int[] { R.id.vibrator_seekbar @@ -110,7 +110,7 @@ public class VibratorTuningPreference extends DialogPreference implements OnClic } /** - * Restore screen color tuning from SharedPreferences. (Write to kernel.) + * Restore vibrator tuning from SharedPreferences. (Write to kernel.) * * @param context The context to read the SharedPreferences from */ @@ -125,13 +125,16 @@ public class VibratorTuningPreference extends DialogPreference implements OnClic for (String filePath : FILE_PATH) { String sDefaultValue = Utils.readOneLine(filePath); int iValue = sharedPrefs.getInt(filePath, Integer.valueOf(sDefaultValue)); - if (bFirstTime) + if (bFirstTime){ Utils.writeValue(filePath, "100"); - else + Log.d(TAG, "restore default value: 100 File: " + filePath); + } + else{ Utils.writeValue(filePath, String.valueOf((long) iValue)); + Log.d(TAG, "restore: iValue: " + iValue + " File: " + filePath); + } } - if (bFirstTime) - { + if (bFirstTime) { SharedPreferences.Editor editor = sharedPrefs.edit(); editor.putBoolean("FirstTimevibrator", false); editor.commit(); @@ -139,7 +142,7 @@ public class VibratorTuningPreference extends DialogPreference implements OnClic } /** - * Check whether the running kernel supports color tuning or not. + * Check whether the running kernel supports vibrator tuning or not. * * @return Whether color tuning is supported or not */ @@ -177,8 +180,6 @@ public class VibratorTuningPreference extends DialogPreference implements OnClic iOffset = offsetValue; iMax = maxValue; - SharedPreferences sharedPreferences = getSharedPreferences(); - // Read original value if (Utils.fileExists(mFilePath)) { String sDefaultValue = Utils.readOneLine(mFilePath); |