AmbientComponentState
public
class
AmbientComponentState
extends Object
| java.lang.Object | |
| ↳ | com.google.wear.services.ambient.AmbientComponentState |
This lends lifecycle-awareness to ambient components. Apps and watch faces that wish to implement
support for ambient mode can use the respective/provided state registries to communicate their
state to the AmbientManager for use in evaluating the appropriate display during ambient
mode.
Summary
Nested classes | |
|---|---|
class |
AmbientComponentState.ActivityStateRegistry
A state registry specifically intended for app components that subscribe to the standard Android lifecycle. |
class |
AmbientComponentState.WatchFaceStateRegistry
A state registry specifically intended for watch face components based on the wallpaper visibility. |
Public methods | |
|---|---|
static
AmbientComponentState.ActivityStateRegistry
|
makeActivityStateRegistry()
A convenience method to create an |
static
AmbientComponentState.WatchFaceStateRegistry
|
makeWatchFaceStateRegistry()
A convenience method to create an |
Inherited methods | |
|---|---|
Public methods
makeActivityStateRegistry
public static AmbientComponentState.ActivityStateRegistry makeActivityStateRegistry ()
A convenience method to create an ActivityStateRegistry for use with the AmbientManager. This registry is specifically designed to support to app components as it is
based on the standard Android Activity lifecycle.
| Returns | |
|---|---|
AmbientComponentState.ActivityStateRegistry |
an ActivityStateRegistry suitable for app components to use when registering
with AmbientManager. |
makeWatchFaceStateRegistry
public static AmbientComponentState.WatchFaceStateRegistry makeWatchFaceStateRegistry ()
A convenience method to create an WatchFaceStateRegistry for use with the AmbientManager. This registry is specifically intended to support watch face components as
it is based on wallpaper visibility as opposed to a specific application lifecycle.
| Returns | |
|---|---|
AmbientComponentState.WatchFaceStateRegistry |
an WatchFaceStateRegistry suitable for app components to use when registering
with AmbientManager. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-11 UTC.