[Android] Display the metered warning even if the audio player is expanded

Nicolas Pomepuy git at videolan.org
Wed May 15 13:56:43 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed May 15 10:26:06 2024 +0200| [46b9cf8a520c1ef3e518c755cc96eed558244295] | committer: Nicolas Pomepuy

Display the metered warning even if the audio player is expanded

> https://code.videolan.org/videolan/vlc-android/commit/46b9cf8a520c1ef3e518c755cc96eed558244295
---

 application/vlc-android/src/org/videolan/vlc/PlaybackService.kt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
index f197f38379..1639cb386c 100644
--- a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+++ b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
@@ -150,6 +150,7 @@ import org.videolan.tools.getContextWithLocale
 import org.videolan.tools.getResourceUri
 import org.videolan.tools.readableSize
 import org.videolan.vlc.car.VLCCarService
+import org.videolan.vlc.gui.AudioPlayerContainerActivity
 import org.videolan.vlc.gui.dialogs.VideoTracksDialog
 import org.videolan.vlc.gui.dialogs.adapters.VlcTrack
 import org.videolan.vlc.gui.helpers.AudioUtil
@@ -782,7 +783,7 @@ class PlaybackService : MediaBrowserServiceCompat(), LifecycleOwner, CoroutineSc
                 Toast.makeText(this, R.string.metered_connection_stopped, Toast.LENGTH_LONG).show()
             } else {
                 AppContextProvider.currentActivity?.let {
-                    UiTools.snacker(it, R.string.metered_connection_warning)
+                    UiTools.snacker(it, R.string.metered_connection_warning, it is AudioPlayerContainerActivity && it.isAudioPlayerExpanded)
                 } ?: run {
                     Toast.makeText(this, R.string.metered_connection_warning, Toast.LENGTH_LONG).show()
                 }



More information about the Android mailing list