# CustomTabsService

Artifact: [androidx.browser:browser](https://developer.android.com/jetpack/androidx/releases/browser) [View Source](https://cs.android.com/search?q=file:androidx/browser/customtabs/CustomTabsService.java+class:androidx.browser.customtabs.CustomTabsService) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

*** ** * ** ***


```
public abstract class CustomTabsService 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.browser.customtabs.CustomTabsService](https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService) |

*** ** * ** ***

Abstract service class for implementing Custom Tabs related functionality. The service should be responding to the action ACTION_CUSTOM_TABS_CONNECTION. This class should be used by implementers that want to provide Custom Tabs functionality, not by clients that want to launch Custom Tabs.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/androidx/annotation/IntDef(value = ) public annotation https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService.Relation` |
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/androidx/annotation/IntDef(value = ) public annotation https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService.Result` |

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#ACTION_CUSTOM_TABS_CONNECTION() = "android.support.customtabs.action.CustomTabsService"` The Intent action that a CustomTabsService must respond to. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#CATEGORY_AUTH_TAB() = "androidx.browser.auth.category.AuthTab"` An Intent filter category to signify that the Custom Tabs provider supports Auth Tab. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#CATEGORY_COLOR_SCHEME_CUSTOMIZATION() = "androidx.browser.customtabs.category.ColorSchemeCustomization"` An Intent filter category to signify that the Custom Tabs provider supports selecting and customizing color schemes via `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setColorScheme(int)` and `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setColorSchemeParams(int,androidx.browser.customtabs.CustomTabColorSchemeParams)`. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#CATEGORY_EPHEMERAL_BROWSING() = "androidx.browser.customtabs.category.EphemeralBrowsing"` An Intent filter category to signify that the Custom Tabs provider supports ephemeral browsing feature which opens Custom Tab that does not share cookies or other data with the browser that handles the Custom Tab. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#CATEGORY_NAVBAR_COLOR_CUSTOMIZATION() = "androidx.browser.customtabs.category.NavBarColorCustomization"` An Intent filter category to signify that the Custom Tabs provider supports customizing the color of the navigation bar (`https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setNavigationBarColor(int)`). |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#CATEGORY_SET_NETWORK() = "androidx.browser.customtabs.category.SetNetwork"` An Intent filter category to signify that the Custom Tabs provider supports multi-network, bind a custom tab to a particular network via `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setNetwork(android.net.Network)`. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#CATEGORY_TRUSTED_WEB_ACTIVITY_IMMERSIVE_MODE() = "androidx.browser.trusted.category.ImmersiveMode"` An Intent filter category to signify that the Trusted Web Activity provider supports immersive mode. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#CATEGORY_WEB_SHARE_TARGET_V2() = "androidx.browser.trusted.category.WebShareTargetV2"` An Intent filter category to signify that the Trusted Web Activity provider supports sending shared data according to the Web Share Target v2 protocol defined in https://wicg.github.io/web-share-target/level-2/. |
| `static final int` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#FILE_PURPOSE_TRUSTED_WEB_ACTIVITY_SPLASH_IMAGE() = 1` A constant to be used with `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#receiveFile(android.net.Uri,int,android.os.Bundle)` indicating that the file is a splash image to be shown on top of a Trusted Web Activity while the web contents are loading. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#KEY_SUCCESS() = "androidx.browser.customtabs.SUCCESS"` The key to use to store a boolean in the returns bundle of `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#extraCommand(java.lang.String,android.os.Bundle)` method, to indicate the command is executed successfully. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#KEY_URL() = "android.support.customtabs.otherurls.URL"` For `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#mayLaunchUrl(androidx.browser.customtabs.CustomTabsSessionToken,android.net.Uri,android.os.Bundle,java.util.List<android.os.Bundle>)` calls that wants to specify more than one url, this key can be used with `https://developer.android.com/reference/android/os/Bundle.html#putParcelable(java.lang.String, android.os.Parcelable)` to insert a new url to each bundle inside list of bundles. |
| `static final int` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#RELATION_HANDLE_ALL_URLS() = 2` Used for `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#validateRelationship(int,android.net.Uri,android.os.Bundle)`. |
| `static final int` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#RELATION_USE_AS_ORIGIN() = 1` Used for `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#validateRelationship(int,android.net.Uri,android.os.Bundle)`. |
| `static final int` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#RESULT_FAILURE_DISALLOWED() = -1` Indicates that the postMessage request was not allowed due to a bad argument or requesting at a disallowed time like when in background. |
| `static final int` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#RESULT_FAILURE_MESSAGING_ERROR() = -3` Indicates that the postMessage request has failed due to an internal error on the browser message channel. |
| `static final int` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#RESULT_FAILURE_REMOTE_ERROR() = -2` Indicates that the postMessage request has failed due to a `https://developer.android.com/reference/android/os/RemoteException.html` . |
| `static final int` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#RESULT_SUCCESS() = 0` Indicates that the postMessage request was accepted. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#TRUSTED_WEB_ACTIVITY_CATEGORY() = "androidx.browser.trusted.category.TrustedWebActivities"` An Intent filter category to signify that the Custom Tabs provider supports Trusted Web Activities (see `https://developer.android.com/reference/androidx/browser/customtabs/TrustedWebUtils` for more details). |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#CustomTabsService()()` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/IBinder.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#onBind(android.content.Intent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Intent.html intent)` |

| ### Protected methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#cleanUpSession(androidx.browser.auth.AuthTabSessionToken)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken sessionToken)` Called when the client side `https://developer.android.com/reference/android/os/IBinder.html` for this `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken` is dead. |
| `boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#cleanUpSession(androidx.browser.customtabs.CustomTabsSessionToken)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken)` Called when the client side `https://developer.android.com/reference/android/os/IBinder.html` for this `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken` is dead. |
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#extraCommand(java.lang.String,android.os.Bundle)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html commandName, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html args)` Unsupported commands that may be provided by the implementation. |
| `boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#isEngagementSignalsApiAvailable(androidx.browser.customtabs.CustomTabsSessionToken,android.os.Bundle)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html extras )` Returns whether the Engagement Signals API is available. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#mayLaunchUrl(androidx.browser.customtabs.CustomTabsSessionToken,android.net.Uri,android.os.Bundle,java.util.List<android.os.Bundle>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html url, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html extras, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/os/Bundle.html> otherLikelyBundles )` Tells the browser of a likely future navigation to a URL. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#newSession(androidx.browser.customtabs.CustomTabsSessionToken)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken)` Creates a new session through an ICustomTabsService with the optional callback. |
| `abstract int` | `@https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService.Result https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#postMessage(androidx.browser.customtabs.CustomTabsSessionToken,java.lang.String,android.os.Bundle)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html message, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html extras )` Sends a postMessage request using the origin communicated via `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#requestPostMessageChannel(androidx.browser.customtabs.CustomTabsSessionToken,android.net.Uri)`. |
| `void` | `@https://developer.android.com/reference/androidx/browser/customtabs/ExperimentalPrefetch https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#prefetch(androidx.browser.customtabs.CustomTabsSessionToken,android.net.Uri,androidx.browser.customtabs.PrefetchOptions)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html url, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/PrefetchOptions options )` Request the browser to start navigational prefetch to the page that will be used for future navigations. |
| `void` | `@https://developer.android.com/reference/androidx/browser/customtabs/ExperimentalPrefetch https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#prefetch(androidx.browser.customtabs.CustomTabsSessionToken,java.util.List<android.net.Uri>,androidx.browser.customtabs.PrefetchOptions)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/net/Uri.html> urls, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/PrefetchOptions options )` Request the browser to start navigational prefetch to the page that will be used for future navigations. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#receiveFile(androidx.browser.customtabs.CustomTabsSessionToken,android.net.Uri,int,android.os.Bundle)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html uri, int purpose, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html extras )` Receive a file from client by given Uri, e.g. in order to display a large bitmap in a Custom Tab. |
| `boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#registerAuthTabSession(androidx.browser.auth.AuthTabSessionToken)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken sessionToken)` Creates a new Auth Tab session through an ICustomTabsService with the optional callback. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#requestPostMessageChannel(androidx.browser.customtabs.CustomTabsSessionToken,android.net.Uri)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html postMessageOrigin )` Sends a request to create a two way postMessage channel between the client and the browser linked with the given `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession`. |
| `boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#requestPostMessageChannel(androidx.browser.customtabs.CustomTabsSessionToken,android.net.Uri,android.net.Uri,android.os.Bundle)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html postMessageOrigin, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html postMessageTargetOrigin, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html extras )` Same as above method with specifying the target origin to establish communication with. |
| `boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#setEngagementSignalsCallback(androidx.browser.customtabs.CustomTabsSessionToken,androidx.browser.customtabs.EngagementSignalsCallback,android.os.Bundle)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/EngagementSignalsCallback callback, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html extras )` Sets an `https://developer.android.com/reference/androidx/browser/customtabs/EngagementSignalsCallback` to execute callbacks for events related to the user's engagement with the webpage within the tab. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#updateVisuals(androidx.browser.customtabs.CustomTabsSessionToken,android.os.Bundle)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html bundle )` Updates the visuals of custom tabs for the given session. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#validateRelationship(androidx.browser.customtabs.CustomTabsSessionToken,int,android.net.Uri,android.os.Bundle)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken, @https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService.Relation int relation, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html origin, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html extras )` Request to validate a relationship between the application and an origin. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#warmup(long)(long flags)` Warms up the browser process asynchronously. |

### Inherited Constants

From [android.content.ComponentCallbacks2](https://developer.android.com/reference/android/content/ComponentCallbacks2.html) `static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_BACKGROUND = 40` `static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_COMPLETE = 80`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_MODERATE = 60`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_CRITICAL = 15`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_LOW = 10`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_RUNNING_MODERATE = 5`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/ComponentCallbacks2.html#TRIM_MEMORY_UI_HIDDEN = 20` From [android.content.Context](https://developer.android.com/reference/android/content/Context.html) `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#ACCESSIBILITY_SERVICE = "accessibility"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#ACCOUNT_SERVICE = "account"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#ACTIVITY_SERVICE = "activity"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#ADVANCED_PROTECTION_SERVICE = "advanced_protection"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#ALARM_SERVICE = "alarm"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#APPWIDGET_SERVICE = "appwidget"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#APP_FUNCTION_SERVICE = "app_function"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#APP_OPS_SERVICE = "appops"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#APP_SEARCH_SERVICE = "app_search"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#AUDIO_SERVICE = "audio"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#AUTOFILL_SERVICE = "autofill"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#BATTERY_SERVICE = "batterymanager"` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_ABOVE_CLIENT = 8` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_ADJUST_WITH_ACTIVITY = 128` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_ALLOW_ACTIVITY_STARTS = 512` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_ALLOW_OOM_MANAGEMENT = 16` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_AUTO_CREATE = 1` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_DEBUG_UNBIND = 2` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_EXTERNAL_SERVICE = -2147483648` `static final long` `https://developer.android.com/reference/android/content/Context.html#BIND_EXTERNAL_SERVICE_LONG = 4611686018427387904` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_IMPORTANT = 64` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_INCLUDE_CAPABILITIES = 4096` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_NOT_FOREGROUND = 4` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_NOT_PERCEPTIBLE = 256` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_PACKAGE_ISOLATED_PROCESS = 16384` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_SHARED_ISOLATED_PROCESS = 8192` `static final int` `https://developer.android.com/reference/android/content/Context.html#BIND_WAIVE_PRIORITY = 32` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#BIOMETRIC_SERVICE = "biometric"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#BLOB_STORE_SERVICE = "blob_store"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#BLUETOOTH_SERVICE = "bluetooth"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#BUGREPORT_SERVICE = "bugreport"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#CAMERA_SERVICE = "camera"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#CAPTIONING_SERVICE = "captioning"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#CARRIER_CONFIG_SERVICE = "carrier_config"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#CHOOSER_SERVICE = "chooser"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#CLIPBOARD_SERVICE = "clipboard"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#COMPANION_DEVICE_SERVICE = "companiondevice"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#CONNECTIVITY_DIAGNOSTICS_SERVICE = "connectivity_diagnostics"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#CONNECTIVITY_SERVICE = "connectivity"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#CONSUMER_IR_SERVICE = "consumer_ir"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#CONTACT_KEYS_SERVICE = "contact_keys"` `static final int` `https://developer.android.com/reference/android/content/Context.html#CONTEXT_IGNORE_SECURITY = 2` `static final int` `https://developer.android.com/reference/android/content/Context.html#CONTEXT_INCLUDE_CODE = 1` `static final int` `https://developer.android.com/reference/android/content/Context.html#CONTEXT_RESTRICTED = 4` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#CREDENTIAL_SERVICE = "credential"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#CROSS_PROFILE_APPS_SERVICE = "crossprofileapps"` `static final int` `https://developer.android.com/reference/android/content/Context.html#DEVICE_ID_DEFAULT = 0` `static final int` `https://developer.android.com/reference/android/content/Context.html#DEVICE_ID_INVALID = -1` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#DEVICE_LOCK_SERVICE = "device_lock"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#DEVICE_POLICY_SERVICE = "device_policy"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#DISPLAY_HASH_SERVICE = "display_hash"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#DISPLAY_SERVICE = "display"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#DOMAIN_VERIFICATION_SERVICE = "domain_verification"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#DOWNLOAD_SERVICE = "download"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#DROPBOX_SERVICE = "dropbox"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#EUICC_SERVICE = "euicc"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#FILE_INTEGRITY_SERVICE = "file_integrity"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#FILE_SERVICE = "file"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#GAME_SERVICE = "game"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#GRAMMATICAL_INFLECTION_SERVICE = "grammatical_inflection"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#HARDWARE_PROPERTIES_SERVICE = "hardware_properties"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#HEALTHCONNECT_SERVICE = "healthconnect"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#INPUT_METHOD_SERVICE = "input_method"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#INPUT_SERVICE = "input"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#IPSEC_SERVICE = "ipsec"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#JOB_SCHEDULER_SERVICE = "jobscheduler"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#KEYGUARD_SERVICE = "keyguard"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#KEYSTORE_SERVICE = "keystore"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#LAUNCHER_APPS_SERVICE = "launcherapps"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#LAYOUT_INFLATER_SERVICE = "layout_inflater"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#LOCALE_SERVICE = "locale"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#LOCATION_SERVICE = "location"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#MEDIA_COMMUNICATION_SERVICE = "media_communication"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#MEDIA_METRICS_SERVICE = "media_metrics"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#MEDIA_PROJECTION_SERVICE = "media_projection"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#MEDIA_QUALITY_SERVICE = "media_quality"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#MEDIA_ROUTER_SERVICE = "media_router"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#MEDIA_SESSION_SERVICE = "media_session"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#MIDI_SERVICE = "midi"` `static final int` `https://developer.android.com/reference/android/content/Context.html#MODE_APPEND = 32768` `static final int` `https://developer.android.com/reference/android/content/Context.html#MODE_ENABLE_WRITE_AHEAD_LOGGING = 8` `static final int` `https://developer.android.com/reference/android/content/Context.html#MODE_MULTI_PROCESS = 4`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/Context.html#MODE_NO_LOCALIZED_COLLATORS = 16` `static final int` `https://developer.android.com/reference/android/content/Context.html#MODE_PRIVATE = 0` `static final int` `https://developer.android.com/reference/android/content/Context.html#MODE_WORLD_READABLE = 1`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/content/Context.html#MODE_WORLD_WRITEABLE = 2`

**This field is deprecated.**
`static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#NETWORK_STATS_SERVICE = "netstats"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#NFC_SERVICE = "nfc"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#NOTIFICATION_SERVICE = "notification"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#NPU_SERVICE = "npu"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#NSD_SERVICE = "servicediscovery"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#OVERLAY_SERVICE = "overlay"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#PCC_SANDBOX_SERVICE = "pcc_sandbox"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#PEOPLE_SERVICE = "people"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#PERFORMANCE_HINT_SERVICE = "performance_hint"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#PERSISTENT_DATA_BLOCK_SERVICE = "persistent_data_block"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#POWER_SERVICE = "power"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#PRINT_SERVICE = "print"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#PROFILING_SERVICE = "profiling"` `static final int` `https://developer.android.com/reference/android/content/Context.html#RECEIVER_EXPORTED = 2` `static final int` `https://developer.android.com/reference/android/content/Context.html#RECEIVER_NOT_EXPORTED = 4` `static final int` `https://developer.android.com/reference/android/content/Context.html#RECEIVER_VISIBLE_TO_INSTANT_APPS = 1` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#RESTRICTIONS_SERVICE = "restrictions"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#ROLE_SERVICE = "role"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#SATELLITE_SERVICE = "satellite"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#SEARCH_SERVICE = "search"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#SECURITY_STATE_SERVICE = "security_state"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#SENSOR_SERVICE = "sensor"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#SERIAL_SERVICE = "serial"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#SHORTCUT_SERVICE = "shortcut"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#STATUS_BAR_SERVICE = "statusbar"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#STORAGE_SERVICE = "storage"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#STORAGE_STATS_SERVICE = "storagestats"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#SYSTEM_HEALTH_SERVICE = "systemhealth"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#TELECOM_SERVICE = "telecom"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#TELEPHONY_IMS_SERVICE = "telephony_ims"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#TELEPHONY_PHONE_NUMBER_SERVICE = "telephony_phone_number"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#TELEPHONY_SERVICE = "phone"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#TELEPHONY_SUBSCRIPTION_SERVICE = "telephony_subscription_service"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#TETHERING_SERVICE = "tethering"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#TEXT_CLASSIFICATION_SERVICE = "textclassification"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#TEXT_SERVICES_MANAGER_SERVICE = "textservices"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#TV_AD_SERVICE = "tv_ad"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#TV_INPUT_SERVICE = "tv_input"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#TV_INTERACTIVE_APP_SERVICE = "tv_interactive_app"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#UI_MODE_SERVICE = "uimode"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#USAGE_STATS_SERVICE = "usagestats"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#USB_SERVICE = "usb"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#USER_SERVICE = "user"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#VIBRATOR_MANAGER_SERVICE = "vibrator_manager"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#VIBRATOR_SERVICE = "vibrator"`

**This field is deprecated.**
`static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#VIRTUAL_DEVICE_SERVICE = "virtualdevice"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#VPN_MANAGEMENT_SERVICE = "vpn_management"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#WALLPAPER_SERVICE = "wallpaper"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#WEB_APP_SERVICE = "web_app"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#WIFI_AWARE_SERVICE = "wifiaware"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#WIFI_P2P_SERVICE = "wifip2p"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#WIFI_RTT_RANGING_SERVICE = "wifirtt"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#WIFI_SERVICE = "wifi"` `static final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#WINDOW_SERVICE = "window"` From [android.app.Service](https://developer.android.com/reference/android/app/Service.html) `static final int` `https://developer.android.com/reference/android/app/Service.html#START_CONTINUATION_MASK = 15` `static final int` `https://developer.android.com/reference/android/app/Service.html#START_FLAG_REDELIVERY = 1` `static final int` `https://developer.android.com/reference/android/app/Service.html#START_FLAG_RETRY = 2` `static final int` `https://developer.android.com/reference/android/app/Service.html#START_NOT_STICKY = 2` `static final int` `https://developer.android.com/reference/android/app/Service.html#START_REDELIVER_INTENT = 3` `static final int` `https://developer.android.com/reference/android/app/Service.html#START_STICKY = 1` `static final int` `https://developer.android.com/reference/android/app/Service.html#START_STICKY_COMPATIBILITY = 0` `static final int` `https://developer.android.com/reference/android/app/Service.html#STOP_FOREGROUND_DETACH = 2` `static final int` `https://developer.android.com/reference/android/app/Service.html#STOP_FOREGROUND_LEGACY = 0`

**This field is deprecated.**
`static final int` `https://developer.android.com/reference/android/app/Service.html#STOP_FOREGROUND_REMOVE = 1`

### Inherited methods

From [android.content.Context](https://developer.android.com/reference/android/content/Context.html) `final int` `https://developer.android.com/reference/android/content/Context.html#getColor(int)(int id)` `final 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/java/lang/String.html` `https://developer.android.com/reference/android/content/Context.html#getString(int)(int resId)` `final T` `<T> https://developer.android.com/reference/android/content/Context.html#getSystemService(java.lang.Class&lt;T&gt;)(https://developer.android.com/reference/java/lang/Class.html<T> serviceClass)` `final 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/android/content/Context.BindServiceFlags.html` `https://developer.android.com/reference/android/content/Context.html#getUpdateableFlags()()` `final 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, int[] attrs)` `void` `https://developer.android.com/reference/android/content/Context.html#revokeSelfPermissionOnKill(java.lang.String)(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/android/content/Intent.html intent,
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/android/content/Intent.html service,
int flags,
https://developer.android.com/reference/java/lang/String.html instanceName,
https://developer.android.com/reference/java/util/concurrent/Executor.html executor,
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.Context.BindServiceFlags, java.util.concurrent.Executor, android.content.ServiceConnection)(
https://developer.android.com/reference/android/content/Intent.html service,
https://developer.android.com/reference/android/content/Context.BindServiceFlags.html flags,
https://developer.android.com/reference/java/util/concurrent/Executor.html executor,
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/android/content/Intent.html service,
https://developer.android.com/reference/android/content/ServiceConnection.html conn,
https://developer.android.com/reference/android/content/Context.BindServiceFlags.html flags,
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/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/android/net/Uri.html uri, int modeFlags)` `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/java/util/List.html<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/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/android/net/Uri.html uri, int modeFlags)` `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/java/util/List.html<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/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/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/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/android/net/Uri.html uri, int pid, int uid, int modeFlags)` `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/java/util/List.html<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()()`

**This method is deprecated.**
`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/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createConfigurationContext(android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/Configuration.html overrideConfiguration)` `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/android/content/ContextParams.html contextParams)` `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/java/lang/String.html splitName)` `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/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#createDeviceProtectedStorageContext()()` `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/android/view/Display.html display)` `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/java/lang/String.html packageName, int flags)` `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/android/view/Display.html display, int type, https://developer.android.com/reference/android/os/Bundle.html options)` `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/java/lang/String.html name)` `boolean` `https://developer.android.com/reference/android/content/ContextWrapper.html#deleteFile(java.lang.String)(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/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/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/android/net/Uri.html uri,
int modeFlags,
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/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/android/net/Uri.html uri, int modeFlags, 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/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/android/net/Uri.html uri,
int pid,
int uid,
int modeFlags,
https://developer.android.com/reference/java/lang/String.html message
)` `String[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#fileList()()` `https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getApplicationContext()()` `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/android/content/res/AssetManager.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getAssets()()` `https://developer.android.com/reference/android/content/AttributionSource.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getAttributionSource()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getAttributionTag()()` `https://developer.android.com/reference/android/content/Context.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getBaseContext()()` `https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getCacheDir()()` `https://developer.android.com/reference/java/lang/ClassLoader.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getClassLoader()()` `https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getCodeCacheDir()()` `https://developer.android.com/reference/android/content/ContentResolver.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getContentResolver()()` `https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDataDir()()` `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/java/lang/String.html name)` `int` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDeviceId()()` `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/java/lang/String.html name, int mode)` `https://developer.android.com/reference/android/view/Display.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getDisplay()()` `https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalCacheDir()()` `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)` `File[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalFilesDirs(java.lang.String)(https://developer.android.com/reference/java/lang/String.html type)` `File[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#getExternalMediaDirs()()`

**This method is deprecated.**
`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/java/lang/String.html name)` `https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getFilesDir()()` `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/android/os/Looper.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getMainLooper()()` `https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getNoBackupFilesDir()()` `https://developer.android.com/reference/java/io/File.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getObbDir()()` `File[]` `https://developer.android.com/reference/android/content/ContextWrapper.html#getObbDirs()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getOpPackageName()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getPackageCodePath()()` `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/java/lang/String.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getPackageName()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getPackageResourcePath()()` `https://developer.android.com/reference/android/content/ContextParams.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getParams()()` `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/android/content/SharedPreferences.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getSharedPreferences(java.lang.String, int)(https://developer.android.com/reference/java/lang/String.html name, int mode)` `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/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/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> serviceClass)` `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/android/graphics/drawable/Drawable.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#getWallpaper()()`

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

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

**This method is deprecated.**
`void` `https://developer.android.com/reference/android/content/ContextWrapper.html#grantUriPermission(java.lang.String, android.net.Uri, int)(https://developer.android.com/reference/java/lang/String.html toPackage, 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/android/content/Context.html sourceContext, 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/android/content/Context.html sourceContext, https://developer.android.com/reference/java/lang/String.html name)` `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/java/lang/String.html name)` `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/java/lang/String.html name, int mode)` `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/java/lang/String.html name,
int mode,
https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory.html factory
)` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#peekWallpaper()()`

**This method is deprecated.**
`void` `https://developer.android.com/reference/android/content/ContextWrapper.html#rebindService(android.content.ServiceConnection, android.content.Context.BindServiceFlags)(https://developer.android.com/reference/android/content/ServiceConnection.html conn, 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/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/java/util/concurrent/Executor.html executor, 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/android/content/IntentFilter.html filter)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#removeStickyBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent.html intent)`

**This method is deprecated.**
`void` `https://developer.android.com/reference/android/content/ContextWrapper.html#removeStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent.html intent, https://developer.android.com/reference/android/os/UserHandle.html user)`

**This method is deprecated.**
`void` `https://developer.android.com/reference/android/content/ContextWrapper.html#revokeSelfPermissionsOnKill(java.util.Collection&lt;java.lang.String&gt;)(https://developer.android.com/reference/java/util/Collection.html<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/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/android/content/Intent.html intent)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendBroadcastAsUser(android.content.Intent, android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent.html intent, https://developer.android.com/reference/android/os/UserHandle.html user)` `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/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/android/content/Intent.html intent,
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/android/content/Intent.html intent)`

**This method is deprecated.**
`void` `https://developer.android.com/reference/android/content/ContextWrapper.html#sendStickyBroadcastAsUser(android.content.Intent, android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent.html intent, https://developer.android.com/reference/android/os/UserHandle.html user)`

**This method is deprecated.**
`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/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
)`

**This method is deprecated.**
`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/android/content/Intent.html intent,
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
)`

**This method is deprecated.**
`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/android/graphics/Bitmap.html bitmap)`

**This method is deprecated.**
`void` `https://developer.android.com/reference/android/content/ContextWrapper.html#startActivities(android.content.Intent[])(Intent[] intents)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#startActivity(android.content.Intent)(https://developer.android.com/reference/android/content/Intent.html intent)` `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/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/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/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/content/ComponentName.html` `https://developer.android.com/reference/android/content/ContextWrapper.html#startService(android.content.Intent)(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/android/content/Intent.html name)` `void` `https://developer.android.com/reference/android/content/ContextWrapper.html#unbindService(android.content.ServiceConnection)(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/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/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/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/java/util/Collection.html<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/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/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/java/io/FileDescriptor.html fd, https://developer.android.com/reference/java/io/PrintWriter.html writer, String[] args)` `final 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/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()()`

**This method is deprecated.**
`void` `https://developer.android.com/reference/android/app/Service.html#onRebind(android.content.Intent)(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/android/content/Intent.html intent, int startId)`

**This method is deprecated.**
`int` `https://developer.android.com/reference/android/app/Service.html#onStartCommand(android.content.Intent, int, int)(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/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#onTrimMemory(int)(int level)` `boolean` `https://developer.android.com/reference/android/app/Service.html#onUnbind(android.content.Intent)(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/android/app/Notification.html notification)` `final void` `https://developer.android.com/reference/android/app/Service.html#stopForeground(boolean)(boolean removeNotification)`

**This method is deprecated.**
`final void` `https://developer.android.com/reference/android/app/Service.html#stopSelf()()` `final boolean` `https://developer.android.com/reference/android/app/Service.html#stopSelfResult(int)(int startId)`

## Constants

### ACTION_CUSTOM_TABS_CONNECTION

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

```
public static final String ACTION_CUSTOM_TABS_CONNECTION = "android.support.customtabs.action.CustomTabsService"
```

The Intent action that a CustomTabsService must respond to.

### CATEGORY_AUTH_TAB

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/browser#1.9.0)

```
public static final String CATEGORY_AUTH_TAB = "androidx.browser.auth.category.AuthTab"
```

An Intent filter category to signify that the Custom Tabs provider supports Auth Tab.

### CATEGORY_COLOR_SCHEME_CUSTOMIZATION

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

```
public static final String CATEGORY_COLOR_SCHEME_CUSTOMIZATION = "androidx.browser.customtabs.category.ColorSchemeCustomization"
```

An Intent filter category to signify that the Custom Tabs provider supports selecting and customizing color schemes via `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setColorScheme(int)` and `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setColorSchemeParams(int,androidx.browser.customtabs.CustomTabColorSchemeParams)`.

### CATEGORY_EPHEMERAL_BROWSING

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/browser#1.9.0)

```
public static final String CATEGORY_EPHEMERAL_BROWSING = "androidx.browser.customtabs.category.EphemeralBrowsing"
```

An Intent filter category to signify that the Custom Tabs provider supports ephemeral browsing feature which opens Custom Tab that does not share cookies or other data with the browser that handles the Custom Tab.

### CATEGORY_NAVBAR_COLOR_CUSTOMIZATION

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

```
public static final String CATEGORY_NAVBAR_COLOR_CUSTOMIZATION = "androidx.browser.customtabs.category.NavBarColorCustomization"
```

An Intent filter category to signify that the Custom Tabs provider supports customizing the color of the navigation bar (`https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setNavigationBarColor(int)`).

### CATEGORY_SET_NETWORK

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/browser#1.9.0)

```
public static final String CATEGORY_SET_NETWORK = "androidx.browser.customtabs.category.SetNetwork"
```

An Intent filter category to signify that the Custom Tabs provider supports multi-network, bind a custom tab to a particular network via `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder#setNetwork(android.net.Network)`.

### CATEGORY_TRUSTED_WEB_ACTIVITY_IMMERSIVE_MODE

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

```
public static final String CATEGORY_TRUSTED_WEB_ACTIVITY_IMMERSIVE_MODE = "androidx.browser.trusted.category.ImmersiveMode"
```

An Intent filter category to signify that the Trusted Web Activity provider supports immersive mode.

### CATEGORY_WEB_SHARE_TARGET_V2

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

```
public static final String CATEGORY_WEB_SHARE_TARGET_V2 = "androidx.browser.trusted.category.WebShareTargetV2"
```

An Intent filter category to signify that the Trusted Web Activity provider supports sending shared data according to the Web Share Target v2 protocol defined in https://wicg.github.io/web-share-target/level-2/.

### FILE_PURPOSE_TRUSTED_WEB_ACTIVITY_SPLASH_IMAGE

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

```
public static final int FILE_PURPOSE_TRUSTED_WEB_ACTIVITY_SPLASH_IMAGE = 1
```

A constant to be used with `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#receiveFile(android.net.Uri,int,android.os.Bundle)` indicating that the file is a splash image to be shown on top of a Trusted Web Activity while the web contents are loading.

### KEY_SUCCESS

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/browser#1.3.0)

```
public static final String KEY_SUCCESS = "androidx.browser.customtabs.SUCCESS"
```

The key to use to store a boolean in the returns bundle of `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#extraCommand(java.lang.String,android.os.Bundle)` method, to indicate the command is executed successfully.

### KEY_URL

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

```
public static final String KEY_URL = "android.support.customtabs.otherurls.URL"
```

For `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#mayLaunchUrl(androidx.browser.customtabs.CustomTabsSessionToken,android.net.Uri,android.os.Bundle,java.util.List<android.os.Bundle>)` calls that wants to specify more than one url, this key can be used with `https://developer.android.com/reference/android/os/Bundle.html#putParcelable(java.lang.String, android.os.Parcelable)` to insert a new url to each bundle inside list of bundles.

### RELATION_HANDLE_ALL_URLS

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

```
public static final int RELATION_HANDLE_ALL_URLS = 2
```

Used for `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#validateRelationship(int,android.net.Uri,android.os.Bundle)`. Requests the ability to handle all URLs from a given origin.

### RELATION_USE_AS_ORIGIN

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

```
public static final int RELATION_USE_AS_ORIGIN = 1
```

Used for `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession#validateRelationship(int,android.net.Uri,android.os.Bundle)`. For App -\> Web transitions, requests the app to use the declared origin to be used as origin for the client app in the web APIs context.

### RESULT_FAILURE_DISALLOWED

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

```
public static final int RESULT_FAILURE_DISALLOWED = -1
```

Indicates that the postMessage request was not allowed due to a bad argument or requesting at a disallowed time like when in background.

### RESULT_FAILURE_MESSAGING_ERROR

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

```
public static final int RESULT_FAILURE_MESSAGING_ERROR = -3
```

Indicates that the postMessage request has failed due to an internal error on the browser message channel.

### RESULT_FAILURE_REMOTE_ERROR

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

```
public static final int RESULT_FAILURE_REMOTE_ERROR = -2
```

Indicates that the postMessage request has failed due to a `https://developer.android.com/reference/android/os/RemoteException.html` .

### RESULT_SUCCESS

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

```
public static final int RESULT_SUCCESS = 0
```

Indicates that the postMessage request was accepted.

### TRUSTED_WEB_ACTIVITY_CATEGORY

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

```
public static final String TRUSTED_WEB_ACTIVITY_CATEGORY = "androidx.browser.trusted.category.TrustedWebActivities"
```

An Intent filter category to signify that the Custom Tabs provider supports Trusted Web Activities (see `https://developer.android.com/reference/androidx/browser/customtabs/TrustedWebUtils` for more details).

## Public constructors

### CustomTabsService

Added in 1.2.0

```
public CustomTabsService()
```

## Public methods

### onBind

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

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

## Protected methods

### cleanUpSession

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/browser#1.9.0)

```
protected boolean cleanUpSession(@NonNull AuthTabSessionToken sessionToken)
```

Called when the client side `https://developer.android.com/reference/android/os/IBinder.html` for this `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken` is dead. Can also be used to clean up `https://developer.android.com/reference/android/os/IBinder.DeathRecipient.html` instances allocated for the given token.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken sessionToken` | The session token for which the `https://developer.android.com/reference/android/os/IBinder.DeathRecipient.html` call has been received. |

| Returns |
|---|---|
| `boolean` | True if the provided session was cleaned up as a result of this call, false if the session doesn't exist or has already been cleaned up. |

### cleanUpSession

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

```
protected boolean cleanUpSession(@NonNull CustomTabsSessionToken sessionToken)
```

Called when the client side `https://developer.android.com/reference/android/os/IBinder.html` for this `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken` is dead. Can also be used to clean up `https://developer.android.com/reference/android/os/IBinder.DeathRecipient.html` instances allocated for the given token.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The session token for which the `https://developer.android.com/reference/android/os/IBinder.DeathRecipient.html` call has been received. |

| Returns |
|---|---|
| `boolean` | Whether the clean up was successful. Multiple calls with two tokens holdings the same binder will return false. |

### extraCommand

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

```
protected abstract @Nullable Bundle extraCommand(@NonNull String commandName, @Nullable Bundle args)
```

Unsupported commands that may be provided by the implementation.

**Note:** Clients should **never** rely on this method to have a defined behavior, as it is entirely implementation-defined and not supported.

This call can be used by implementations to add extra commands, for testing or experimental purposes. A return value of `null` will be used to signify that the client does not know how to handle the request. As optional best practices, `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#KEY_SUCCESS()` could be use to identify that command was \*successfully\* handled. For example, when returning a message with result:

```
    Bundle result = new Bundle();
    result.putString("message", message);
    if (success)
        result.putBoolean(KEY_SUCCESS, true);
    return result;
```
The caller side:

```
    Bundle result = service.extraCommand(commandName, args);
    if (result.getBoolean(service.KEY_SUCCESS)) {
        // Command was successfully handled
    }
```

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html commandName` | Name of the extra command to execute. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html args` | Arguments for the command |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html` | The result `https://developer.android.com/reference/android/os/Bundle.html`, or `null`. |

### isEngagementSignalsApiAvailable

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/browser#1.6.0)

```
protected boolean isEngagementSignalsApiAvailable(
    @NonNull CustomTabsSessionToken sessionToken,
    @NonNull Bundle extras
)
```

Returns whether the Engagement Signals API is available. The availability of the Engagement Signals API may change at runtime. If an `https://developer.android.com/reference/androidx/browser/customtabs/EngagementSignalsCallback` has been set, an `https://developer.android.com/reference/androidx/browser/customtabs/EngagementSignalsCallback#onSessionEnded(boolean,android.os.Bundle)` signal will be sent if the API becomes unavailable later.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The unique identifier for the session. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html extras` | Reserved for future use. |

| Returns |
|---|---|
| `boolean` | Whether the Engagement Signals API is available. A false value means `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#setEngagementSignalsCallback(androidx.browser.customtabs.CustomTabsSessionToken,androidx.browser.customtabs.EngagementSignalsCallback,android.os.Bundle)` will return false and not set the callback. |

### mayLaunchUrl

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

```
protected abstract boolean mayLaunchUrl(
    @NonNull CustomTabsSessionToken sessionToken,
    @Nullable Uri url,
    @Nullable Bundle extras,
    @Nullable List<Bundle> otherLikelyBundles
)
```

Tells the browser of a likely future navigation to a URL.

The method `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#warmup(long)` has to be called beforehand. The most likely URL has to be specified explicitly. Optionally, a list of other likely URLs can be provided. They are treated as less likely than the first one, and have to be sorted in decreasing priority order. These additional URLs may be ignored. All previous calls to this method will be deprioritized.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The unique identifier for the session. Can not be null. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html url` | Most likely URL. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html extras` | Reserved for future use. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/os/Bundle.html> otherLikelyBundles` | Other likely destinations, sorted in decreasing likelihood order. Each Bundle has to provide a url. |

| Returns |
|---|---|
| `boolean` | Whether the call was successful. |

### newSession

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

```
protected abstract boolean newSession(@NonNull CustomTabsSessionToken sessionToken)
```

Creates a new session through an ICustomTabsService with the optional callback. This session can be used to associate any related communication through the service with an intent and then later with a Custom Tab. The client can then send later service calls or intents to through same session-intent-Custom Tab association.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | Session token to be used as a unique identifier. This also has access to the `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsCallback` passed from the client side through `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken#getCallback()`. |

| Returns |
|---|---|
| `boolean` | Whether a new session was successfully created. |

### postMessage

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

```
@CustomTabsService.Result
protected abstract int postMessage(
    @NonNull CustomTabsSessionToken sessionToken,
    @NonNull String message,
    @Nullable Bundle extras
)
```

Sends a postMessage request using the origin communicated via `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#requestPostMessageChannel(androidx.browser.customtabs.CustomTabsSessionToken,android.net.Uri)`. Fails when called before `https://developer.android.com/reference/androidx/browser/customtabs/PostMessageServiceConnection#notifyMessageChannelReady(android.os.Bundle)` is received on the client side.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The unique identifier for the session. Can not be null. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html message` | The message that is being sent. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html extras` | Reserved for future use. |

| Returns |
|---|---|
| `int` | An integer constant about the postMessage request result. Will return `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#RESULT_SUCCESS()` if successful. |

### prefetch

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/browser#1.9.0)

```
@ExperimentalPrefetch
protected void prefetch(
    @NonNull CustomTabsSessionToken sessionToken,
    @NonNull Uri url,
    @NonNull PrefetchOptions options
)
```

Request the browser to start navigational prefetch to the page that will be used for future navigations. `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#warmup(long)` is required to be called before using this method. TODO(crbug.com/40288091): Currently, there is no caller of this API and can be removed.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The unique identifier for the session. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html url` | The url to be prefetched for future navigations. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/PrefetchOptions options` | The option used for prefetch request. Please see `https://developer.android.com/reference/androidx/browser/customtabs/PrefetchOptions`. |

### prefetch

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/browser#1.9.0)

```
@ExperimentalPrefetch
protected void prefetch(
    @NonNull CustomTabsSessionToken sessionToken,
    @NonNull List<Uri> urls,
    @NonNull PrefetchOptions options
)
```

Request the browser to start navigational prefetch to the page that will be used for future navigations. `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService#warmup(long)` is required to be called before using this method.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The unique identifier for the session. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/net/Uri.html> urls` | The urls to be prefetched for future navigations. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/PrefetchOptions options` | The option used for prefetch request. Please see `https://developer.android.com/reference/androidx/browser/customtabs/PrefetchOptions`. |

### receiveFile

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

```
protected abstract boolean receiveFile(
    @NonNull CustomTabsSessionToken sessionToken,
    @NonNull Uri uri,
    int purpose,
    @Nullable Bundle extras
)
```

Receive a file from client by given Uri, e.g. in order to display a large bitmap in a Custom Tab. Prior to calling this method, the client grants a read permission to the target Custom Tabs provider via `https://developer.android.com/reference/android/content/Context.html#grantUriPermission(java.lang.String, android.net.Uri, int)`. The file is read and processed (where applicable) synchronously.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The unique identifier for the session. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html uri` | `https://developer.android.com/reference/android/net/Uri.html` of the file. |
| `int purpose` | Purpose of transferring this file, one of the constants enumerated in `CustomTabsService#FilePurpose`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html extras` | Reserved for future use. |

| Returns |
|---|---|
| `boolean` | `true` if the file was received successfully. |

### registerAuthTabSession

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/browser#1.9.0)

```
protected boolean registerAuthTabSession(@NonNull AuthTabSessionToken sessionToken)
```

Creates a new Auth Tab session through an ICustomTabsService with the optional callback. This session can be used to associate any related communication through the service with an intent and then later with an Auth Tab. The client can then send later service calls or intents through the same session-intent-Auth Tab association.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken sessionToken` | Session token to be used as a unique identifier. This also has access to the AuthTabCallback passed from the client side through `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken#getCallback()`. |

| Returns |
|---|---|
| `boolean` | Whether a new session was successfully created. |

### requestPostMessageChannel

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

```
protected abstract boolean requestPostMessageChannel(
    @NonNull CustomTabsSessionToken sessionToken,
    @NonNull Uri postMessageOrigin
)
```

Sends a request to create a two way postMessage channel between the client and the browser linked with the given `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSession`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The unique identifier for the session. Can not be null. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html postMessageOrigin` | A origin that the client is requesting to be identified as during the postMessage communication. |

| Returns |
|---|---|
| `boolean` | Whether the implementation accepted the request. Note that returning true here doesn't mean an origin has already been assigned as the validation is asynchronous. |

### requestPostMessageChannel

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/browser#1.6.0)

```
protected boolean requestPostMessageChannel(
    @NonNull CustomTabsSessionToken sessionToken,
    @NonNull Uri postMessageOrigin,
    @Nullable Uri postMessageTargetOrigin,
    @NonNull Bundle extras
)
```

Same as above method with specifying the target origin to establish communication with.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The unique identifier for the session. Can not be null. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html postMessageOrigin` | A origin that the client is requesting to be identified as during the postMessage communication. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/net/Uri.html postMessageTargetOrigin` | The target Origin to establish PostMessageChannel with and send messages to. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html extras` | Reserved for future use. |

| Returns |
|---|---|
| `boolean` | Whether the implementation accepted the request. Note that returning true here doesn't mean an origin has already been assigned as the validation is asynchronous. |

### setEngagementSignalsCallback

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/browser#1.6.0)

```
protected boolean setEngagementSignalsCallback(
    @NonNull CustomTabsSessionToken sessionToken,
    @NonNull EngagementSignalsCallback callback,
    @NonNull Bundle extras
)
```

Sets an `https://developer.android.com/reference/androidx/browser/customtabs/EngagementSignalsCallback` to execute callbacks for events related to the user's engagement with the webpage within the tab.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The unique identifier for the session. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/EngagementSignalsCallback callback` | The `https://developer.android.com/reference/androidx/browser/customtabs/EngagementSignalsCallback` to execute the callbacks. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/os/Bundle.html extras` | Reserved for future use. |

| Returns |
|---|---|
| `boolean` | Whether the callback connection is allowed. If false, no callbacks will be called for this session. |

### updateVisuals

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

```
protected abstract boolean updateVisuals(
    @NonNull CustomTabsSessionToken sessionToken,
    @Nullable Bundle bundle
)
```

Updates the visuals of custom tabs for the given session. Will only succeed if the given session matches the currently active one.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The currently active session that the custom tab belongs to. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html bundle` | The action button configuration bundle. This bundle should be constructed with the same structure in `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent.Builder`. |

| Returns |
|---|---|
| `boolean` | Whether the operation was successful. |

### validateRelationship

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

```
protected abstract boolean validateRelationship(
    @NonNull CustomTabsSessionToken sessionToken,
    @CustomTabsService.Relation int relation,
    @NonNull Uri origin,
    @Nullable Bundle extras
)
```

Request to validate a relationship between the application and an origin. If this method returns true, the validation result will be provided through `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsCallback#onRelationshipValidationResult(int,android.net.Uri,boolean,android.os.Bundle)`. Otherwise the request didn't succeed. The client must call `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsClient#warmup(long)` before this.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsSessionToken sessionToken` | The unique identifier for the session. Can not be null. |
| `@https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsService.Relation int relation` | Relation to check, must be one of the `CustomTabsService#RELATION_* ` constants. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html origin` | Origin for the relation query. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/os/Bundle.html extras` | Reserved for future use. |

| Returns |
|---|---|
| `boolean` | true if the request has been submitted successfully. |

### warmup

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

```
protected abstract boolean warmup(long flags)
```

Warms up the browser process asynchronously.

| Parameters |
|---|---|
| `long flags` | Reserved for future use. |

| Returns |
|---|---|
| `boolean` | Whether warmup was/had been completed successfully. Multiple successful calls will return true. |