Skip to content

Commit ac1ab17

Browse files
committed
PlayerService: return appropriate IBinder depending on the action
1 parent f56131b commit ac1ab17

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/src/main/java/org/schabi/newpipe/player/PlayerService.kt

+7-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,13 @@ class PlayerService : MediaBrowserServiceCompat() {
177177
super.attachBaseContext(AudioServiceLeakFix.preventLeakOf(base))
178178
}
179179

180-
override fun onBind(intent: Intent): IBinder = mBinder
180+
override fun onBind(intent: Intent): IBinder? {
181+
if (SERVICE_INTERFACE == intent.action) {
182+
// For actions related to the media browser service, pass the onBind to the superclass
183+
return super.onBind(intent)
184+
}
185+
return mBinder
186+
}
181187

182188
// MediaBrowserServiceCompat methods (they defer function calls to mediaBrowserConnector)
183189
override fun onGetRoot(

0 commit comments

Comments
 (0)