Make MediaSessionConnector depend on PlaybackException

PiperOrigin-RevId: 377529353
This commit is contained in:
aquilescanta 2021-06-04 17:37:32 +01:00 committed by bachinger
parent fd4cfcdd67
commit 146648ce22

View file

@ -44,9 +44,9 @@ import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ControlDispatcher;
import com.google.android.exoplayer2.DefaultControlDispatcher;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.util.Assertions;
@ -475,7 +475,7 @@ public final class MediaSessionConnector {
private Map<String, CustomActionProvider> customActionMap;
@Nullable private MediaMetadataProvider mediaMetadataProvider;
@Nullable private Player player;
@Nullable private ErrorMessageProvider<? super ExoPlaybackException> errorMessageProvider;
@Nullable private ErrorMessageProvider<? super PlaybackException> errorMessageProvider;
@Nullable private Pair<Integer, CharSequence> customError;
@Nullable private Bundle customErrorExtras;
@Nullable private PlaybackPreparer playbackPreparer;
@ -598,7 +598,7 @@ public final class MediaSessionConnector {
* @param errorMessageProvider The error message provider.
*/
public void setErrorMessageProvider(
@Nullable ErrorMessageProvider<? super ExoPlaybackException> errorMessageProvider) {
@Nullable ErrorMessageProvider<? super PlaybackException> errorMessageProvider) {
if (this.errorMessageProvider != errorMessageProvider) {
this.errorMessageProvider = errorMessageProvider;
invalidateMediaSessionPlaybackState();
@ -799,7 +799,7 @@ public final class MediaSessionConnector {
customActionMap = Collections.unmodifiableMap(currentActions);
Bundle extras = new Bundle();
@Nullable ExoPlaybackException playbackError = player.getPlayerError();
@Nullable PlaybackException playbackError = player.getPlayerError();
boolean reportError = playbackError != null || customError != null;
int sessionPlaybackState =
reportError