Added in [version 33.1](https://developer.android.com/topic/libraries/support-library/revisions) Summary: [Nested Classes](https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager#nestedclasses) \| [Methods](https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager#inhmethods)

# AmbientManager


`
public


class
AmbientManager
`


`

extends Object


`

`


`

|---|---|
| java.lang.Object ||
| ↳ | com.google.wear.services.ambient.AmbientManager |

<br />

*** ** * ** ***

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
`https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager#createController(android.content.Context,%20com.google.wear.services.ambient.AmbientOptions)` to register the manager,
ensuring that you receive the expected callbacks etc.

Registration requires your context as well as an `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientOptions` instance. Successful
registration will return an `https://developer.android.com/reference/com/google/wear/services/ambient/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
`https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.Controller#destroy()` is called.

`https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.Controller` provides additional API to control the component's behavior
in ambient mode via `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.Controller#setAmbientSupportLevel(int)`. Note that the
controller enables ambient mode support by default at the time of registration.

## Summary

| ### Nested classes ||
|---|---|
| ` interface` | `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.AmbientComponentListener` The callbacks that an ambient component must implement and provide to the `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager` at the time of registration via `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientOptions` i.e. |
| ` interface` | `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.AmbientTransitionFinishedNotifier` Transition callback provided to the component in`https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.AmbientTransitionListener` allowing it to signal early completion of the ambient entry or exit transition. |
| ` interface` | `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.AmbientTransitionListener` The callbacks that an ambient component must implement and provide to the `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager` at the time of registration i.e. |
| ` interface` | `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.ConfigurationDetails` Details provided to `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.AmbientComponentListener#onEnterAmbient(com.google.wear.services.ambient.AmbientManager.ConfigurationDetails)`. |
| ` class` | `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.Controller` A controller provided by the Wear OS `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager` for use in controlling a component's behavior while in ambient mode. |
| ` interface` | `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.TransitionDetails` Details provided to `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.AmbientTransitionListener#onStartAmbientTransition(com.google.wear.services.ambient.AmbientManager.TransitionDetails,%20com.google.wear.services.ambient.AmbientManager.AmbientTransitionFinishedNotifier)`. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.Controller` | ` https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager#createController(android.content.Context,%20com.google.wear.services.ambient.AmbientOptions)(Context context, https://developer.android.com/reference/com/google/wear/services/ambient/AmbientOptions options) ` The main entry point for components to use when implementing support for ambient mode. |

| ### Inherited methods |
|---|---|
| From class ` java.lang.Object ` |---|---| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class<?>` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||

## Public methods

### createController

Added in [version 33.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
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 `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager` and initialized the
`https://developer.android.com/reference/com/google/wear/services/ambient/AmbientOptions` required for registration they can call this method.

This method returns an instance of `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.Controller` which is effectively
ready to support ambient mode. Note that ambient support is enabled by default - components
should call `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.Controller#setAmbientSupportLevel(int)` with to change the default
behaviour.

<br />

| Parameters ||
|---|---|
| `context` | `Context`: the `https://developer.android.com/reference/android/content/Context` associated with the ambient component. <br /> |
| `options` | `AmbientOptions`: the `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientOptions` created specifically for this ambient component on the basis of type (e.g. app component vs watchface). <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.Controller` | an instance of `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager.Controller` capable of controlling the component's behavior while in ambient mode. <br /> |