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

```
public interface ForegroundUpdater
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html 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/androidx/work/ForegroundUpdater#setForegroundAsync(android.content.Context,java.util.UUID,androidx.work.ForegroundInfo)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/UUID.html id, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ForegroundInfo foregroundInfo )` |

## Public methods

### setForegroundAsync

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

```
abstract @NonNull ListenableFuture<Void> setForegroundAsync(
    @NonNull Context context,
    @NonNull UUID id,
    @NonNull ForegroundInfo foregroundInfo
)
```

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | The application `https://developer.android.com/reference/android/content/Context.html`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/UUID.html id` | The `https://developer.android.com/reference/java/util/UUID.html` identifying the `https://developer.android.com/reference/androidx/work/ListenableWorker` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ForegroundInfo foregroundInfo` | The `https://developer.android.com/reference/androidx/work/ForegroundInfo` |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html 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/androidx/work/ListenableWorker` transitions to running in the context of a foreground `https://developer.android.com/reference/android/app/Service.html`. |