summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Perez <robertoalexis@google.com>2018-05-21 14:26:35 -0700
committerRoberto Perez <robertoalexis@google.com>2018-05-21 16:28:31 -0700
commite8f6fb8b486c5ae99452d2fc93a922d80df1d76d (patch)
tree0bac442715066830480a951f459e73100bc4acc3
parent8a97fbcb2a74f960798dac29bca522cc8870daf3 (diff)
downloadMedia-e8f6fb8b486c5ae99452d2fc93a922d80df1d76d.tar.gz
Sending 'prepare' command to media sources when switching apps.
Also, re-enabling radio as one of the potential media sources in app selector (disabled for Big Dog demo). Bug: 78512655 Test: Launched on Mojave Change-Id: Ic383bb756d87f299e8428e4d835dbd1941809c2f
-rw-r--r--src/com/android/car/media/MediaActivity.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/car/media/MediaActivity.java b/src/com/android/car/media/MediaActivity.java
index 6a502b0..762a4fe 100644
--- a/src/com/android/car/media/MediaActivity.java
+++ b/src/com/android/car/media/MediaActivity.java
@@ -410,10 +410,13 @@ public class MediaActivity extends CarDrawerActivity implements BrowseFragment.C
if (Log.isLoggable(TAG, Log.INFO)) {
Log.i(TAG, "Browsing: " + mediaSource.getName());
}
+ // Prepare the media source for playback
+ mPlaybackModel.onPrepare();
+ // Make the drawer display browse information of the selected source
ComponentName component = mMediaSource.getBrowseServiceComponentName();
MediaManager.getInstance(this).setMediaClientComponent(component);
// If content forward browsing is disabled, then no need to subscribe to this media
- // source.
+ // source, we will use the drawer instead.
if (mContentForwardBrowseEnabled) {
Log.i(TAG, "Content forward is enabled: subscribing to " +
mMediaSource.getPackageName());
@@ -635,7 +638,7 @@ public class MediaActivity extends CarDrawerActivity implements BrowseFragment.C
public List<MediaSource> getMediaSources() {
return mMediaSourcesManager.getMediaSources()
.stream()
- .filter(source -> source.getMediaBrowser() != null && !source.isCustom())
+ .filter(source -> source.getMediaBrowser() != null || source.isCustom())
.collect(Collectors.toList());
}