[android-components](../../index.md) / [mozilla.components.service.fxa](../index.md) / [FxaDeviceConstellation](./index.md)

# FxaDeviceConstellation

`class FxaDeviceConstellation : `[`DeviceConstellation`](../../mozilla.components.concept.sync/-device-constellation/index.md)`, `[`Observable`](../../mozilla.components.support.base.observer/-observable/index.md)`<`[`DeviceEventsObserver`](../../mozilla.components.concept.sync/-device-events-observer/index.md)`>` [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/FxaDeviceConstellation.kt#L36)

Provides an implementation of [DeviceConstellation](../../mozilla.components.concept.sync/-device-constellation/index.md) backed by a [FirefoxAccount](#).

### Constructors

| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `FxaDeviceConstellation(account: FirefoxAccount, scope: CoroutineScope)`<br>Provides an implementation of [DeviceConstellation](../../mozilla.components.concept.sync/-device-constellation/index.md) backed by a [FirefoxAccount](#). |

### Functions

| Name | Summary |
|---|---|
| [destroyCurrentDeviceAsync](destroy-current-device-async.md) | `fun destroyCurrentDeviceAsync(): Deferred<`[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`>`<br>Destroy current device record. Use this when device record is no longer relevant, e.g. while logging out. On success, other devices will no longer see the current device in their device lists. |
| [ensureCapabilitiesAsync](ensure-capabilities-async.md) | `fun ensureCapabilitiesAsync(capabilities: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`DeviceCapability`](../../mozilla.components.concept.sync/-device-capability/index.md)`>): Deferred<`[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`>`<br>Ensure that all passed in [capabilities](../../mozilla.components.concept.sync/-device-constellation/ensure-capabilities-async.md#mozilla.components.concept.sync.DeviceConstellation$ensureCapabilitiesAsync(kotlin.collections.Set((mozilla.components.concept.sync.DeviceCapability)))/capabilities) are configured. This may involve backend service registration, or other work involving network/disc access. |
| [fetchAllDevicesAsync](fetch-all-devices-async.md) | `fun fetchAllDevicesAsync(): Deferred<`[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`Device`](../../mozilla.components.concept.sync/-device/index.md)`>?>`<br>Get all devices in the constellation. |
| [initDeviceAsync](init-device-async.md) | `fun initDeviceAsync(name: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, type: `[`DeviceType`](../../mozilla.components.concept.sync/-device-type/index.md)`, capabilities: `[`Set`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html)`<`[`DeviceCapability`](../../mozilla.components.concept.sync/-device-capability/index.md)`>): Deferred<`[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`>`<br>Register current device in the associated [DeviceConstellation](../../mozilla.components.concept.sync/-device-constellation/index.md). |
| [pollForEventsAsync](poll-for-events-async.md) | `fun pollForEventsAsync(): Deferred<`[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`DeviceEvent`](../../mozilla.components.concept.sync/-device-event/index.md)`>?>`<br>Poll for events targeted at the current [Device](../../mozilla.components.concept.sync/-device/index.md). It's expected that if a [DeviceEvent](../../mozilla.components.concept.sync/-device-event/index.md) was returned after a poll, it will not be returned in consequent polls. |
| [processRawEventAsync](process-raw-event-async.md) | `fun processRawEventAsync(payload: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): Deferred<`[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`>`<br>Process a raw event, obtained via a push message or some other out-of-band mechanism. |
| [refreshDeviceStateAsync](refresh-device-state-async.md) | `fun refreshDeviceStateAsync(): Deferred<`[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`>`<br>Refreshes [ConstellationState](../../mozilla.components.concept.sync/-constellation-state/index.md) and polls for device events. |
| [registerDeviceObserver](register-device-observer.md) | `fun registerDeviceObserver(observer: `[`DeviceConstellationObserver`](../../mozilla.components.concept.sync/-device-constellation-observer/index.md)`, owner: LifecycleOwner, autoPause: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Allows monitoring state of the device constellation via [DeviceConstellationObserver](../../mozilla.components.concept.sync/-device-constellation-observer/index.md). Use this to be notified of changes to the current device or other devices. |
| [sendEventToDeviceAsync](send-event-to-device-async.md) | `fun sendEventToDeviceAsync(targetDeviceId: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, outgoingEvent: `[`DeviceEventOutgoing`](../../mozilla.components.concept.sync/-device-event-outgoing/index.md)`): Deferred<`[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`>`<br>Send an event to a specified device. |
| [setDeviceNameAsync](set-device-name-async.md) | `fun setDeviceNameAsync(name: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): Deferred<`[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`>`<br>Set name of the current device. |
| [setDevicePushSubscriptionAsync](set-device-push-subscription-async.md) | `fun setDevicePushSubscriptionAsync(subscription: `[`DevicePushSubscription`](../../mozilla.components.concept.sync/-device-push-subscription/index.md)`): Deferred<`[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`>`<br>Set a [DevicePushSubscription](../../mozilla.components.concept.sync/-device-push-subscription/index.md) for the current device. |
| [startPeriodicRefresh](start-periodic-refresh.md) | `fun startPeriodicRefresh(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Begin periodically refreshing constellation state, including polling for events. |
| [state](state.md) | `fun state(): `[`ConstellationState`](../../mozilla.components.concept.sync/-constellation-state/index.md)`?`<br>Current state of the constellation. May be missing if state was never queried. |
| [stopPeriodicRefresh](stop-periodic-refresh.md) | `fun stopPeriodicRefresh(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Stop periodically refreshing constellation state and polling for events. |
