am 5e36df02: am 39291f60: am 81a0690f: Resseting volume button to "do nothing" on upgrade
# Via Android Git Automerger (2) and Isaac Katzenelson (1)
* commit '5e36df02424cf9657296d8de05a26981e95398e8':
Resseting volume button to "do nothing" on upgrade
diff --git a/src/com/android/deskclock/AlarmInitReceiver.java b/src/com/android/deskclock/AlarmInitReceiver.java
index 1dd7bb3..b2625f1 100644
--- a/src/com/android/deskclock/AlarmInitReceiver.java
+++ b/src/com/android/deskclock/AlarmInitReceiver.java
@@ -58,7 +58,7 @@
if (!prefs.getBoolean(PREF_VOLUME_DEF_DONE, false)) {
// Fix the default
- Log.v("AlarmInitReceiver - checking volume button default");
+ Log.v("AlarmInitReceiver - resetting volume button default");
switchVolumeButtonDefault(prefs);
}
}
@@ -73,17 +73,8 @@
private void switchVolumeButtonDefault(SharedPreferences prefs) {
SharedPreferences.Editor editor = prefs.edit();
- // Get the volume button behavior setting
- final String vol = prefs.getString(SettingsActivity.KEY_VOLUME_BEHAVIOR,
- SettingsActivity.DEFAULT_VOLUME_BEHAVIOR);
- // If the setting is "Snooze", change it to "Do Nothing"
- if (SettingsActivity.OLD_DEFAULT_VOLUME_BEHAVIOR.equals(vol)) {
- editor.putString(SettingsActivity.KEY_VOLUME_BEHAVIOR,
- SettingsActivity.DEFAULT_VOLUME_BEHAVIOR);
- Log.v("AlarmInitReceiver - Reset volume button default");
- } else {
- Log.v("AlarmInitReceiver - No need to reset volume button default");
- }
+ editor.putString(SettingsActivity.KEY_VOLUME_BEHAVIOR,
+ SettingsActivity.DEFAULT_VOLUME_BEHAVIOR);
// Make sure we do it only once
editor.putBoolean(PREF_VOLUME_DEF_DONE, true);
diff --git a/src/com/android/deskclock/SettingsActivity.java b/src/com/android/deskclock/SettingsActivity.java
index 9465670..bafe95f 100644
--- a/src/com/android/deskclock/SettingsActivity.java
+++ b/src/com/android/deskclock/SettingsActivity.java
@@ -64,9 +64,7 @@
static final String KEY_VOLUME_BUTTONS =
"volume_button_setting";
- // Old and new default preferences, needed to switch the default on upgrade
public static final String DEFAULT_VOLUME_BEHAVIOR = "0";
- public static final String OLD_DEFAULT_VOLUME_BEHAVIOR = "1";
private static CharSequence[][] mTimezones;
private long mTime;