WatchState

public final class WatchState


Describes the current state of the wearable including some hardware details such as whether or not it supports burn in prevention and low-bit ambient.

Summary

Public fields

final long

UTC reference time for previews of analog watch faces in milliseconds since the epoch.

final int

the size, in pixels, of the chin or zero if the device does not have a chin.

final long

UTC reference time for previews of digital watch faces in milliseconds since the epoch.

final boolean

Whether or not the watch hardware supports burn in protection.

final boolean

Whether or not the watch hardware supports low bit ambient support.

final @NonNull StateFlow<Integer>

The current user interruption settings.

final @NonNull StateFlow<Boolean>

Whether or not the watch is in ambient mode.

final @NonNull StateFlow<Boolean>

Whether or not we should conserve power due to a low battery which isn't charging.

final boolean

Whether or not this is a headless watchface.

final @NonNull StateFlow<Boolean>

Whether or not the watch face is visible.

final @NonNull StateFlow<String>

The system's watch face instance ID where available or null.

Public constructors

WatchState(
    StateFlow<Integer> interruptionFilter,
    StateFlow<Boolean> isAmbient,
    StateFlow<Boolean> isBatteryLowAndNotCharging,
    StateFlow<Boolean> isVisible,
    boolean hasLowBitAmbient,
    boolean hasBurnInProtection,
    long analogPreviewReferenceTimeMillis,
    long digitalPreviewReferenceTimeMillis,
    int chinHeight,
    boolean isHeadless
)
WatchState(
    StateFlow<Integer> interruptionFilter,
    StateFlow<Boolean> isAmbient,
    StateFlow<Boolean> isBatteryLowAndNotCharging,