MediaNotificationHandler tries to connect session in the same
process, so tests should be aware MediaControllers from the
MediaNotificationHandler.
PiperOrigin-RevId: 422330424
This is a small refactoring toward merging
MediaNotificationHandler and PlayerNotificationManager
In detail, this CL includes following changes:
- Use MediaController to dispatch commands to sessions in
MediaSessionService, rather than media key events.
- Use MediaController to monitor changes in MediaSession's
underlying Player, rather than ForegroundServiceEventCallback.
Removed the callback interface as well.
PiperOrigin-RevId: 422049265
MediaController tries to release itself when the binder to the
session becomes unavailable. However, if such thing happens while
connecting in the constructor, it causes NPE when accessing
MediaControllerImpl which is only initialized after it's
connected.
This fixes random failures in existing tests.
PiperOrigin-RevId: 421423381
A session may not notify its release back to the controller
when the controller is connecting while the session is releasing.
Here are issues in detail:
- MediaSession doesn't respond to controller's connection
request when it's released.
- MediaSession discards incoming connection requests when it's
released. The requests are only kept in the application
looper, but the looper is cleared when the session is
released.
This CL fixes the above issues, and fixes some flaky tests.
PiperOrigin-RevId: 419756158
When calling Android's Log class directly, there's a LongLogTag
lint check that detects tags over the 23 char limit, however it
cannot detect long log tags in ExoPlayer due to the way that we
log via our own Log class. This commit adds @Size annotations to
enforce the same rule.
PiperOrigin-RevId: 413976364
Where this introduced an inconsistency (e.g. assigning to something
called `windowIndex`), I generally renamed the transitive closure of
identifiers to maintain consistency (meaning this change is quite
large). The exception is code that interacts with Timeline and Window
directly, where sometimes I kept the 'window' nomenclature.
#minor-release
PiperOrigin-RevId: 407040052
Only deprecated references remain.
Usages of the deprecated methods will be migrated in a follow-up change.
#minor-release
PiperOrigin-RevId: 405927141