Skip to content

Commit

Permalink
Make media2 extension depend on androidx media2 1.1.0
Browse files Browse the repository at this point in the history
Issue: #8011
PiperOrigin-RevId: 347288689
  • Loading branch information
sungsoo authored and icbaker committed Jan 11, 2021
1 parent 3a0b1f7 commit a015b7e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 146 deletions.
4 changes: 4 additions & 0 deletions RELEASENOTES.md
Expand Up @@ -13,6 +13,10 @@
* Text:
* Gracefully handle null-terminated subtitle content in Matroska
containers.
* Media2 extension
* Make media2-extension depend on AndroidX media2:media2-session:1.1.0 to
fix a deadlock while creating PlaybackStateCompat internally.
([#8011](https://github.com/google/ExoPlayer/issues/8011)).

### 2.12.2 (2020-12-01) ###

Expand Down
2 changes: 2 additions & 0 deletions constants.gradle
Expand Up @@ -32,7 +32,9 @@ project.ext {
androidxAnnotationVersion = '1.1.0'
androidxAppCompatVersion = '1.1.0'
androidxCollectionVersion = '1.1.0'
androidxFuturesVersion = '1.1.0'
androidxMediaVersion = '1.0.1'
androidxMedia2Version = '1.1.0'
androidxMultidexVersion = '2.0.0'
androidxRecyclerViewVersion = '1.1.0'
androidxTestCoreVersion = '1.2.0'
Expand Down
4 changes: 2 additions & 2 deletions extensions/media2/build.gradle
Expand Up @@ -18,8 +18,8 @@ android.defaultConfig.minSdkVersion 19
dependencies {
implementation project(modulePrefix + 'library-core')
implementation 'androidx.collection:collection:' + androidxCollectionVersion
implementation 'androidx.concurrent:concurrent-futures:1.1.0'
api 'androidx.media2:media2-session:1.0.3'
implementation 'androidx.concurrent:concurrent-futures:' + androidxFuturesVersion
api 'androidx.media2:media2-session:' + androidxMedia2Version
compileOnly 'org.checkerframework:checker-compat-qual:' + checkerframeworkCompatVersion
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -437,8 +437,6 @@ public int getNextMediaItemIndex() {
/* defaultValueWhenException= */ END_OF_PLAYLIST);
}

// TODO(b/147706139): Call super.close() after updating media2-common to 1.1.0
@SuppressWarnings("MissingSuperCall")
@Override
public void close() {
synchronized (stateLock) {
Expand All @@ -454,6 +452,7 @@ public void close() {
player.close();
return null;
});
super.close();
}

// SessionPlayerConnector-specific functions.
Expand Down Expand Up @@ -559,8 +558,8 @@ private void notifySessionPlayerCallback(SessionPlayerCallbackNotifier notifier)
}
}

// TODO: Remove this suppress warnings and call onCurrentMediaItemChanged with a null item
// once AndroidX media2 1.2.0 is released
// TODO(internal b/160846312): Remove this suppress warnings and call onCurrentMediaItemChanged
// with a null item once we depend on media2 1.2.0.
@SuppressWarnings("nullness:argument.type.incompatible")
private void handlePlaylistChangedOnHandler() {
List<MediaItem> currentPlaylist = player.getPlaylist();
Expand All @@ -578,11 +577,6 @@ private void handlePlaylistChangedOnHandler() {
SessionPlayerConnector.this, currentPlaylist, playlistMetadata);
if (notifyCurrentMediaItem) {
callback.onCurrentMediaItemChanged(SessionPlayerConnector.this, currentMediaItem);

// Workaround for MediaSession's issue that current media item change isn't propagated
// to the legacy controllers.
// TODO(b/160846312): Remove this workaround with media2 1.1.0-stable.
callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition);
}
});
}
Expand All @@ -597,11 +591,6 @@ private void notifySkipToCompletedOnHandler() {
notifySessionPlayerCallback(
callback -> {
callback.onCurrentMediaItemChanged(SessionPlayerConnector.this, currentMediaItem);

// Workaround for MediaSession's issue that current media item change isn't propagated
// to the legacy controllers.
// TODO(b/160846312): Remove this workaround with media2 1.1.0-stable.
callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition);
});
}

Expand Down Expand Up @@ -722,11 +711,6 @@ public void onCurrentMediaItemChanged(MediaItem mediaItem) {
notifySessionPlayerCallback(
callback -> {
callback.onCurrentMediaItemChanged(SessionPlayerConnector.this, mediaItem);

// Workaround for MediaSession's issue that current media item change isn't propagated
// to the legacy controllers.
// TODO(b/160846312): Remove this workaround with media2 1.1.0-stable.
callback.onSeekCompleted(SessionPlayerConnector.this, currentPosition);
});
}

Expand Down

0 comments on commit a015b7e

Please sign in to comment.