# TargetWatchFaceSafety

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/TargetWatchFaceSafety "View this page in Java")

<br />

```
@RequiresApi(value = 33)
object 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[ComplicationDataSourceService.METADATA_KEY_SAFE_WATCH_FACES](https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SAFE_WATCH_FACES())meta data in the[ComplicationDataSourceService](https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService)'s manifest.

## Summary

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

## Constants

### SAFE

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

```
const val SAFE = 1: Int
```

The watch face is a member of the list defined by the[ComplicationDataSourceService](https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService)'s[ComplicationDataSourceService.METADATA_KEY_SAFE_WATCH_FACES](https://developer.android.com/reference/kotlin/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)  

```
const val UNKNOWN = 0: Int
```

Prior to android T[ComplicationRequest.isForSafeWatchFace](https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/datasource/ComplicationRequest#isForSafeWatchFace())is not supported and it will always be UNKNOWN. It will also be unknown if the[ComplicationDataSourceService](https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService)'s manifest doesn't define[ComplicationDataSourceService.METADATA_KEY_SAFE_WATCH_FACES](https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SAFE_WATCH_FACES()), or if the[ComplicationDataSourceService](https://developer.android.com/reference/kotlin/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)  

```
const val UNSAFE = 2: Int
```

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