# PlatformDataReceiver

Artifact: [androidx.wear.protolayout:protolayout-expression-pipeline](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/expression/pipeline/PlatformDataReceiver.java+class:androidx.wear.protolayout.expression.pipeline.PlatformDataReceiver) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***

<br />

```
public interface PlatformDataReceiver
```

<br />

*** ** * ** ***

Callback for receiving a PlatformDataProvider's new data.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformDataReceiver#onData(androidx.wear.protolayout.expression.PlatformDataValues)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/PlatformDataValues newData)` Called by the registered `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformDataProvider` to send new values. |
| `abstract void` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformDataReceiver#onInvalidated(java.util.Set<androidx.wear.protolayout.expression.PlatformDataKey<?>>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/androidx/wear/protolayout/expression/PlatformDataKey<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> keys)` Called by the registered `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformDataProvider` to notify that the current data has been invalidated. |

## Public methods

### onData

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
abstract void onData(@NonNull PlatformDataValues newData)
```

Called by the registered `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformDataProvider` to send new values.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/PlatformDataValues newData` | The new values for the registered keys. |

### onInvalidated

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
abstract void onInvalidated(@NonNull Set<PlatformDataKey<@NonNull ?>> keys)
```

Called by the registered `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformDataProvider` to notify that the current data has been invalidated. Typically, this invalidated status is transient and subsequent onData call can be followed to sent new values.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/androidx/wear/protolayout/expression/PlatformDataKey<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> keys` | The set of keys with current data been invalidated. |