diff options
-rw-r--r-- | res/values/strings.xml | 4 | ||||
-rw-r--r-- | res/xml/preferences.xml | 6 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/preferences/UserPreferences.java | 14 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/service/PlaybackService.java | 2 |
4 files changed, 13 insertions, 13 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 2060dc777..cf33d0b4c 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -250,7 +250,7 @@ <string name="folder_not_empty_dialog_title">Folder is not empty</string> <string name="folder_not_empty_dialog_msg">The folder you have selected is not empty. Media downloads and other files will be placed directly in this folder. Continue anyway?</string> <string name="set_to_default_folder">Choose default folder</string> - <string name="pref_pausePlaybackForNotifications_sum">Pause playback instead of lowering volume when another app wants to play sounds</string> - <string name="pref_pausePlaybackForNotifications_title">Pause for notifications</string> + <string name="pref_pausePlaybackForFocusLoss_sum">Pause playback instead of lowering volume when another app wants to play sounds</string> + <string name="pref_pausePlaybackForFocusLoss_title">Pause for interruptions</string> </resources>
\ No newline at end of file diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 2cc4c7237..931aa5c2d 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -20,9 +20,9 @@ <CheckBoxPreference android:defaultValue="false" android:enabled="true" - android:key="prefPauseForNotifications" - android:summary="@string/pref_pausePlaybackForNotifications_sum" - android:title="@string/pref_pausePlaybackForNotifications_title" /> + android:key="prefPauseForFocusLoss" + android:summary="@string/pref_pausePlaybackForFocusLoss_sum" + android:title="@string/pref_pausePlaybackForFocusLoss_title" /> </PreferenceCategory> <PreferenceCategory android:title="@string/network_pref" > <ListPreference diff --git a/src/de/danoeh/antennapod/preferences/UserPreferences.java b/src/de/danoeh/antennapod/preferences/UserPreferences.java index 662db9b17..a7df27ddc 100644 --- a/src/de/danoeh/antennapod/preferences/UserPreferences.java +++ b/src/de/danoeh/antennapod/preferences/UserPreferences.java @@ -41,7 +41,7 @@ public class UserPreferences implements public static final String PREF_ENABLE_AUTODL_WIFI_FILTER = "prefEnableAutoDownloadWifiFilter"; private static final String PREF_AUTODL_SELECTED_NETWORKS = "prefAutodownloadSelectedNetworks"; public static final String PREF_EPISODE_CACHE_SIZE = "prefEpisodeCacheSize"; - public static final String PREF_PAUSE_PLAYBACK_FOR_NOTIFICATIONS = "prefPauseForNotifications"; + public static final String PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS = "prefPauseForFocusLoss"; private static int EPISODE_CACHE_SIZE_UNLIMITED = -1; @@ -61,7 +61,7 @@ public class UserPreferences implements private boolean enableAutodownloadWifiFilter; private String[] autodownloadSelectedNetworks; private int episodeCacheSize; - private boolean pauseForNotifications; + private boolean pauseForFocusLoss; private UserPreferences(Context context) { this.context = context; @@ -110,7 +110,7 @@ public class UserPreferences implements episodeCacheSize = readEpisodeCacheSize(sp.getString( PREF_EPISODE_CACHE_SIZE, "20")); enableAutodownload = sp.getBoolean(PREF_ENABLE_AUTODL, false); - pauseForNotifications = sp.getBoolean(PREF_PAUSE_PLAYBACK_FOR_NOTIFICATIONS, false); + pauseForFocusLoss = sp.getBoolean(PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS, false); } private int readThemeValue(String valueFromPrefs) { @@ -214,9 +214,9 @@ public class UserPreferences implements return instance.enableAutodownload; } - public static boolean shouldPauseForNotifications() { + public static boolean shouldPauseForFocusLoss() { instanceAvailable(); - return instance.pauseForNotifications; + return instance.pauseForFocusLoss; } @Override @@ -258,8 +258,8 @@ public class UserPreferences implements PREF_EPISODE_CACHE_SIZE, "20")); } else if (key.equals(PREF_ENABLE_AUTODL)) { enableAutodownload = sp.getBoolean(PREF_ENABLE_AUTODL, false); - } else if (key.equals(PREF_PAUSE_PLAYBACK_FOR_NOTIFICATIONS)) { - pauseForNotifications = sp.getBoolean(PREF_PAUSE_PLAYBACK_FOR_NOTIFICATIONS, false); + } else if (key.equals(PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS)) { + pauseForFocusLoss = sp.getBoolean(PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS, false); } } diff --git a/src/de/danoeh/antennapod/service/PlaybackService.java b/src/de/danoeh/antennapod/service/PlaybackService.java index 5e0f6b46e..d04046223 100644 --- a/src/de/danoeh/antennapod/service/PlaybackService.java +++ b/src/de/danoeh/antennapod/service/PlaybackService.java @@ -353,7 +353,7 @@ public class PlaybackService extends Service { break; case AudioManager.AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK: if (status == PlayerStatus.PLAYING) { - if (!UserPreferences.shouldPauseForNotifications()) { + if (!UserPreferences.shouldPauseForFocusLoss()) { if (AppConfig.DEBUG) Log.d(TAG, "Lost audio focus temporarily. Ducking..."); audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, |