# ForegroundUpdater

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/ForegroundUpdater.java+class:androidx.work.ForegroundUpdater) Added in [2.3.0](https://developer.android.com/jetpack/androidx/releases/work#2.3.0)

*** ** * ** ***

<br />

```
interface ForegroundUpdater
```

<br />

*** ** * ** ***

Manages updating `https://developer.android.com/reference/android/app/Notification.html`s when a `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker` transitions to running in the context of a foreground `https://developer.android.com/reference/android/app/Service.html`.

## Summary

| ### Public functions |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://developer.android.com/reference/java/lang/Void.html!>` | `https://developer.android.com/reference/kotlin/androidx/work/ForegroundUpdater#setForegroundAsync(android.content.Context,java.util.UUID,androidx.work.ForegroundInfo)( context: https://developer.android.com/reference/android/content/Context.html, id: https://developer.android.com/reference/java/util/UUID.html, foregroundInfo: https://developer.android.com/reference/kotlin/androidx/work/ForegroundInfo )` |

## Public functions

### setForegroundAsync

Added in [2.3.0](https://developer.android.com/jetpack/androidx/releases/work#2.3.0)

```
fun setForegroundAsync(
    context: Context,
    id: UUID,
    foregroundInfo: ForegroundInfo
): ListenableFuture<Void!>
```

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | The application `https://developer.android.com/reference/android/content/Context.html`. |
| `id: https://developer.android.com/reference/java/util/UUID.html` | The `https://developer.android.com/reference/java/util/UUID.html` identifying the `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker` |
| `foregroundInfo: https://developer.android.com/reference/kotlin/androidx/work/ForegroundInfo` | The `https://developer.android.com/reference/kotlin/androidx/work/ForegroundInfo` |

| Returns |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://developer.android.com/reference/java/lang/Void.html!>` | @return The `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` which resolves after the `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker` transitions to running in the context of a foreground `https://developer.android.com/reference/android/app/Service.html`. |