# ComplicationDataSourceService

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.ComplicationDataSourceService) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0)

*** ** * ** ***

<br />

```
public abstract class ComplicationDataSourceService extends Service
```

<br />

|---|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||||
| ↳ | [android.content.Context](https://developer.android.com/reference/android/content/Context.html) ||||
|   | ↳ | [android.content.ContextWrapper](https://developer.android.com/reference/android/content/ContextWrapper.html) |||
|   |   | ↳ | [android.app.Service](https://developer.android.com/reference/android/app/Service.html) ||
|   |   |   | ↳ | [androidx.wear.watchface.complications.datasource.ComplicationDataSourceService](https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService) |

Known direct subclasses [SuspendingComplicationDataSourceService](https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/SuspendingComplicationDataSourceService), [SuspendingTimelineComplicationDataSourceService](https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/SuspendingTimelineComplicationDataSourceService)

|---|---|
| `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/SuspendingComplicationDataSourceService` | Kotlin coroutine wrapper for `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService` producing `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData`. |
| `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/SuspendingTimelineComplicationDataSourceService` | Kotlin coroutine wrapper for `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService` producing `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataTimeline`. |

*** ** * ** ***

Class for sources of complication data.

A complication data source service must implement `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest,androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener)` to respond to requests for updates from the complication system.

Manifest requirements:

- The manifest declaration of this service must include an intent filter for `android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST`.

- A ComplicationDataSourceService must include a `meta-data` tag with `android.support.wearable.complications.SUPPORTED_TYPES` in its manifest entry.

The value of `android.support.wearable.complications.SUPPORTED_TYPES` should be a comma separated list of types supported by the data source, from this table:

|---|---|
| Androidx class | Tag name |
| `https://developer.android.com/reference/androidx/wear/watchface/complications/data/GoalProgressComplicationData` | GOAL_PROGRESS |
| `https://developer.android.com/reference/androidx/wear/watchface/complications/data/LongTextComplicationData` | LONG_TEXT |
| `https://developer.android.com/reference/androidx/wear/watchface/complications/data/MonochromaticImageComplicationData` | ICON |
| `https://developer.android.com/reference/androidx/wear/watchface/complications/data/PhotoImageComplicationData` | LARGE_IMAGE |
| `https://developer.android.com/reference/androidx/wear/watchface/complications/data/RangedValueComplicationData` | RANGED_TEXT |
| `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ShortTextComplicationData` | SHORT_TEXT |
| `https://developer.android.com/reference/androidx/wear/watchface/complications/data/SmallImageComplicationData` | SMALL_IMAGE |
| `https://developer.android.com/reference/androidx/wear/watchface/complications/data/WeightedElementsComplicationData` | WEIGHTED_ELEMENTS |

The order in which types are listed has no significance. In the case where a watch face supports multiple types in a single complication slot, the watch face will determine which types it prefers.

For example, a complication data source that supports the `RANGED_VALUE`, `SHORT_TEXT`, and `ICON` types would include the following in its manifest entry:

```
<meta-data
    android:name="android.support.wearable.complications.SUPPORTED_TYPES"
    android:value="RANGED_VALUE,SHORT_TEXT,ICON" />
```

From android T onwards, it is recommended for `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService`s to be direct boot aware because the system is able to fetch complications before the lock screen has been removed. To do this add `android:directBootAware="true"` to your service tag.

- A provider can choose to trust one or more watch faces by including the following in its manifest entry:

```
<meta-data
    android:name="android.support.wearable.complications.SAFE_WATCH_FACES"
    android:value="com.pkg1/com.trusted.wf1,com.pkg2/com.trusted.wf2" />
```

The listed watch faces will not need `com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATA` in order to receive complications from this provider. Also the provider may choose to serve different types to safe watch faces by including the following in its manifest:

```
<meta-data
    android:name="androidx.wear.watchface.complications.datasource.SAFE_WATCH_FACE_SUPPORTED_TYPES"
    android:value="ICON" />
```

In addition the provider can learn if a request is for a safe watchface by examining `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationRequest#isForSafeWatchFace()`. Note `SAFE_WATCH_FACE_SUPPORTED_TYPES` and `isForSafeWatchFace` are gated behind the privileged permission `com.google.wear.permission.GET_IS_FOR_SAFE_WATCH_FACE`.

- A ComplicationDataSourceService should include a `meta-data` tag with `android.support.wearable.complications.UPDATE_PERIOD_SECONDS` in its manifest entry. The value of this tag is the number of seconds the complication data source would like to elapse between update requests.

**Note that update requests are not guaranteed to be sent with this frequency.** For complications with frequent updates they can also register a separate `meta-data` tag with `androidx.wear.watchface.complications.data.source.IMMEDIATE_UPDATE_PERIOD_MILLISECONDS` in their manifest which supports sampling at up to 1Hz when the watch face is visible and non-ambient, however this also requires the application to have the privileged permission `com.google.android.wearable.permission.USE_IMMEDIATE_COMPLICATION_UPDATE`.

If a complication data source never needs to receive update requests beyond the one sent when a complication is activated, the value of this tag should be 0.

For example, a complication data source that would like to update at most every hour should include the following in its manifest entry:

```
<meta-data
    android:name="android.support.wearable.complications.UPDATE_PERIOD_SECONDS"
    android:value="3600" />
```

- A `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService` can include a `meta-data` tag with android.support.wearable.complications.PROVIDER_CONFIG_ACTION its manifest entry to cause a configuration activity to be shown when the complication data source is selected.

The configuration activity must reside in the same package as the complication data source, and must register an intent filter for the action specified here, including `android.support.wearable.complications.category.PROVIDER_CONFIG` as well as `https://developer.android.com/reference/android/content/Intent.html#CATEGORY_DEFAULT` as categories.

Note back up and restore of any configuration data is left to the complication data source, see `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_CONFIG_RESTORE_SUPPORTED()` for more details.

The complication id being configured will be included in the intent that starts the config activity using the extra key `android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_ID`.

The complication type that will be requested from the complication data source will also be included, using the extra key `android.support.wearable.complications.EXTRA_CONFIG_COMPLICATION_TYPE`.

The complication data source's `https://developer.android.com/reference/android/content/ComponentName.html` will also be included in the intent that starts the config activity, using the extra key `android.support.wearable.complications.EXTRA_CONFIG_PROVIDER_COMPONENT`.

The config activity must call `https://developer.android.com/reference/android/app/Activity.html#setResult(int)` with either `https://developer.android.com/reference/android/app/Activity.html#RESULT_OK` or `https://developer.android.com/reference/android/app/Activity.html#RESULT_CANCELED` before it is finished, to tell the system whether or not the complication data source should be set on the given complication.

It is possible to provide additional `meta-data` tag `androidx.watchface.complications.datasource.DEFAULT_CONFIG_SUPPORTED` in the service set to `"true"` to let the system know that the data source is able to provide complication data before it is configured.

- The manifest entry for the service should also include an android:icon attribute. The icon provided there should be a single-color white icon that represents the complication data source. This icon will be shown in the complication data source chooser interface, and may also be included in `https://developer.android.com/reference/android/support/wearable/complications/ComplicationProviderInfo.html` given to watch faces for display in their configuration activities.

- The manifest entry should also include `android:permission="com.google.android.wearable.permission.BIND_COMPLICATION_PROVIDER"` to ensure that only the system can bind to it.

Multiple complication data sources in the same APK are supported but in android R there's a soft limit of 100 data sources per APK. Above that the companion watchface editor won't support this complication data source app.

There's no need to call `setDataSource` for any the `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData` Builders because the system will append this value on your behalf.

## Summary

| ### Nested types |
|---|
| `public interface https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService.ComplicationRequestListener` Callback for `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest,androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener)` where only one of `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService.ComplicationRequestListener#onComplicationData(androidx.wear.watchface.complications.data.ComplicationData)` or `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService.ComplicationRequestListener#onComplicationDataTimeline(androidx.wear.watchface.complications.datasource.ComplicationDataTimeline)` should be called. |

| ### Constants |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#ACTION_COMPLICATION_UPDATE_REQUEST()` The intent action used to send update requests to the data source. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#CATEGORY_DATA_SOURCE_CONFIG()` Category for complication data source config activities. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#EXTRA_CONFIG_COMPLICATION_ID()` Extra used to supply the complication id to a complication data source configuration activity. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#EXTRA_CONFIG_COMPLICATION_TYPE()` Extra used to supply the complication type to a complication data source configuration activity. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#EXTRA_CONFIG_DATA_SOURCE_COMPONENT()` Extra used to supply the complication data source component to a complication data source configuration activity. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 34) https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_CONFIG_RESTORE_SUPPORTED()` Metadata key used to declare that the complication data source service supports backup and restore (B\&R) of complication configuration data. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_DATA_SOURCE_CONFIG_ACTION()` Metadata key used to declare an action for a configuration activity for a complication data source. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_DATA_SOURCE_DEFAULT_CONFIG_SUPPORTED()` Metadata key. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_IMMEDIATE_UPDATE_PERIOD_MILLISECONDS()` Metadata key used to request elevated frequency of `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest,androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener)`s when the watch face is visible and non-ambient. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SAFE_WATCH_FACES()` Metadata key used to declare a list of watch faces that may receive data from a complication data source before they are granted the RECEIVE_COMPLICATION_DATA permission. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SAFE_WATCH_FACE_SUPPORTED_TYPES()` Metadata key used to declare supported complication types for safe watch faces. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SUPPORTED_TYPES()` Metadata key used to declare supported complication types. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_UPDATE_PERIOD_SECONDS()` Metadata key used to declare the requested frequency of update requests. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#ComplicationDataSourceService()()` |

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#getPreviewData(androidx.wear.watchface.complications.data.ComplicationType)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationType type)` A request for representative preview data for the complication, for use in the editor UI. |
| `final https://developer.android.com/reference/android/os/IBinder.html` | `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onBind(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent)` |
| `void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onComplicationActivated(kotlin.Int,androidx.wear.watchface.complications.data.ComplicationType)( int complicationInstanceId, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationType type )` Called when a complication is activated. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onComplicationDeactivated(kotlin.Int)(int complicationInstanceId)` Called when a complication is deactivated. |
| `abstract void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest,androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationRequest request, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService.ComplicationRequestListener listener )` Called when a complication data update is requested for the given complication id. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onStartImmediateComplicationRequests(kotlin.Int)(int complicationInstanceId)` If a metadata key with `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_IMMEDIATE_UPDATE_PERIOD_MILLISECONDS()` is present in the manifest, and the provider has privileged permission `com.google.android.wearable.permission.USE_IMMEDIATE_COMPLICATION_UPDATE`, then `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onStartImmediateComplicationRequests(kotlin.Int)` will be called when the watch face is visible and non-ambient. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onStopImmediateComplicationRequests(kotlin.Int)(int complicationInstanceId)` If a metadata key with `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_IMMEDIATE_UPDATE_PERIOD_MILLISECONDS()` is present in the manifest, and the provider has privileged permission `com.google.android.wearable.permission.USE_IMMEDIATE_COMPLICATION_UPDATE`, then `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onStartImmediateComplicationRequests(kotlin.Int)` will be called when the watch face ceases to be visible and non-ambient. |

### Inherited methods

From [android.content.Context](https://developer.android.com/reference/android/content/Context.html) `boolean` `https://developer.android.com/reference/android/content/Context.html#bindIsolatedService(android.content.Intent, android.content.Context.BindServiceFlags, java.lang.String, java.util.concurrent.Executor, android.content.ServiceConnection)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html service,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.BindServiceFlags.html flags,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html instanceName,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html executor,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ServiceConnection.html conn

)` `final int` `https://developer.android.com/reference/android/content/Context.html#getColor(int)(int id)` `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/ColorStateList.html` `https://developer.android.com/reference/android/content/Context.html#getColorStateList(int)(int id)` `final https://developer.android.com/reference/android/graphics/drawable/Drawable.html` `https://developer.android.com/reference/android/content/Context.html#getDrawable(int)(int id)` `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#getString(int)(int resId)` `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#getString(int, java.lang.Object...)(int resId, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html... formatArgs)` `final @https://developer.android.com/reference/androidx/annotation/NonNull T` `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/android/content/Context.html#getSystemService(java.lang.Class&lt;T&gt;)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> serviceClass)` `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html` `https://developer.android.com/reference/android/content/Context.html#getText(int)(int resId)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.BindServiceFlags.html` `https://developer.android.com/reference/android/content/Context.html#getUpdateableFlags()()` `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/TypedArray.html` `https://developer.android.com/reference/android/content/Context.html#obtainStyledAttributes(int[])(@https://developer.android.com/reference/androidx/annotation/NonNull int[] attrs)` `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/TypedArray.html` `https://developer.android.com/reference/android/content/Context.html#obtainStyledAttributes(int, int[])(int resid, @https://developer.android.com/reference/androidx/annotation/NonNull int[] attrs)` `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/TypedArray.html` `https://developer.android.com/reference/android/content/Context.html#obtainStyledAttributes(android.util.AttributeSet, int[])(https://developer.android.com/reference/android/util/AttributeSet.html set, @https://developer.android.com/reference/androidx/annotation/NonNull int[] attrs)` `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/TypedArray.html` `https://developer.android.com/reference/android/content/Context.html#obtainStyledAttributes(android.util.AttributeSet, int[], int, int)(

https://developer.android.com/reference/android/util/AttributeSet.html set,

@https://developer.android.com/reference/androidx/annotation/NonNull int[] attrs,

int defStyleAttr,

int defStyleRes

)` `void` `https://developer.android.com/reference/android/content/Context.html#revokeSelfPermissionOnKill(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html permName)` `void` `https://developer.android.com/reference/android/content/Context.html#sendBroadcastWithMultiplePermissions(android.content.Intent, java.lang.String[])(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

@https://developer.android.com/reference/androidx/annotation/NonNull String[] receiverPermissions

)` From [android.content.ContextWrapper](https://developer.android.com/reference/android/content/ContextWrapper.html) `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#bindIsolatedService(android.content.Intent, int, java.lang.String, java.util.concurrent.Executor, android.content.ServiceConnection)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html service,

int flags,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html instanceName,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html executor,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ServiceConnection.html conn

)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#bindService(android.content.Intent, android.content.ServiceConnection, android.content.Context.BindServiceFlags)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html service,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ServiceConnection.html conn,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.BindServiceFlags.html flags

)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#bindService(android.content.Intent, android.content.ServiceConnection, int)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html service,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ServiceConnection.html conn,

int flags

)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#bindService(android.content.Intent, android.content.Context.BindServiceFlags, java.util.concurrent.Executor, android.content.ServiceConnection)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html service,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.BindServiceFlags.html flags,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html executor,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ServiceConnection.html conn

)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#bindService(android.content.Intent, int, java.util.concurrent.Executor, android.content.ServiceConnection)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html service,

int flags,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html executor,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ServiceConnection.html conn

)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#bindServiceAsUser(android.content.Intent, android.content.ServiceConnection, android.content.Context.BindServiceFlags, android.os.UserHandle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html service,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ServiceConnection.html conn,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.BindServiceFlags.html flags,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/UserHandle.html user

)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#bindServiceAsUser(android.content.Intent, android.content.ServiceConnection, int, android.os.UserHandle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html service,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ServiceConnection.html conn,

int flags,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/UserHandle.html user

)` `int` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingOrSelfPermission(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html permission)` `int` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingOrSelfUriPermission(android.net.Uri, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html uri, int modeFlags)` `@https://developer.android.com/reference/androidx/annotation/NonNull int[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingOrSelfUriPermissions(java.util.List&lt;android.net.Uri&gt;, int)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html> uris,

int modeFlags

)` `int` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingPermission(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html permission)` `int` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingUriPermission(android.net.Uri, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html uri, int modeFlags)` `@https://developer.android.com/reference/androidx/annotation/NonNull int[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkCallingUriPermissions(java.util.List&lt;android.net.Uri&gt;, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html> uris, int modeFlags)` `int` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkContentUriPermissionFull(android.net.Uri, int, int, int)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html uri,

int pid,

int uid,

int modeFlags

)` `int` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkPermission(java.lang.String, int, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html permission, int pid, int uid)` `int` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkSelfPermission(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html permission)` `int` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkUriPermission(android.net.Uri, int, int, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html uri, int pid, int uid, int modeFlags)` `int` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkUriPermission(android.net.Uri, java.lang.String, java.lang.String, int, int, int)(

https://developer.android.com/reference/android/net/Uri.html uri,

https://developer.android.com/reference/java/lang/String.html readPermission,

https://developer.android.com/reference/java/lang/String.html writePermission,

int pid,

int uid,

int modeFlags

)` `@https://developer.android.com/reference/androidx/annotation/NonNull int[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#checkUriPermissions(java.util.List&lt;android.net.Uri&gt;, int, int, int)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html> uris,

int pid,

int uid,

int modeFlags

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#clearWallpaper()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createAttributionContext(java.lang.String)(https://developer.android.com/reference/java/lang/String.html attributionTag)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createConfigurationContext(android.content.res.Configuration)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Configuration.html overrideConfiguration)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createContext(android.content.ContextParams)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ContextParams.html contextParams)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createContextForSplit(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html splitName)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createDeviceContext(int)(int deviceId)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createDeviceProtectedStorageContext()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createDisplayContext(android.view.Display)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/Display.html display)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createPackageContext(java.lang.String, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html packageName, int flags)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createWindowContext(int, android.os.Bundle)(int type, https://developer.android.com/reference/android/os/Bundle.html options)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createWindowContext(android.view.Display, int, android.os.Bundle)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/Display.html display, int type, https://developer.android.com/reference/android/os/Bundle.html options)` `@https://developer.android.com/reference/androidx/annotation/NonNull String[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#databaseList()()` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#deleteDatabase(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#deleteFile(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#deleteSharedPreferences(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforceCallingOrSelfPermission(java.lang.String, java.lang.String)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html permission,

https://developer.android.com/reference/java/lang/String.html message

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforceCallingOrSelfUriPermission(android.net.Uri, int, java.lang.String)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html uri,

int modeFlags,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html message

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforceCallingPermission(java.lang.String, java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html permission, https://developer.android.com/reference/java/lang/String.html message)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforceCallingUriPermission(android.net.Uri, int, java.lang.String)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html uri,

int modeFlags,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html message

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforcePermission(java.lang.String, int, int, java.lang.String)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html permission,

int pid,

int uid,

https://developer.android.com/reference/java/lang/String.html message

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforceUriPermission(android.net.Uri, int, int, int, java.lang.String)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html uri,

int pid,

int uid,

int modeFlags,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html message

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#enforceUriPermission(android.net.Uri, java.lang.String, java.lang.String, int, int, int, java.lang.String)(

https://developer.android.com/reference/android/net/Uri.html uri,

https://developer.android.com/reference/java/lang/String.html readPermission,

https://developer.android.com/reference/java/lang/String.html writePermission,

int pid,

int uid,

int modeFlags,

https://developer.android.com/reference/java/lang/String.html message

)` `@https://developer.android.com/reference/androidx/annotation/NonNull String[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#fileList()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getApplicationContext()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/pm/ApplicationInfo.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getApplicationInfo()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/AssetManager.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getAssets()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/AttributionSource.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getAttributionSource()()` `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getAttributionTag()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getBaseContext()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getCacheDir()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/ClassLoader.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getClassLoader()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getCodeCacheDir()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ContentResolver.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getContentResolver()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDataDir()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDatabasePath(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name)` `int` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDeviceId()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDir(java.lang.String, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name, int mode)` `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/view/Display.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDisplay()()` `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalCacheDir()()` `@https://developer.android.com/reference/androidx/annotation/NonNull File[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalCacheDirs()()` `https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalFilesDir(java.lang.String)(https://developer.android.com/reference/java/lang/String.html type)` `@https://developer.android.com/reference/androidx/annotation/NonNull File[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalFilesDirs(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html type)` `@https://developer.android.com/reference/androidx/annotation/NonNull File[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalMediaDirs()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getFileStreamPath(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getFilesDir()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getMainExecutor()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Looper.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getMainLooper()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getNoBackupFilesDir()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getObbDir()()` `@https://developer.android.com/reference/androidx/annotation/NonNull File[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#getObbDirs()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getOpPackageName()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getPackageCodePath()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/pm/PackageManager.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getPackageManager()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getPackageName()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getPackageResourcePath()()` `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/content/ContextParams.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getParams()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Resources.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getResources()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/SharedPreferences.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getSharedPreferences(java.lang.String, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name, int mode)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getSystemService(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name)` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getSystemServiceName(java.lang.Class&lt;?&gt;)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> serviceClass)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Resources.Theme.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getTheme()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/drawable/Drawable.html` `[getWallpaper](https://developer.android.com/reference/android/content/ContextWrapper.html#getWallpaper())()`

**This method is deprecated.** Deprecated in Java
`int` `[getWallpaperDesiredMinimumHeight](https://developer.android.com/reference/android/content/ContextWrapper.html#getWallpaperDesiredMinimumHeight())()`

**This method is deprecated.** Deprecated in Java
`int` `[getWallpaperDesiredMinimumWidth](https://developer.android.com/reference/android/content/ContextWrapper.html#getWallpaperDesiredMinimumWidth())()`

**This method is deprecated.** Deprecated in Java
`void` `https://developer.android.com/reference/android/content/ContextWrapper.html#grantUriPermission(java.lang.String, android.net.Uri, int)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html toPackage,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html uri,

int modeFlags

)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#isDeviceProtectedStorage()()` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#isRestricted()()` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#isUiContext()()` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#moveDatabaseFrom(android.content.Context, java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html sourceContext, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#moveSharedPreferencesFrom(android.content.Context, java.lang.String)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html sourceContext,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name

)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/FileInputStream.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#openFileInput(java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/FileOutputStream.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#openFileOutput(java.lang.String, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name, int mode)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase.CursorFactory)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name,

int mode,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory.html factory

)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#openOrCreateDatabase(java.lang.String, int, android.database.sqlite.SQLiteDatabase.CursorFactory, android.database.DatabaseErrorHandler)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name,

int mode,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory.html factory,

https://developer.android.com/reference/android/database/DatabaseErrorHandler.html errorHandler

)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/drawable/Drawable.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#peekWallpaper()()` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#rebindService(android.content.ServiceConnection, android.content.Context.BindServiceFlags)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ServiceConnection.html conn,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.BindServiceFlags.html flags

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#registerComponentCallbacks(android.content.ComponentCallbacks)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentCallbacks.html callback)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#registerDeviceIdChangeListener(java.util.concurrent.Executor, java.util.function.IntConsumer)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html executor,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/function/IntConsumer.html listener

)` `https://developer.android.com/reference/android/content/Intent.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)(

https://developer.android.com/reference/android/content/BroadcastReceiver.html receiver,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/IntentFilter.html filter

)` `https://developer.android.com/reference/android/content/Intent.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, int)(

https://developer.android.com/reference/android/content/BroadcastReceiver.html receiver,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/IntentFilter.html filter,

int flags

)` `https://developer.android.com/reference/android/content/Intent.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, java.lang.String, android.os.Handler)(

https://developer.android.com/reference/android/content/BroadcastReceiver.html receiver,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/IntentFilter.html filter,

https://developer.android.com/reference/java/lang/String.html broadcastPermission,

https://developer.android.com/reference/android/os/Handler.html scheduler

)` `https://developer.android.com/reference/android/content/Intent.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter, java.lang.String, android.os.Handler, int)(

https://developer.android.com/reference/android/content/BroadcastReceiver.html receiver,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/IntentFilter.html filter,

https://developer.android.com/reference/java/lang/String.html broadcastPermission,

https://developer.android.com/reference/android/os/Handler.html scheduler,

int flags

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#removeStickyBroadcast(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#removeStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/UserHandle.html user

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#revokeSelfPermissionsOnKill(java.util.Collection&lt;java.lang.String&gt;)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html> permissions

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#revokeUriPermission(android.net.Uri, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html uri, int modeFlags)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#revokeUriPermission(java.lang.String, android.net.Uri, int)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html targetPackage,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html uri,

int modeFlags

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendBroadcast(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendBroadcast(android.content.Intent, java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent, https://developer.android.com/reference/java/lang/String.html receiverPermission)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

https://developer.android.com/reference/java/lang/String.html receiverPermission,

https://developer.android.com/reference/android/os/Bundle.html options

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendBroadcastAsUser(android.content.Intent, android.os.UserHandle)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/UserHandle.html user)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/UserHandle.html user,

https://developer.android.com/reference/java/lang/String.html receiverPermission

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendOrderedBroadcast(android.content.Intent, java.lang.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent, https://developer.android.com/reference/java/lang/String.html receiverPermission)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

https://developer.android.com/reference/java/lang/String.html receiverPermission,

https://developer.android.com/reference/android/os/Bundle.html options

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

https://developer.android.com/reference/java/lang/String.html receiverPermission,

https://developer.android.com/reference/android/content/BroadcastReceiver.html resultReceiver,

https://developer.android.com/reference/android/os/Handler.html scheduler,

int initialCode,

https://developer.android.com/reference/java/lang/String.html initialData,

https://developer.android.com/reference/android/os/Bundle.html initialExtras

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

https://developer.android.com/reference/java/lang/String.html receiverPermission,

https://developer.android.com/reference/android/os/Bundle.html options,

https://developer.android.com/reference/android/content/BroadcastReceiver.html resultReceiver,

https://developer.android.com/reference/android/os/Handler.html scheduler,

int initialCode,

https://developer.android.com/reference/java/lang/String.html initialData,

https://developer.android.com/reference/android/os/Bundle.html initialExtras

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendOrderedBroadcast(android.content.Intent, java.lang.String, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

https://developer.android.com/reference/java/lang/String.html receiverPermission,

https://developer.android.com/reference/java/lang/String.html receiverAppOp,

https://developer.android.com/reference/android/content/BroadcastReceiver.html resultReceiver,

https://developer.android.com/reference/android/os/Handler.html scheduler,

int initialCode,

https://developer.android.com/reference/java/lang/String.html initialData,

https://developer.android.com/reference/android/os/Bundle.html initialExtras

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendOrderedBroadcast(android.content.Intent, int, java.lang.String, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, java.lang.String, android.os.Bundle, android.os.Bundle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

int initialCode,

https://developer.android.com/reference/java/lang/String.html receiverPermission,

https://developer.android.com/reference/java/lang/String.html receiverAppOp,

https://developer.android.com/reference/android/content/BroadcastReceiver.html resultReceiver,

https://developer.android.com/reference/android/os/Handler.html scheduler,

https://developer.android.com/reference/java/lang/String.html initialData,

https://developer.android.com/reference/android/os/Bundle.html initialExtras,

https://developer.android.com/reference/android/os/Bundle.html options

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendOrderedBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/UserHandle.html user,

https://developer.android.com/reference/java/lang/String.html receiverPermission,

https://developer.android.com/reference/android/content/BroadcastReceiver.html resultReceiver,

https://developer.android.com/reference/android/os/Handler.html scheduler,

int initialCode,

https://developer.android.com/reference/java/lang/String.html initialData,

https://developer.android.com/reference/android/os/Bundle.html initialExtras

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendStickyBroadcast(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendStickyBroadcast(android.content.Intent, android.os.Bundle)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent, https://developer.android.com/reference/android/os/Bundle.html options)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/UserHandle.html user)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendStickyOrderedBroadcast(android.content.Intent, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

https://developer.android.com/reference/android/content/BroadcastReceiver.html resultReceiver,

https://developer.android.com/reference/android/os/Handler.html scheduler,

int initialCode,

https://developer.android.com/reference/java/lang/String.html initialData,

https://developer.android.com/reference/android/os/Bundle.html initialExtras

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendStickyOrderedBroadcastAsUser(android.content.Intent, android.os.UserHandle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/UserHandle.html user,

https://developer.android.com/reference/android/content/BroadcastReceiver.html resultReceiver,

https://developer.android.com/reference/android/os/Handler.html scheduler,

int initialCode,

https://developer.android.com/reference/java/lang/String.html initialData,

https://developer.android.com/reference/android/os/Bundle.html initialExtras

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#setTheme(int)(int resid)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#setWallpaper(android.graphics.Bitmap)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Bitmap.html bitmap)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#setWallpaper(java.io.InputStream)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/InputStream.html data)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#startActivities(android.content.Intent[])(@https://developer.android.com/reference/androidx/annotation/NonNull Intent[] intents)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#startActivities(android.content.Intent[], android.os.Bundle)(@https://developer.android.com/reference/androidx/annotation/NonNull Intent[] intents, https://developer.android.com/reference/android/os/Bundle.html options)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#startActivity(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#startActivity(android.content.Intent, android.os.Bundle)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent, https://developer.android.com/reference/android/os/Bundle.html options)` `https://developer.android.com/reference/android/content/ComponentName.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#startForegroundService(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html service)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#startInstrumentation(android.content.ComponentName, java.lang.String, android.os.Bundle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentName.html className,

https://developer.android.com/reference/java/lang/String.html profileFile,

https://developer.android.com/reference/android/os/Bundle.html arguments

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/IntentSender.html intent,

https://developer.android.com/reference/android/content/Intent.html fillInIntent,

int flagsMask,

int flagsValues,

int extraFlags

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int, android.os.Bundle)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/IntentSender.html intent,

https://developer.android.com/reference/android/content/Intent.html fillInIntent,

int flagsMask,

int flagsValues,

int extraFlags,

https://developer.android.com/reference/android/os/Bundle.html options

)` `https://developer.android.com/reference/android/content/ComponentName.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#startService(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html service)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#stopService(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html name)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#unbindService(android.content.ServiceConnection)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ServiceConnection.html conn)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#unregisterComponentCallbacks(android.content.ComponentCallbacks)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ComponentCallbacks.html callback)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#unregisterDeviceIdChangeListener(java.util.function.IntConsumer)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/function/IntConsumer.html listener)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#unregisterReceiver(android.content.BroadcastReceiver)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/BroadcastReceiver.html receiver)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#updateServiceBindings(java.util.Collection&lt;android.content.Context.UpdateBindingParams&gt;)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.UpdateBindingParams.html> params

)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#updateServiceGroup(android.content.ServiceConnection, int, int)(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/ServiceConnection.html conn,

int group,

int importance

)` From [android.app.Service](https://developer.android.com/reference/android/app/Service.html) `void` `https://developer.android.com/reference/android/app/Service.html#attachBaseContext(android.content.Context)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html newBase)` `void` `https://developer.android.com/reference/android/app/Service.html#dump(java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[])(

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/FileDescriptor.html fd,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/PrintWriter.html writer,

@https://developer.android.com/reference/androidx/annotation/NonNull String[] args

)` `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Application.html` `https://developer.android.com/reference/android/app/Service.html#getApplication()()` `final int` `https://developer.android.com/reference/android/app/Service.html#getForegroundServiceType()()` `void` `https://developer.android.com/reference/android/app/Service.html#onConfigurationChanged(android.content.res.Configuration)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Configuration.html newConfig)` `void` `https://developer.android.com/reference/android/app/Service.html#onCreate()()` `void` `https://developer.android.com/reference/android/app/Service.html#onDestroy()()` `void` `https://developer.android.com/reference/android/app/Service.html#onLowMemory()()` `void` `https://developer.android.com/reference/android/app/Service.html#onRebind(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent)` `void` `https://developer.android.com/reference/android/app/Service.html#onStart(android.content.Intent, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent, int startId)` `int` `https://developer.android.com/reference/android/app/Service.html#onStartCommand(android.content.Intent, int, int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent, int flags, int startId)` `void` `https://developer.android.com/reference/android/app/Service.html#onTaskRemoved(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html rootIntent)` `void` `https://developer.android.com/reference/android/app/Service.html#onTimeout(int)(int startId)` `void` `https://developer.android.com/reference/android/app/Service.html#onTimeout(int, int)(int startId, int fgsType)` `void` `https://developer.android.com/reference/android/app/Service.html#onTrimMemory(int)(int level)` `boolean` `https://developer.android.com/reference/android/app/Service.html#onUnbind(android.content.Intent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html intent)` `final void` `https://developer.android.com/reference/android/app/Service.html#startForeground(int, android.app.Notification)(int id, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Notification.html notification)` `final void` `https://developer.android.com/reference/android/app/Service.html#startForeground(int, android.app.Notification, int)(

int id,

@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Notification.html notification,

int foregroundServiceType

)` `final void` `https://developer.android.com/reference/android/app/Service.html#stopForeground(int)(int notificationBehavior)` `final void` `https://developer.android.com/reference/android/app/Service.html#stopForeground(boolean)(boolean removeNotification)` `final void` `https://developer.android.com/reference/android/app/Service.html#stopSelf()()` `final void` `https://developer.android.com/reference/android/app/Service.html#stopSelf(int)(int startId)` `final boolean` `https://developer.android.com/reference/android/app/Service.html#stopSelfResult(int)(int startId)`

## Constants

### ACTION_COMPLICATION_UPDATE_REQUEST

```
public static final @NonNull String ACTION_COMPLICATION_UPDATE_REQUEST
```

The intent action used to send update requests to the data source. `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService` must declare an intent filter for this action in the manifest.

### CATEGORY_DATA_SOURCE_CONFIG

```
public static final @NonNull String CATEGORY_DATA_SOURCE_CONFIG
```

Category for complication data source config activities. The configuration activity for a complication complication data source must specify this category in its intent filter.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_DATA_SOURCE_CONFIG_ACTION()` |   |

### EXTRA_CONFIG_COMPLICATION_ID

```
public static final @NonNull String EXTRA_CONFIG_COMPLICATION_ID
```

Extra used to supply the complication id to a complication data source configuration activity.

### EXTRA_CONFIG_COMPLICATION_TYPE

```
public static final @NonNull String EXTRA_CONFIG_COMPLICATION_TYPE
```

Extra used to supply the complication type to a complication data source configuration activity.

### EXTRA_CONFIG_DATA_SOURCE_COMPONENT

```
public static final @NonNull String EXTRA_CONFIG_DATA_SOURCE_COMPONENT
```

Extra used to supply the complication data source component to a complication data source configuration activity.

### METADATA_KEY_CONFIG_RESTORE_SUPPORTED

```
@RequiresApi(value = 34)
public static final @NonNull String METADATA_KEY_CONFIG_RESTORE_SUPPORTED
```

Metadata key used to declare that the complication data source service supports backup and restore (B\&R) of complication configuration data. The system is responsible for backup and restore of the assignment of complications to watch faces, but responsibility for backup and restore for any complication data source configuration data is left to the data source.

If this flag is set to false, then the system will restore any complications using this provider in the "not configured" state, i.e. the complication will show a + sign with a tap action leading to the complication data source's configuration action as defined by `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_DATA_SOURCE_CONFIG_ACTION()`, instead of real data.

This is a boolean value, defaulting to true, which means apps are opted in by default but can explicitly opt out by setting this meta-data tag to false.

The value is ignored (equivalent to false) if the app does not enable Android B\&R ( https://developer.android.com/guide/topics/data/backup). This value is also ignored prior to Android U.

### METADATA_KEY_DATA_SOURCE_CONFIG_ACTION

```
public static final @NonNull String METADATA_KEY_DATA_SOURCE_CONFIG_ACTION
```

Metadata key used to declare an action for a configuration activity for a complication data source.

A `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService` can include a `meta-data` tag with this name in its manifest entry to cause a configuration activity to be shown when the complication data source is selected.

The configuration activity must reside in the same package as the complication data source, and must register an intent filter for the action specified here, including `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#CATEGORY_DATA_SOURCE_CONFIG()` as well as `https://developer.android.com/reference/android/content/Intent.html#CATEGORY_DEFAULT` as categories.

The complication id being configured will be included in the intent that starts the config activity using the extra key `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#EXTRA_CONFIG_COMPLICATION_ID()`.

The complication type that will be requested from the complication data source will also be included, using the extra key `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#EXTRA_CONFIG_COMPLICATION_TYPE()`.

The complication data source's `https://developer.android.com/reference/android/content/ComponentName.html` will also be included in the intent that starts the config activity, using the extra key `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#EXTRA_CONFIG_DATA_SOURCE_COMPONENT()`.

The config activity must call `https://developer.android.com/reference/android/app/Activity.html#setResult(int)` with either `https://developer.android.com/reference/android/app/Activity.html#RESULT_OK` or `https://developer.android.com/reference/android/app/Activity.html#RESULT_CANCELED` before it is finished, to tell the system whether or not the complication data source should be set on the given complication.

### METADATA_KEY_DATA_SOURCE_DEFAULT_CONFIG_SUPPORTED

```
public static final @NonNull String METADATA_KEY_DATA_SOURCE_DEFAULT_CONFIG_SUPPORTED
```

Metadata key. Setting to "true" indicates to the system that this complication data source with a PROVIDER_CONFIG_ACTION metadata tag is able to provide complication data before it is configured. See `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_DATA_SOURCE_CONFIG_ACTION()`.

### METADATA_KEY_IMMEDIATE_UPDATE_PERIOD_MILLISECONDS

```
public static final @NonNull String METADATA_KEY_IMMEDIATE_UPDATE_PERIOD_MILLISECONDS
```

Metadata key used to request elevated frequency of `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest,androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener)`s when the watch face is visible and non-ambient.

To do this `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService` should include a `meta-data` tag with this name in its manifest entry. The value of this tag is the number of milliseconds the complication data source would like to elapse between `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest,androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener)`s requests when the watch face is visible and non-ambient.

Note in addition to this meta-data, the data source must also request the privileged permission com.google.android.wearable.permission.USE_IMMEDIATE_COMPLICATION_UPDATE.

Note that update requests are not guaranteed to be sent with this frequency and a lower limit exists (initially 1 second).

### METADATA_KEY_SAFE_WATCH_FACES

```
public static final @NonNull String METADATA_KEY_SAFE_WATCH_FACES
```

Metadata key used to declare a list of watch faces that may receive data from a complication data source before they are granted the RECEIVE_COMPLICATION_DATA permission. This allows the listed watch faces to set the complication data source as a default and have the complication populate when the watch face is first seen.

Only trusted watch faces that will set this complication data source as a default should be included in this list.

Note that if a watch face is in the same app package as the complication data source, it does not need to be added to this list.

The value of this tag should be a comma separated list of watch faces or packages. An entry can be a flattened component, as if `https://developer.android.com/reference/android/content/ComponentName.html#flattenToString()` had been called, to declare a specific watch face as safe. An entry can also be a package name, as if `https://developer.android.com/reference/android/content/ComponentName.html#getPackageName()` had been called, in which case any watch face under the app with that package name will be considered safe for this complication data source.

From Android T, if this provider has the privileged permission `com.google.wear.permission.GET_IS_FOR_SAFE_WATCH_FACE`, then `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationRequest#isForSafeWatchFace()` will be populated.

### METADATA_KEY_SAFE_WATCH_FACE_SUPPORTED_TYPES

```
public static final @NonNull String METADATA_KEY_SAFE_WATCH_FACE_SUPPORTED_TYPES
```

Metadata key used to declare supported complication types for safe watch faces.

Gated behind the privileged permission \`com.google.wear.permission.GET_IS_FOR_SAFE_WATCH_FACE', this overrides the `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SUPPORTED_TYPES()` list for 'safe' watch faces. I.e. watch faces in the `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_SAFE_WATCH_FACES()` metadata list.

This means for example trusted watch faces could receive `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationType#SHORT_TEXT` and untrusted ones `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationType#MONOCHROMATIC_IMAGE`.

### METADATA_KEY_SUPPORTED_TYPES

```
public static final @NonNull String METADATA_KEY_SUPPORTED_TYPES
```

Metadata key used to declare supported complication types.

A `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService` must include a `meta-data` tag with this name in its manifest entry. The value of this tag should be a comma separated list of types supported by the complication data source. Types should be given as named as per the type fields in the `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData`, but omitting the "TYPE_" prefix, e.g. `SHORT_TEXT`, `LONG_TEXT`, `RANGED_VALUE`.

The order of types in `METADATA_KEY_SUPPORTED_TYPES` has no significance. During complication data source selection, each item in the complication slot's supported types is checked against entries in the data source's `METADATA_KEY_SUPPORTED_TYPES` and the first matching entry from the slot's support types (if any) is chosen. If there are no matches then this data source is not eligible to be selected in that slot.

For example, a complication data source that supports the RANGED_VALUE, SHORT_TEXT, and ICON type would include the following in its manifest entry:

```
<meta-data
    android:name="android.support.wearable.complications.SUPPORTED_TYPES"
    android:value="RANGED_VALUE,SHORT_TEXT,ICON" />
```

### METADATA_KEY_UPDATE_PERIOD_SECONDS

```
public static final @NonNull String METADATA_KEY_UPDATE_PERIOD_SECONDS
```

Metadata key used to declare the requested frequency of update requests.

A `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService` should include a `meta-data` tag with this name in its manifest entry. The value of this tag is the number of seconds the complication data source would like to elapse between update requests.

Note that update requests are not guaranteed to be sent with this frequency.

If a complication data source never needs to receive update requests beyond the one sent when a complication is activated, the value of this tag should be 0.

For example, a complication data source that would like to update every ten minutes should include the following in its manifest entry:

```
<meta-data
    android:name="android.support.wearable.complications.UPDATE_PERIOD_SECONDS"
    android:value="600" />
```

## Public constructors

### ComplicationDataSourceService

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

```
public ComplicationDataSourceService()
```

## Public methods

### getPreviewData

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

```
public abstract ComplicationData getPreviewData(@NonNull ComplicationType type)
```

A request for representative preview data for the complication, for use in the editor UI. Preview data is assumed to be static per type. E.g. for a complication that displays the date and time of an event, rather than returning the real time it should return a fixed date and time such as 10:10 Aug 1st. This data may be cached by the system and the result should be constant based on the current locale.

This will be called on a background thread.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationType type` | The type of complication preview data requested. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationData` | Preview data for the given complication type. |

### onBind

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

```
public final IBinder onBind(@NonNull Intent intent)
```

### onComplicationActivated

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

```
@MainThread
public void onComplicationActivated(
    int complicationInstanceId,
    @NonNull ComplicationType type
)
```

Called when a complication is activated.

This occurs when the watch face calls setActiveComplications, or when this data source is chosen for a complication which is already active.

This will usually be followed by a call to `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest,androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener)`.

This will be called on the main thread.

| Parameters |
|---|---|
| `int complicationInstanceId` | The system's ID for the complication. Note this ID is distinct from the complication slot used by the watch face itself. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationType type` | The `https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationType` of the activated slot. |

### onComplicationDeactivated

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

```
@MainThread
public void onComplicationDeactivated(int complicationInstanceId)
```

Called when a complication is deactivated.

This occurs when the current watch face changes, or when the watch face calls setActiveComplications and does not include the given complication (usually because the watch face has stopped displaying it).

This will be called on the main thread.

| Parameters |
|---|---|
| `int complicationInstanceId` | The system's ID for the complication. Note this ID is distinct from the complication slot used by the watch face itself. |

### onComplicationRequest

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

```
@MainThread
public abstract void onComplicationRequest(
    @NonNull ComplicationRequest request,
    @NonNull ComplicationDataSourceService.ComplicationRequestListener listener
)
```

Called when a complication data update is requested for the given complication id.

In response to this request the result callback should be called with the data to be displayed. If the request can not be fulfilled or no update is needed then null should be passed to the callback.

The callback doesn't have be called within onComplicationRequest but it should be called soon after. If this does not occur within around 20 seconds (exact timeout length subject to change), then the system will unbind from this service which may cause your eventual update to not be received. However if `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationRequest#immediateResponseRequired()` is `true` then provider should try to deliver the response in under 100 milliseconds, if `false` the deadline is 20 seconds. `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationRequest#immediateResponseRequired()` will only ever be `true` if `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_IMMEDIATE_UPDATE_PERIOD_MILLISECONDS()` is present in the manifest, and the provider has the privileged permission `com.google.android.wearable.permission.USE_IMMEDIATE_COMPLICATION_UPDATE`, and the complication is visible and non-ambient.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationRequest request` | The details about the complication that has been requested. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService.ComplicationRequestListener listener` | The callback to pass the result to the system. |

### onStartImmediateComplicationRequests

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

```
@MainThread
public void onStartImmediateComplicationRequests(int complicationInstanceId)
```

If a metadata key with `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_IMMEDIATE_UPDATE_PERIOD_MILLISECONDS()` is present in the manifest, and the provider has privileged permission `com.google.android.wearable.permission.USE_IMMEDIATE_COMPLICATION_UPDATE`, then `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onStartImmediateComplicationRequests(kotlin.Int)` will be called when the watch face is visible and non-ambient. A series of `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest,androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener)`s will follow where `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationRequest#immediateResponseRequired()` is `true`, ending with a call to `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onStopImmediateComplicationRequests(kotlin.Int)`.

| Parameters |
|---|---|
| `int complicationInstanceId` | The system's ID for the complication. Note this ID is distinct from the complication slot used by the watch face itself. |

### onStopImmediateComplicationRequests

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

```
@MainThread
public void onStopImmediateComplicationRequests(int complicationInstanceId)
```

If a metadata key with `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#METADATA_KEY_IMMEDIATE_UPDATE_PERIOD_MILLISECONDS()` is present in the manifest, and the provider has privileged permission `com.google.android.wearable.permission.USE_IMMEDIATE_COMPLICATION_UPDATE`, then `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onStartImmediateComplicationRequests(kotlin.Int)` will be called when the watch face ceases to be visible and non-ambient. No subsequent calls to `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationDataSourceService#onComplicationRequest(androidx.wear.watchface.complications.datasource.ComplicationRequest,androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.ComplicationRequestListener)` where `https://developer.android.com/reference/androidx/wear/watchface/complications/datasource/ComplicationRequest#immediateResponseRequired()` is `true` will be made unless the complication becomes visible and non-ambient again.

| Parameters |
|---|---|
| `int complicationInstanceId` | The system's ID for the complication. Note this ID is distinct from the complication slot used by the watch face itself. |