public interface PlatformDataProvider


This interface is used by platform data providers to yield dynamic data for their supported data keys.

It's up to the implementations to check if the expression provider has the required permission before sending data with onData. If a required permission is not granted or is revoked they should stop sending more data and call onInvalidated instead.

Summary

Public methods

abstract void

Clears the receiver from the provider.

abstract void
setReceiver(
    @NonNull Executor executor,
    @NonNull PlatformDataReceiver receiver
)

Sets the receiver for receiving the platform data from this provider.

Public methods

clearReceiver

Added in 1.0.0
abstract void clearReceiver()

Clears the receiver from the provider.

setReceiver

Added in 1.0.0
abstract void setReceiver(
    @NonNull Executor executor,
    @NonNull PlatformDataReceiver receiver
)

Sets the receiver for receiving the platform data from this provider.

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

The implementation should periodically send the dynamic data values for the set of s specified when registering this PlatformDataProvider in addPlatformDataProvider

Parameters
@NonNull PlatformDataReceiver receiver

The PlatformDataReceiver to receive the new dynamic values or to be notified that the current data has been invalidated for the registered keys.

@NonNull Executor executor

The executor to run the onData or onInvalidated on.