MediaPlaylistAgent is the abstract class an application needs to
derive from to pass an object to a MediaSession2 that will override
default playlist handling behaviors. It contains a set of notify*
methods to signal MediaSession2 that playlist-related state has
changed.
Bug: 64098437
Test: make update-api
Change-Id: Icb3c57ddc14eba276f49d4ba85f11adbeb3e0917
Added callback for session to know the currently playing media item has
changed.
Note that the callback is called in response to the
MediaPlayerBase#PlayerEventCallback#onCurrentDataSourceChanged(mpb, dsd
is called. Session will translate dsd to the media item and calls
onCurrentMediaItemChanged().
Following changes are also included
- Removed MediaPlaylistController#getCurrentPlaylistItem(),
because currently playing item is managed by the MediaPlayerBase.
- Renamed ControllerCallback#onCurrentPlaylistItemChanged() to the
ControllerCallback#onCurrentMediaItemChanged(), to make it more
obvious that the event is from MediaPlayerBase, not
MediaPlaylistController.
- Added SessionCallback#onCurrentMediaItemChanged()
Bug: 64098437
Test: Run MediaComponents test
Change-Id: I78b124a7da0f968b097b2576507b9a73e36081ec
This allows a developer to create DataSourceDesc when the item is about
to be played. Typical example of the usages are,
1. For a playlist consists of FileDescriptors, its developer may not
want to open all files when MediaSession2.setPlaylist() is
called.
2. A controller has called setPlaylist(), addPlaylistItem(), or
replacePlaylistItem(). Controller cannot know the
DataSourceDesc, and only the session developer can know about
it.
Bug: 64098437
Test: Run MediaComponents test
Change-Id: I73f27ca0a799b1cddf5046b41f0ca01d08037103
We may get NPE if mCarrierIdentifier is null. + should convert it to
string by itself.
Test: test on phone
Merged-In: Ibd352d6d2a9b0cb33a494d108eb0d3a7c1dbc61b
Change-Id: Ibd352d6d2a9b0cb33a494d108eb0d3a7c1dbc61b
Change the dumpsys timestamps to use java.time for processing and always
log events with local timezone that was in effect at the time the event
happened.
Bug: 74250969
Test: manual, run dumpsys
Change-Id: Ie53cff4400be1528b3224bd556536a689ef22c8c