Skip to content

Commit 6024cc5

Browse files
nift4marcbaechinger
authored andcommitted
session: fix IllegalStateException when calling setSessionExtras()
...from thread which isn't application thread. This change makes the demo app work with player using a non-main application thread.
1 parent 3591919 commit 6024cc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/session/src/main/java/androidx/media3/session/MediaSessionLegacyStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ public void onSessionExtrasChanged(int seq, Bundle sessionExtras) {
11351135
PlayerWrapper playerWrapper = sessionImpl.getPlayerWrapper();
11361136
playerWrapper.setLegacyExtras(sessionExtras);
11371137
sessionCompat.setExtras(playerWrapper.getLegacyExtras());
1138-
sessionCompat.setPlaybackState(sessionImpl.getPlayerWrapper().createPlaybackStateCompat());
1138+
updateLegacySessionPlaybackState(sessionImpl.getPlayerWrapper());
11391139
}
11401140

11411141
@Override

0 commit comments

Comments
 (0)