# PlatformTimeUpdateNotifier

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformTimeUpdateNotifier "View this page in Java")

<br />

```
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 functions                              |
|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [clearReceiver](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/pipeline/PlatformTimeUpdateNotifier#clearReceiver())`()` Clears the receiver from the notifier.                                                                                                                                                                                                                                                                            |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [setReceiver](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/pipeline/PlatformTimeUpdateNotifier#setReceiver(java.util.concurrent.Executor,java.lang.Runnable))`(executor: `[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html)`, tick: `[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)`)` Sets the callback to be called whenever platform time needs to be reevaluated. |

## Public functions

### clearReceiver

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

```
fun clearReceiver(): Unit
```

Clears the receiver from the notifier.  

### setReceiver

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

```
fun setReceiver(executor: Executor, tick: Runnable): Unit
```

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                                             |
|----------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `executor: `[Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html) | The Executor to run the given`tick`on.                                                                                                                                                      |
| `tick: `[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)                | 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. |