# MediaLibraryService.LibraryParams

# MediaLibraryService.LibraryParams

Artifact:[androidx.media3:media3-session](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/session/MediaLibraryService.java+class:androidx.media3.session.MediaLibraryService.LibraryParams)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/session/MediaLibraryService.LibraryParams "View this page in Java")

<br />

```
class MediaLibraryService.LibraryParams
```

<br />

*** ** * ** ***

Parameters for the interaction between[MediaBrowser](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaBrowser)and[MediaLibrarySession](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession).

When a[MediaBrowser](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaBrowser)specifies the parameters, the[MediaLibrarySession](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession)is recommended to provide a result matching the parameters, but it's not an error if[MediaLibrarySession](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession)can't fulfil the request.

Multiple parameters can be combined together, for example to request[suggested](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams#isSuggested())items that are also[offline](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams#isOffline()).

## Summary

|                                                                                                                                               ### Nested types                                                                                                                                                |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[MediaLibraryService.LibraryParams.Builder](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams.Builder) A builder for[LibraryParams](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams). |

|                                                                      ### Public functions                                                                      |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[MediaLibraryService.LibraryParams](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams)`!` | `@`[UnstableApi](https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi) [fromBundle](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams#fromBundle(android.os.Bundle))`(bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`!)` Restores a`LibraryParams`from a[Bundle](https://developer.android.com/reference/android/os/Bundle.html). |
| [Bundle](https://developer.android.com/reference/android/os/Bundle.html)`!`                                                                                    | `@`[UnstableApi](https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi) [toBundle](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams#toBundle())`()`                                                                                                                                                                                                                  |

|                                ### Public properties                                |
|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle.html)`!`         | `@`[UnstableApi](https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi) [extras](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams#extras()) An extra[Bundle](https://developer.android.com/reference/android/os/Bundle.html)for the private contract between[MediaBrowser](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaBrowser)and[MediaLibrarySession](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession). |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isOffline](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams#isOffline()) Whether the media items can be played without an internet connection.                                                                                                                                                                                                                                                                                                                                                                                           |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isRecent](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams#isRecent()) Whether the media items are recently played.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isSuggested](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams#isSuggested()) Whether the media items are suggested.                                                                                                                                                                                                                                                                                                                                                                                                                      |

## Public functions

### fromBundle

```
@UnstableApi
java-static fun fromBundle(bundle: Bundle!): MediaLibraryService.LibraryParams!
```

Restores a`LibraryParams`from a[Bundle](https://developer.android.com/reference/android/os/Bundle.html).  

### toBundle

```
@UnstableApi
fun toBundle(): Bundle!
```  

## Public properties

### extras

```
@UnstableApi
val extras: Bundle!
```

An extra[Bundle](https://developer.android.com/reference/android/os/Bundle.html)for the private contract between[MediaBrowser](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaBrowser)and[MediaLibrarySession](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession).  

### isOffline

```
val isOffline: Boolean
```

Whether the media items can be played without an internet connection.

When a[MediaBrowser](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaBrowser)specifies it as`true`, the[MediaLibrarySession](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession)is recommended to provide offline media items. If so, the implementation must return the parameter with`true`as well.

When a[MediaBrowser](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaBrowser)specifies it as`false`, the[MediaLibrarySession](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession)doesn't have to care about the offline playability of media items.  

### isRecent

```
val isRecent: Boolean
```

Whether the media items are recently played.

When a[MediaBrowser](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaBrowser)specifies it as`true`, the[MediaLibrarySession](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession)is recommended to provide the recently played media items. If so, the implementation must return the parameter with`true`as well. The list of media items is sorted by relevance, the first being the most recent.

When a[MediaBrowser](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaBrowser)specifies it as`false`, the[MediaLibrarySession](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession)doesn't have to care about the recentness of media items.  

### isSuggested

```
val isSuggested: Boolean
```

Whether the media items are suggested.

When a[MediaBrowser](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaBrowser)specifies it as`true`, the[MediaLibrarySession](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession)is recommended to provide suggested media items. If so, the implementation must return the parameter with`true`as well. The list of media items is sorted by relevance, the first being the top suggestion.

When a[MediaBrowser](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaBrowser)specifies it as`false`, the[MediaLibrarySession](https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.MediaLibrarySession)doesn't have to care about the suggestion for media items.