AmbientManager
public
class
AmbientManager
extends Object
| java.lang.Object | |
| ↳ | com.google.wear.services.ambient.AmbientManager |
Provides APIs via the Wear OS SDK for components to integrate with ambient mode support on Wear OS.
An instance of this class can be obtained directly via the Wear OS SDK by invoking the following API:
com.google.wear.Sdk.getWearManager(context, AmbientManager.class);
The first step in using AmbientManager to implement ambient mode support to call
AmbientManager.createController(Context,AmbientOptions) to register the manager,
ensuring that you receive the expected callbacks etc.
Registration requires your context as well as an AmbientOptions instance. Successful
registration will return an AmbientManager.Controller instance, which will serve as the
client's interface to the ambient system for as long as the component/manager exist or until
Controller.destroy() is called.
AmbientManager.Controller provides additional API to control the component's behavior
in ambient mode via AmbientManager.Controller.setAmbientSupportLevel(int). Note that the
controller enables ambient mode support by default at the time of registration.
Summary
Nested classes | |
|---|---|
interface |
AmbientManager.AmbientComponentListener
The callbacks that an ambient component must implement and provide to the |
interface |
AmbientManager.AmbientTransitionFinishedNotifier
Transition callback provided to the component in |
interface |
AmbientManager.AmbientTransitionListener
The callbacks that an ambient component must implement and provide to the |
interface |
AmbientManager.ConfigurationDetails
Details provided to |
class |
AmbientManager.Controller
A controller provided by the Wear OS |
interface |
AmbientManager.TransitionDetails
Details provided to |
Public methods | |
|---|---|
AmbientManager.Controller
|
createController(Context context, AmbientOptions options)
The main entry point for components to use when implementing support for ambient mode. |
Inherited methods | |
|---|---|
Public methods
createController
public AmbientManager.Controller createController (Context context, AmbientOptions options)
The main entry point for components to use when implementing support for ambient mode. Once
the component has obtained their instance of AmbientManager and initialized the
AmbientOptions required for registration they can call this method.
This method returns an instance of AmbientManager.Controller which is effectively
ready to support ambient mode. Note that ambient support is enabled by default - components
should call Controller.setAmbientSupportLevel(int) with to change the default
behaviour.
| Parameters | |
|---|---|
context |
Context: the Context associated with the ambient component. |
options |
AmbientOptions: the AmbientOptions created specifically for this ambient component on
the basis of type (e.g. app component vs watchface). |
| Returns | |
|---|---|
AmbientManager.Controller |
an instance of AmbientManager.Controller capable of controlling the
component's behavior while in ambient mode. |
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.