Skip to content

Commit

Permalink
PlayerService: return appropriate IBinder depending on the action
Browse files Browse the repository at this point in the history
  • Loading branch information
haggaie committed Dec 14, 2024
1 parent 9d750ed commit f6f7c37
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/src/main/java/org/schabi/newpipe/player/PlayerService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,13 @@ class PlayerService : MediaBrowserServiceCompat() {
super.attachBaseContext(AudioServiceLeakFix.preventLeakOf(base))
}

override fun onBind(intent: Intent): IBinder = mBinder
override fun onBind(intent: Intent): IBinder? {
if (SERVICE_INTERFACE == intent.action) {
// For actions related to the media browser service, pass the onBind to the superclass
return super.onBind(intent)
}
return mBinder
}

// MediaBrowserServiceCompat methods (they defer function calls to mediaBrowserConnector)
override fun onGetRoot(
Expand Down

0 comments on commit f6f7c37

Please sign in to comment.