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

```
interface PlatformDataReceiver
```

<br />

*** ** * ** ***

Callback for receiving a PlatformDataProvider's new data.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/pipeline/PlatformDataReceiver#onData(androidx.wear.protolayout.expression.PlatformDataValues)(newData: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/PlatformDataValues)` Called by the registered `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/pipeline/PlatformDataProvider` to send new values. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/pipeline/PlatformDataReceiver#onInvalidated(java.util.Set<androidx.wear.protolayout.expression.PlatformDataKey<?>>)(keys: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/PlatformDataKey<*>!>)` Called by the registered `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/pipeline/PlatformDataProvider` to notify that the current data has been invalidated. |

## Public functions

### onData

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

```
fun onData(newData: PlatformDataValues): Unit
```

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

| Parameters |
|---|---|
| `newData: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/PlatformDataValues` | 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)

```
fun onInvalidated(keys: (Mutable)Set<PlatformDataKey<*>!>): Unit
```

Called by the registered `https://developer.android.com/reference/kotlin/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 |
|---|---|
| `keys: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/PlatformDataKey<*>!>` | The set of keys with current data been invalidated. |