media3/libraries
bachinger 65962dcb37 Add Builder.setMaxCommandsForMediaItems for browser and controller
The max number of commands for media items of a browser or controller
can be configured with `setMaxCommandsForMediaItems(int)` on
`MediaController.Builder` and `MediaBrowser.Builder`. An app that has
only limited space for displaying commands can hint this limit to the
session.

A session can receive the value of a connected browser or controller
through `getMaxCommandsForMediaItems()` of a `ControllerInfo` that
is passed into every callback method. The session can then pick the most
sensible commands instead of making the browser app truncating the commands
rather randomly.

When a `MediaBrowser` is connected against a legacy `MediaBrowserServiceCompat`,
the max number of commands is automatically added to the root hints. Conversely,
the value passed in with the root hints to `MediaLibraryService` by a legacy
`MediaBrowserCompat`, is read into `ControllerInfo` like for a Media3 browser.

Issue: androidx/media#1474

#cherrypick

PiperOrigin-RevId: 679076506
2024-09-26 03:33:01 -07:00
..
2024-09-18 04:47:39 -07:00
2024-08-07 12:28:25 -07:00
2024-07-24 16:17:00 +01:00
2024-07-24 16:17:00 +01:00
2024-07-24 16:17:00 +01:00
2024-09-18 04:47:39 -07:00
2024-07-24 16:17:00 +01:00
2024-09-18 04:47:39 -07:00