# PlatformTimeUpdateNotifier

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/PlatformTimeUpdateNotifier.java+class:androidx.wear.protolayout.expression.pipeline.PlatformTimeUpdateNotifier) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***


```
public interface PlatformTimeUpdateNotifier
```

<br />

*** ** * ** ***

Interface used to notify all time based dynamic types that they should be updated with the new platform time (system time).

It's up to the implementations to chose at what frequency updates should be sent.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformTimeUpdateNotifier#clearReceiver()()` Clears the receiver from the notifier. |
| `abstract void` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformTimeUpdateNotifier#setReceiver(java.util.concurrent.Executor,java.lang.Runnable)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/Executor.html executor, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Runnable.html tick)` Sets the callback to be called whenever platform time needs to be reevaluated. |

## Public methods

### clearReceiver

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

```
abstract void clearReceiver()
```

Clears the receiver from the notifier.

### setReceiver

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

```
abstract void setReceiver(@NonNull Executor executor, @NonNull Runnable tick)
```

Sets the callback to be called whenever platform time needs to be reevaluated.

Calling this method while there is already a receiver set, should replace the previous receiver.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/Executor.html executor` | The Executor to run the given `tick` on. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Runnable.html tick` | The callback to run whenever platform time needs to be reevaluated. This callback should be invoked by the implementation of this interface whenever platform time needs to be reevaluated. |