# TargetWatchFaceSafety

Artifact: [androidx.wear.watchface:watchface-complications-data-source](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/complications/datasource/ComplicationDataSourceService.kt+class:androidx.wear.watchface.complications.datasource.TargetWatchFaceSafety) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.2.0)

*** ** * ** ***


```
@RequiresApi(value = 33)
public static class TargetWatchFaceSafety
```

<br />

*** ** * ** ***

Defines constants that describe whether or not the watch face the complication is being requested for is deemed to be safe. I.e. if its in the list defined by the `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SAFE_WATCH_FACES()` meta data in the `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService`'s manifest.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TargetWatchFaceSafety#SAFE() = 1` The watch face is a member of the list defined by the `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService`'s `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SAFE_WATCH_FACES()` meta data in its manifest. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TargetWatchFaceSafety#UNKNOWN() = 0` Prior to android T `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationRequest#isForSafeWatchFace()` is not supported and it will always be UNKNOWN. |
| `static final int` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TargetWatchFaceSafety#UNSAFE() = 2` The watch face is NOT a member of the list defined by the `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService`'s `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SAFE_WATCH_FACES()` meta data in its manifest. |

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

## Constants

### SAFE

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

```
public static final int SAFE = 1
```

The watch face is a member of the list defined by the `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService`'s `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SAFE_WATCH_FACES()` meta data in its manifest.

### UNKNOWN

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

```
public static final int UNKNOWN = 0
```

Prior to android T `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationRequest#isForSafeWatchFace()` is not supported and it will always be UNKNOWN. It will also be unknown if the `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService`'s manifest doesn't define `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SAFE_WATCH_FACES()`, or if the `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService` does not have the privileged permission `com.google.wear.permission.GET_IS_FOR_SAFE_WATCH_FACE`.

### UNSAFE

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

```
public static final int UNSAFE = 2
```

The watch face is NOT a member of the list defined by the `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService`'s `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SAFE_WATCH_FACES()` meta data in its manifest.

## Public fields

### INSTANCE

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

```
public static @NonNull TargetWatchFaceSafety INSTANCE
```