[Android] Add logs to the remote server state
Nicolas Pomepuy
git at videolan.org
Mon Nov 25 11:26:11 UTC 2024
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Nov 25 09:44:03 2024 +0100| [2fd95965ca7e3d921cb45abb28e418e3562abb6f] | committer: Duncan McNamara
Add logs to the remote server state
> https://code.videolan.org/videolan/vlc-android/commit/2fd95965ca7e3d921cb45abb28e418e3562abb6f
---
.../src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt b/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt
index 9a01275bd5..84840cbb60 100644
--- a/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt
+++ b/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt
@@ -192,6 +192,7 @@ class RemoteAccessServer(private val context: Context) : PlaybackService.Callbac
releaseCallbacks()
}
.launchIn(AppScope)
+ Log.i(TAG, "Server stopped")
_serverStatus.postValue(ServerStatus.STOPPED)
settings = Settings.getInstance(context)
}
@@ -203,6 +204,7 @@ class RemoteAccessServer(private val context: Context) : PlaybackService.Callbac
*/
suspend fun start() {
clearFileDownloads()
+ Log.i(TAG, "Server connecting")
_serverStatus.postValue(ServerStatus.CONNECTING)
scope.launch {
engine = generateServer()
@@ -229,6 +231,7 @@ class RemoteAccessServer(private val context: Context) : PlaybackService.Callbac
*/
suspend fun stop() {
clearFileDownloads()
+ Log.i(TAG, "Server stopping")
_serverStatus.postValue(ServerStatus.STOPPING)
withContext(Dispatchers.IO) {
RemoteAccessWebSockets.closeAllSessions()
@@ -502,6 +505,7 @@ class RemoteAccessServer(private val context: Context) : PlaybackService.Callbac
}.apply {
environment.monitor.subscribe(ApplicationStarted) {
_serverStatus.postValue(ServerStatus.STARTED)
+ Log.i(TAG, "Server started")
AppScope.launch(Dispatchers.Main) {
PlaylistManager.showAudioPlayer.observeForever(miniPlayerObserver)
DialogActivity.loginDialogShown.observeForever(loginObserver)
More information about the Android
mailing list