# DisconnectReasons

Artifact: [androidx.wear.watchface:watchface-client](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/client/InteractiveWatchFaceClient.kt+class:androidx.wear.watchface.client.DisconnectReasons) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.2.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

*** ** * ** ***


```
public static class DisconnectReasons
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Disconnect reasons for `https://developer.android.com/reference/androidx/wear/watchface/client/InteractiveWatchFaceClient.ClientDisconnectListener#onClientDisconnected()`.

use Watch Face Format instead

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/wear/watchface/client/DisconnectReasons#ENGINE_DETACHED() = 2` **This field is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/watchface/client/DisconnectReasons#ENGINE_DIED() = 1` **This field is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

| ### Public fields |
|---|---|
| `static @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/client/DisconnectReasons` | `https://developer.android.com/reference/androidx/wear/watchface/client/DisconnectReasons#INSTANCE()` |

## Constants

### ENGINE_DETACHED

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.2.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
public static final int ENGINE_DETACHED = 2
```

> [!CAUTION]
> **This field is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Wallpaper service detached from the engine, which is now defunct. The watch face itself has no control over this. Usually in response a new `https://developer.android.com/reference/androidx/wear/watchface/client/InteractiveWatchFaceClient` should be created (see `https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceControlClient#getOrCreateInteractiveWatchFaceClient(kotlin.String,androidx.wear.watchface.client.DeviceConfig,androidx.wear.watchface.client.WatchUiState,androidx.wear.watchface.style.UserStyleData,kotlin.collections.Map)`).

### ENGINE_DIED

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.2.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
public static final int ENGINE_DIED = 1
```

> [!CAUTION]
> **This field is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

The underlying engine died, probably because the watch face was killed or crashed. Sometimes this is due to memory pressure and it's not the watch face's fault. Usually in response a new `https://developer.android.com/reference/androidx/wear/watchface/client/InteractiveWatchFaceClient` should be created (see `https://developer.android.com/reference/androidx/wear/watchface/client/WatchFaceControlClient#getOrCreateInteractiveWatchFaceClient(kotlin.String,androidx.wear.watchface.client.DeviceConfig,androidx.wear.watchface.client.WatchUiState,androidx.wear.watchface.style.UserStyleData,kotlin.collections.Map)`), however if this new client also disconnects due to `https://developer.android.com/reference/androidx/wear/watchface/client/DisconnectReasons#ENGINE_DIED()` within a few seconds the watchface is probably bad and it's recommended to switch to a safe system default watch face.

## Public fields

### INSTANCE

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.2.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
public static @NonNull DisconnectReasons INSTANCE
```