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 ObservableWatchData<@NonNull Integer>

The current user interruption settings.

final @NonNull ObservableWatchData<@NonNull Boolean>

Whether or not the watch is in ambient mode.

final boolean

Whether or not this is a headless watchface.

final @NonNull ObservableWatchData<@NonNull Boolean>

Whether or not the watch face is visible.

Public constructors

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

Public fields

analogPreviewReferenceTimeMillis

@NonNull
public final long analogPreviewReferenceTimeMillis

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

chinHeight

@NonNull
public final int chinHeight

the size, in pixels, of the chin or zero if the device does not have a chin. A chin is a section at the bottom of a circular display that is visible due to hardware limitations.

digitalPreviewReferenceTimeMillis

@NonNull
public final long digitalPreviewReferenceTimeMillis

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

hasBurnInProtection

@NonNull
public final boolean hasBurnInProtection

Whether or not the watch hardware supports burn in protection.

hasLowBitAmbient

@NonNull
public final boolean hasLowBitAmbient

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

interruptionFilter

@NonNull
public final @NonNull ObservableWatchData<@NonNull IntegerinterruptionFilter

The current user interruption settings. See NotificationManager. Based on the value the watch face should adjust the amount of information it displays. For example, if it displays the number of pending emails, it should hide it if interruptionFilter is equal to NotificationManager.INTERRUPTION_FILTER_NONE. interruptionFilter can be NotificationManager.INTERRUPTION_FILTER_NONE, NotificationManager.INTERRUPTION_FILTER_PRIORITY, NotificationManager.INTERRUPTION_FILTER_ALL, NotificationManager.INTERRUPTION_FILTER_ALARMS, or NotificationManager.INTERRUPTION_FILTER_UNKNOWN.

isAmbient

@NonNull
public final @NonNull ObservableWatchData<@NonNull BooleanisAmbient

Whether or not the watch is in ambient mode. The watch face should switch to a simplified low intensity display when in ambient mode. E.g. if the watch face displays seconds, it should hide them in ambient mode. NB the order in which ambient vs style changes are reported is not guaranteed.

isHeadless

@NonNull
public final boolean isHeadless

Whether or not this is a headless watchface.

isVisible

@NonNull
public final @NonNull ObservableWatchData<@NonNull BooleanisVisible

Whether or not the watch face is visible.

Public constructors

WatchState

public final WatchState(
    @NonNull ObservableWatchData<@NonNull Integer> interruptionFilter,
    @NonNull ObservableWatchData<@NonNull Boolean> isAmbient,
    @NonNull ObservableWatchData<@NonNull Boolean> isBatteryLowAndNotCharging,
    @NonNull ObservableWatchData<@NonNull Boolean> isVisible,
    boolean hasLowBitAmbient,
    boolean hasBurnInProtection,
    long analogPreviewReferenceTimeMillis,
    long digitalPreviewReferenceTimeMillis,
    @Px int chinHeight,
    boolean isHeadless
)
Parameters
@NonNull ObservableWatchData<@NonNull Integer> interruptionFilter

The current user interruption settings. See NotificationManager. Based on the value the watch face should adjust the amount of information it displays. For example, if it displays the number of pending emails, it should hide it if interruptionFilter is equal to NotificationManager.INTERRUPTION_FILTER_NONE. interruptionFilter can be NotificationManager.INTERRUPTION_FILTER_NONE, NotificationManager.INTERRUPTION_FILTER_PRIORITY, NotificationManager.INTERRUPTION_FILTER_ALL, NotificationManager.INTERRUPTION_FILTER_ALARMS, or NotificationManager.INTERRUPTION_FILTER_UNKNOWN.

@NonNull ObservableWatchData<@NonNull Boolean> isAmbient

Whether or not the watch is in ambient mode. The watch face should switch to a simplified low intensity display when in ambient mode. E.g. if the watch face displays seconds, it should hide them in ambient mode. NB the order in which ambient vs style changes are reported is not guaranteed.

@NonNull ObservableWatchData<@NonNull Boolean> isBatteryLowAndNotCharging

Whether or not we should conserve power due to a low battery which isn't charging. Only valid if android.support.wearable.watchface.WatchFaceStyle.hideNotificationIndicator is true.

@NonNull ObservableWatchData<@NonNull Boolean> isVisible

Whether or not the watch face is visible.

boolean hasLowBitAmbient

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

boolean hasBurnInProtection

Whether or not the watch hardware supports burn in protection.

long analogPreviewReferenceTimeMillis

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

long digitalPreviewReferenceTimeMillis

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

@Px int chinHeight

the size, in pixels, of the chin or zero if the device does not have a chin. A chin is a section at the bottom of a circular display that is visible due to hardware limitations.

boolean isHeadless

Whether or not this is a headless watchface.