# 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)

*** ** * ** ***


```
public final class MediaLibraryService.LibraryParams.Builder
```

<br />

*** ** * ** ***

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

## Summary

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

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

## Public constructors

### Builder

```
public Builder()
```

## Public methods

### build

```
public MediaLibraryService.LibraryParams build()
```

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

### setExtras

```
@CanIgnoreReturnValue
@UnstableApi
public MediaLibraryService.LibraryParams.Builder setExtras(Bundle extras)
```

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

### setOffline

```
@CanIgnoreReturnValue
public MediaLibraryService.LibraryParams.Builder setOffline(boolean offline)
```

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

### setRecent

```
@CanIgnoreReturnValue
public MediaLibraryService.LibraryParams.Builder setRecent(boolean recent)
```

Sets whether the media items are recently played.

### setSuggested

```
@CanIgnoreReturnValue
public MediaLibraryService.LibraryParams.Builder setSuggested(boolean suggested)
```

Sets whether the media items are suggested.