# MediaBrowserExtras

# MediaBrowserExtras

Artifact:[androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app)  
[View Source](https://cs.android.com/search?q=file:androidx/car/app/mediaextensions/MediaBrowserExtras.java+class:androidx.car.app.mediaextensions.MediaBrowserExtras)  
Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/mediaextensions/MediaBrowserExtras "View this page in Java")

<br />

```
class MediaBrowserExtras
```

<br />

*** ** * ** ***

Defines constants for extra keys in[androidx.media.MediaBrowserServiceCompat](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat).

Media apps can use these extras to enhance their analytics.

They can also take them into account to decide how many media items to return. For example, providing a number of recommendation items that is a multiple of the maximum number of items shown in a grid row will use the screen space more efficiently (avoiding blanks).

## Summary

|                                        ### Constants                                         |
|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [KEY_HINT_VIEW_MAX_CATEGORY_GRID_ITEMS_COUNT_PER_ROW](https://developer.android.com/reference/kotlin/androidx/car/app/mediaextensions/MediaBrowserExtras#KEY_HINT_VIEW_MAX_CATEGORY_GRID_ITEMS_COUNT_PER_ROW())` = "androidx.car.app.mediaextensions.KEY_HINT_VIEW_MAX_CATEGORY_GRID_ITEMS_COUNT_PER_ROW"` [Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the options bundle passed to[onLoadChildren](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onLoadChildren(java.lang.String,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>,android.os.Bundle))or to[onSearch](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onSearch(java.lang.String,android.os.Bundle,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>))to indicate how many media items tagged with[DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM](https://developer.android.com/reference/kotlin/androidx/media/utils/MediaConstants#DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM())are displayed on a single row. |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [KEY_HINT_VIEW_MAX_CATEGORY_LIST_ITEMS_COUNT_PER_ROW](https://developer.android.com/reference/kotlin/androidx/car/app/mediaextensions/MediaBrowserExtras#KEY_HINT_VIEW_MAX_CATEGORY_LIST_ITEMS_COUNT_PER_ROW())` = "androidx.car.app.mediaextensions.KEY_HINT_VIEW_MAX_CATEGORY_LIST_ITEMS_COUNT_PER_ROW"` [Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the options bundle passed to[onLoadChildren](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onLoadChildren(java.lang.String,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>,android.os.Bundle))or to[onSearch](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onSearch(java.lang.String,android.os.Bundle,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>))to indicate how many media items tagged with[DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM](https://developer.android.com/reference/kotlin/androidx/media/utils/MediaConstants#DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM())are displayed on a single row. |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [KEY_HINT_VIEW_MAX_GRID_ITEMS_COUNT_PER_ROW](https://developer.android.com/reference/kotlin/androidx/car/app/mediaextensions/MediaBrowserExtras#KEY_HINT_VIEW_MAX_GRID_ITEMS_COUNT_PER_ROW())` = "androidx.car.app.mediaextensions.KEY_HINT_VIEW_MAX_GRID_ITEMS_COUNT_PER_ROW"` [Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the options bundle passed to[onLoadChildren](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onLoadChildren(java.lang.String,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>,android.os.Bundle))or to[onSearch](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onSearch(java.lang.String,android.os.Bundle,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>))to indicate how many media items tagged with[DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM](https://developer.android.com/reference/kotlin/androidx/media/utils/MediaConstants#DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM())are displayed on a single row.                                              |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [KEY_HINT_VIEW_MAX_ITEMS_WHILE_RESTRICTED](https://developer.android.com/reference/kotlin/androidx/car/app/mediaextensions/MediaBrowserExtras#KEY_HINT_VIEW_MAX_ITEMS_WHILE_RESTRICTED())` = "androidx.car.app.mediaextensions.KEY_HINT_VIEW_MAX_ITEMS_WHILE_RESTRICTED"` [Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the options bundle passed to[onLoadChildren](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onLoadChildren(java.lang.String,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>,android.os.Bundle))or to[onSearch](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onSearch(java.lang.String,android.os.Bundle,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>))to indicate the maximum number of returned items reachable under driving restrictions.                                                                                                                                                                                                                                 |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [KEY_HINT_VIEW_MAX_LIST_ITEMS_COUNT_PER_ROW](https://developer.android.com/reference/kotlin/androidx/car/app/mediaextensions/MediaBrowserExtras#KEY_HINT_VIEW_MAX_LIST_ITEMS_COUNT_PER_ROW())` = "androidx.car.app.mediaextensions.KEY_HINT_VIEW_MAX_LIST_ITEMS_COUNT_PER_ROW"` [Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the options bundle passed to[onLoadChildren](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onLoadChildren(java.lang.String,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>,android.os.Bundle))or to[onSearch](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onSearch(java.lang.String,android.os.Bundle,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>))to indicate how many media items tagged with[DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM](https://developer.android.com/reference/kotlin/androidx/media/utils/MediaConstants#DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM())are displayed on a single row.                                              |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [KEY_ROOT_HINT_MAX_QUEUE_ITEMS_WHILE_RESTRICTED](https://developer.android.com/reference/kotlin/androidx/car/app/mediaextensions/MediaBrowserExtras#KEY_ROOT_HINT_MAX_QUEUE_ITEMS_WHILE_RESTRICTED())` = "androidx.car.app.mediaextensions.KEY_ROOT_HINT_MAX_QUEUE_ITEMS_WHILE_RESTRICTED"` [Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the rootHints bundle passed to[onGetRoot](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onGetRoot(java.lang.String,int,android.os.Bundle))to indicate the maximum number of queue items reachable under driving restrictions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [KEY_ROOT_HINT_MEDIA_HOST_VERSION](https://developer.android.com/reference/kotlin/androidx/car/app/mediaextensions/MediaBrowserExtras#KEY_ROOT_HINT_MEDIA_HOST_VERSION())` = "androidx.car.app.mediaextensions.KEY_ROOT_HINT_MEDIA_HOST_VERSION"` [Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the rootHints bundle passed to[onGetRoot](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onGetRoot(java.lang.String,int,android.os.Bundle))to indicate the version of the caller.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [KEY_ROOT_HINT_MEDIA_SESSION_API](https://developer.android.com/reference/kotlin/androidx/car/app/mediaextensions/MediaBrowserExtras#KEY_ROOT_HINT_MEDIA_SESSION_API())` = "androidx.car.app.mediaextensions.KEY_ROOT_HINT_MEDIA_SESSION_API"` [Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the rootHints bundle passed to[onGetRoot](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onGetRoot(java.lang.String,int,android.os.Bundle))to indicate which version of the media api is used by the caller                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

## Constants

### KEY_HINT_VIEW_MAX_CATEGORY_GRID_ITEMS_COUNT_PER_ROW

Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)  

```
const val KEY_HINT_VIEW_MAX_CATEGORY_GRID_ITEMS_COUNT_PER_ROW = "androidx.car.app.mediaextensions.KEY_HINT_VIEW_MAX_CATEGORY_GRID_ITEMS_COUNT_PER_ROW": String!
```

[Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the options bundle passed to[onLoadChildren](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onLoadChildren(java.lang.String,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>,android.os.Bundle))or to[onSearch](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onSearch(java.lang.String,android.os.Bundle,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>))to indicate how many media items tagged with[DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM](https://developer.android.com/reference/kotlin/androidx/media/utils/MediaConstants#DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_GRID_ITEM())are displayed on a single row.

TYPE: int - maximum number of category grid items per row.  

### KEY_HINT_VIEW_MAX_CATEGORY_LIST_ITEMS_COUNT_PER_ROW

Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)  

```
const val KEY_HINT_VIEW_MAX_CATEGORY_LIST_ITEMS_COUNT_PER_ROW = "androidx.car.app.mediaextensions.KEY_HINT_VIEW_MAX_CATEGORY_LIST_ITEMS_COUNT_PER_ROW": String!
```

[Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the options bundle passed to[onLoadChildren](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onLoadChildren(java.lang.String,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>,android.os.Bundle))or to[onSearch](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onSearch(java.lang.String,android.os.Bundle,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>))to indicate how many media items tagged with[DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM](https://developer.android.com/reference/kotlin/androidx/media/utils/MediaConstants#DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_CATEGORY_LIST_ITEM())are displayed on a single row.

TYPE: int - maximum number of category list items per row.  

### KEY_HINT_VIEW_MAX_GRID_ITEMS_COUNT_PER_ROW

Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)  

```
const val KEY_HINT_VIEW_MAX_GRID_ITEMS_COUNT_PER_ROW = "androidx.car.app.mediaextensions.KEY_HINT_VIEW_MAX_GRID_ITEMS_COUNT_PER_ROW": String!
```

[Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the options bundle passed to[onLoadChildren](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onLoadChildren(java.lang.String,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>,android.os.Bundle))or to[onSearch](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onSearch(java.lang.String,android.os.Bundle,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>))to indicate how many media items tagged with[DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM](https://developer.android.com/reference/kotlin/androidx/media/utils/MediaConstants#DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_GRID_ITEM())are displayed on a single row.

TYPE: int - maximum number of grid items per row.  

### KEY_HINT_VIEW_MAX_ITEMS_WHILE_RESTRICTED

Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)  

```
const val KEY_HINT_VIEW_MAX_ITEMS_WHILE_RESTRICTED = "androidx.car.app.mediaextensions.KEY_HINT_VIEW_MAX_ITEMS_WHILE_RESTRICTED": String!
```

[Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the options bundle passed to[onLoadChildren](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onLoadChildren(java.lang.String,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>,android.os.Bundle))or to[onSearch](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onSearch(java.lang.String,android.os.Bundle,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>))to indicate the maximum number of returned items reachable under driving restrictions.

TYPE: int - the maximum number of items when restricted, -1 when unlimited  

### KEY_HINT_VIEW_MAX_LIST_ITEMS_COUNT_PER_ROW

Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)  

```
const val KEY_HINT_VIEW_MAX_LIST_ITEMS_COUNT_PER_ROW = "androidx.car.app.mediaextensions.KEY_HINT_VIEW_MAX_LIST_ITEMS_COUNT_PER_ROW": String!
```

[Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the options bundle passed to[onLoadChildren](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onLoadChildren(java.lang.String,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>,android.os.Bundle))or to[onSearch](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onSearch(java.lang.String,android.os.Bundle,androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>))to indicate how many media items tagged with[DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM](https://developer.android.com/reference/kotlin/androidx/media/utils/MediaConstants#DESCRIPTION_EXTRAS_VALUE_CONTENT_STYLE_LIST_ITEM())are displayed on a single row.

TYPE: int - maximum number of list items per row.  

### KEY_ROOT_HINT_MAX_QUEUE_ITEMS_WHILE_RESTRICTED

Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)  

```
const val KEY_ROOT_HINT_MAX_QUEUE_ITEMS_WHILE_RESTRICTED = "androidx.car.app.mediaextensions.KEY_ROOT_HINT_MAX_QUEUE_ITEMS_WHILE_RESTRICTED": String!
```

[Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the rootHints bundle passed to[onGetRoot](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onGetRoot(java.lang.String,int,android.os.Bundle))to indicate the maximum number of queue items reachable under driving restrictions. This sublist is centered around the currently playing item.

TYPE: int - the maximum number of queue items when restricted, -1 when unlimited  

### KEY_ROOT_HINT_MEDIA_HOST_VERSION

Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)  

```
const val KEY_ROOT_HINT_MEDIA_HOST_VERSION = "androidx.car.app.mediaextensions.KEY_ROOT_HINT_MEDIA_HOST_VERSION": String!
```

[Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the rootHints bundle passed to[onGetRoot](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onGetRoot(java.lang.String,int,android.os.Bundle))to indicate the version of the caller. Note that this should only be used for analytics and is different than[KEY_ROOT_HINT_MEDIA_SESSION_API](https://developer.android.com/reference/kotlin/androidx/car/app/mediaextensions/MediaBrowserExtras#KEY_ROOT_HINT_MEDIA_SESSION_API()).

TYPE: string - the version info.  

### KEY_ROOT_HINT_MEDIA_SESSION_API

Added in[1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)  

```
const val KEY_ROOT_HINT_MEDIA_SESSION_API = "androidx.car.app.mediaextensions.KEY_ROOT_HINT_MEDIA_SESSION_API": String!
```

[Bundle](https://developer.android.com/reference/android/os/Bundle.html)key used in the rootHints bundle passed to[onGetRoot](https://developer.android.com/reference/kotlin/androidx/media/MediaBrowserServiceCompat#onGetRoot(java.lang.String,int,android.os.Bundle))to indicate which version of the media api is used by the caller

TYPE: int - the media api level (1, 2, 3).