Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Fix some bugs in service
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhasDissa committed Jun 23, 2023
1 parent 94edaed commit 0f4e5c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".backend.services.PlayerService"
<service android:name="app.suhasdissa.mellowmusic.backend.services.PlayerService"
android:foregroundServiceType="mediaPlayback"
android:exported="true">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package app.suhasdissa.mellowmusic.backend.services

import android.content.Intent
import android.media.audiofx.LoudnessEnhancer
import android.os.Handler
import androidx.core.net.toUri
Expand Down Expand Up @@ -73,12 +72,9 @@ class PlayerService : MediaSessionService(), MediaSession.Callback, Player.Liste
override fun onGetSession(controllerInfo: MediaSession.ControllerInfo): MediaSession? =
mediaSession

override fun onTaskRemoved(rootIntent: Intent?) {
super.onTaskRemoved(rootIntent)
}

@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
override fun onDestroy() {
player.removeListener(this)
mediaSession?.run {
player.stop()
player.release()
Expand Down

0 comments on commit 0f4e5c2

Please sign in to comment.