diff options
author | Tim Schumacher <tim@timakro.de> | 2021-02-03 12:50:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-03 12:50:01 +0100 |
commit | 1297a168507d691a29092c89f46000736a753a04 (patch) | |
tree | 13576e693ea67242d90c1c73abbd51c153e19243 /app/src/main/java/de/danoeh/antennapod/preferences | |
parent | 4ff6ff4fb73614de6498f9562bbbf392f69a6fae (diff) | |
download | AntennaPod-1297a168507d691a29092c89f46000736a753a04.zip |
Allow remapping hardware buttons (#4881)
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/preferences')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java index 311f44881..03a8edbf0 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java @@ -2,6 +2,7 @@ package de.danoeh.antennapod.preferences; import android.content.Context; import android.content.SharedPreferences; +import android.view.KeyEvent; import androidx.preference.PreferenceManager; import de.danoeh.antennapod.BuildConfig; @@ -92,5 +93,16 @@ public class PreferenceUpgrader { if (oldVersion < 1080100) { prefs.edit().putString(UserPreferences.PREF_VIDEO_BEHAVIOR, "pip").apply(); } + if (oldVersion < 2010300) { + // Migrate hardware button preferences + if (prefs.getBoolean("prefHardwareForwardButtonSkips", false)) { + prefs.edit().putString(UserPreferences.PREF_HARDWARE_FORWARD_BUTTON, + String.valueOf(KeyEvent.KEYCODE_MEDIA_NEXT)).apply(); + } + if (prefs.getBoolean("prefHardwarePreviousButtonRestarts", false)) { + prefs.edit().putString(UserPreferences.PREF_HARDWARE_PREVIOUS_BUTTON, + String.valueOf(KeyEvent.KEYCODE_MEDIA_PREVIOUS)).apply(); + } + } } } |