# MediaLibraryService.LibraryParams.Builder

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.Builder)

*** ** * ** ***


```
class MediaLibraryService.LibraryParams.Builder
```

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams.Builder#Builder()()` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams!` | `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams.Builder#build()()` Builds `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html @https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams.Builder#setExtras(android.os.Bundle)(extras: https://developer.android.com/reference/android/os/Bundle.html!)` Set an extra `https://developer.android.com/reference/android/os/Bundle.html`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams.Builder#setOffline(boolean)(offline: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether the media items can be played without an internet connection. |
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams.Builder#setRecent(boolean)(recent: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether the media items are recently played. |
| `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams.Builder#setSuggested(boolean)(suggested: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether the media items are suggested. |

## Public constructors

### Builder

```
Builder()
```

## Public functions

### build

```
fun build(): MediaLibraryService.LibraryParams!
```

Builds `https://developer.android.com/reference/kotlin/androidx/media3/session/MediaLibraryService.LibraryParams`.

### setExtras

```
@CanIgnoreReturnValue
@UnstableApi
fun setExtras(extras: Bundle!): MediaLibraryService.LibraryParams.Builder!
```

Set an extra `https://developer.android.com/reference/android/os/Bundle.html`.

### setOffline

```
@CanIgnoreReturnValue
fun setOffline(offline: Boolean): MediaLibraryService.LibraryParams.Builder!
```

Sets whether the media items can be played without an internet connection.

### setRecent

```
@CanIgnoreReturnValue
fun setRecent(recent: Boolean): MediaLibraryService.LibraryParams.Builder!
```

Sets whether the media items are recently played.

### setSuggested

```
@CanIgnoreReturnValue
fun setSuggested(suggested: Boolean): MediaLibraryService.LibraryParams.Builder!
```

Sets whether the media items are suggested.