# CarAppService

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/CarAppService.java+class:androidx.car.app.CarAppService) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


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

*** ** * ** ***

The base class for implementing a car app that runs in the car

#### Service Declaration

The app must extend the `https://developer.android.com/reference/androidx/car/app/CarAppService` to be bound by the car host. The service must also respond to `https://developer.android.com/reference/android/content/Intent.html` actions coming from the host, by adding an `intent-filter` to the service in the `AndroidManifest.xml` that handles the `https://developer.android.com/reference/androidx/car/app/CarAppService#SERVICE_INTERFACE()` action. The app must also declare what category of application it is (e.g. `https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_NAVIGATION_APP()`). For example:

```
<service
  android:name=".YourAppService"
  android:exported="true">
  <intent-filter>
    <action android:name="androidx.car.app.CarAppService" />
    <category android:name="androidx.car.app.category.NAVIGATION"/>
  </intent-filter>
</service>
```

For a list of all the supported categories see [Supported App Categories](https://developer.android.com/training/cars/apps#supported-app-categories).

#### Accessing Location

When the app is running in the car display, the system will not consider it as being in the foreground, and hence it will be considered in the background for the purpose of retrieving location as described [here](https://developer.android.com/about/versions/10/privacy/changes#app-access-device
-location).

To reliably get location for your car app, we recommended that you use a [foreground service](https://developer.android.com/guide/components/services#Types-of-services). If you have a service other than your `https://developer.android.com/reference/androidx/car/app/CarAppService` that accesses location, run the service and your \`CarAppService\` in the same process. Also note that accessing location may become unreliable when the phone is in the battery saver mode.

## Summary

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/car/app/annotations/ExperimentalCarApi https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_CALLING_APP() = "androidx.car.app.category.CALLING"` Used in the app manifest to declare that this app supports calling. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_CHARGING_APP() = "androidx.car.app.category.CHARGING"` **This field is deprecated.** use `https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_POI_APP()` instead <br /> |
| `static final https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 6) https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_FEATURE_CLUSTER() = "androidx.car.app.category.FEATURE_CLUSTER"` Used to declare that this app supports cluster in the manifest. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 6) https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_IOT_APP() = "androidx.car.app.category.IOT"` Used in the app manifest. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 8) https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_MEDIA_APP() = "androidx.car.app.category.MEDIA"` Used to declare that this app is a media app in the manifest. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/car/app/annotations/ExperimentalCarApi https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_MESSAGING_APP() = "androidx.car.app.category.MESSAGING"` Used to declare that this app is a messaging app in the manifest. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_NAVIGATION_APP() = "androidx.car.app.category.NAVIGATION"` Used to declare that this app is a navigation app in the manifest. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_PARKING_APP() = "androidx.car.app.category.PARKING"` **This field is deprecated.** use `https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_POI_APP()` instead <br /> |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_POI_APP() = "androidx.car.app.category.POI"` Used in the app manifest. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 6) https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_SETTINGS_APP() = "androidx.car.app.category.SETTINGS"` Used to declare that this app is a settings app in the manifest. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 7) https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_WEATHER_APP() = "androidx.car.app.category.WEATHER"` Used to declare that this app is a weather app in the manifest. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/CarAppService#SERVICE_INTERFACE() = "androidx.car.app.CarAppService"` The full qualified name of the `https://developer.android.com/reference/androidx/car/app/CarAppService` class. |
| `static final int` | `@https://developer.android.com/reference/androidx/car/app/annotations/ExperimentalCarApi @https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 9) https://developer.android.com/reference/androidx/car/app/CarAppService#THEME_SOURCE_APP() = 1` Request standard/neutral theme experience, bypassing OEM overrides. |
| `static final int` | `@https://developer.android.com/reference/androidx/car/app/annotations/ExperimentalCarApi @https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 9) https://developer.android.com/reference/androidx/car/app/CarAppService#THEME_SOURCE_SYSTEM() = 0` Respect system/OEM customization (colors, shapes, typography). |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/CarAppService#CarAppService()()` |

| ### Public methods |
|---|---|
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/validation/HostValidator` | `https://developer.android.com/reference/androidx/car/app/CarAppService#createHostValidator()()` Returns the `https://developer.android.com/reference/androidx/car/app/validation/HostValidator` this service will use to accept or reject host connections. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/CallSuper https://developer.android.com/reference/androidx/car/app/CarAppService#dump(java.io.FileDescriptor,java.io.PrintWriter,java.lang.String[])( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/io/FileDescriptor.html fd, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/io/PrintWriter.html writer, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html String[] args )` |
| `int` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 9) @https://developer.android.com/reference/androidx/car/app/annotations/ExperimentalCarApi https://developer.android.com/reference/androidx/car/app/CarAppService#getCarAppThemeSource()()` Returns the app-wide theme that should be applied to all templates within this application. |
| `final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/Session` | `[getCurrentSession](https://developer.android.com/reference/androidx/car/app/CarAppService#getCurrentSession())()` **This method is deprecated.** use `https://developer.android.com/reference/androidx/car/app/CarAppService#getSession(androidx.car.app.SessionInfo)` <br /> |
| `final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/HostInfo` | `https://developer.android.com/reference/androidx/car/app/CarAppService#getHostInfo()()` Returns information about the host attached to this service. |
| `final @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/Session` | `https://developer.android.com/reference/androidx/car/app/CarAppService#getSession(androidx.car.app.SessionInfo)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/SessionInfo sessionInfo)` Returns the `https://developer.android.com/reference/androidx/car/app/Session` associated to the given `https://developer.android.com/reference/androidx/car/app/SessionInfo`, or `null` if one doesn't exist. |
| `final @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/annotation/CallSuper https://developer.android.com/reference/androidx/car/app/CarAppService#onBind(android.content.Intent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent)` Handles the host binding to this car app. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/Session` | `https://developer.android.com/reference/androidx/car/app/CarAppService#onCreateSession()()` Creates a new `https://developer.android.com/reference/androidx/car/app/Session` for the application. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/Session` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 6) https://developer.android.com/reference/androidx/car/app/CarAppService#onCreateSession(androidx.car.app.SessionInfo)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/SessionInfo sessionInfo)` Creates a new `https://developer.android.com/reference/androidx/car/app/Session`. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/CallSuper https://developer.android.com/reference/androidx/car/app/CarAppService#onDestroy()()` |
| `final boolean` | `https://developer.android.com/reference/androidx/car/app/CarAppService#onUnbind(android.content.Intent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent)` Handles the host unbinding from this car app. |

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

### CATEGORY_CALLING_APP

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.4.0)

```
@ExperimentalCarApi
public static final String CATEGORY_CALLING_APP = "androidx.car.app.category.CALLING"
```

Used in the app manifest to declare that this app supports calling.

### CATEGORY_CHARGING_APP

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0) Deprecated in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
public static final String CATEGORY_CHARGING_APP = "androidx.car.app.category.CHARGING"
```

> [!CAUTION]
> **This field is deprecated.**   
>
> use `https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_POI_APP()` instead

Used to declare that this app is a charging app in the manifest.

### CATEGORY_FEATURE_CLUSTER

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

```
@RequiresCarApi(value = 6)
public static final String CATEGORY_FEATURE_CLUSTER = "androidx.car.app.category.FEATURE_CLUSTER"
```

Used to declare that this app supports cluster in the manifest.

### CATEGORY_IOT_APP

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

```
@RequiresCarApi(value = 6)
public static final String CATEGORY_IOT_APP = "androidx.car.app.category.IOT"
```

Used in the app manifest. It declares that this app declares physical objects with sensors, that connect and exchange data with other devices and systems.

### CATEGORY_MEDIA_APP

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
@RequiresCarApi(value = 8)
public static final String CATEGORY_MEDIA_APP = "androidx.car.app.category.MEDIA"
```

Used to declare that this app is a media app in the manifest.

### CATEGORY_MESSAGING_APP

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

```
@ExperimentalCarApi
public static final String CATEGORY_MESSAGING_APP = "androidx.car.app.category.MESSAGING"
```

Used to declare that this app is a messaging app in the manifest.

This app can be used to send and receive short-form chat messages (IM/SMS).

### CATEGORY_NAVIGATION_APP

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

```
public static final String CATEGORY_NAVIGATION_APP = "androidx.car.app.category.NAVIGATION"
```

Used to declare that this app is a navigation app in the manifest.

### CATEGORY_PARKING_APP

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0) Deprecated in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
public static final String CATEGORY_PARKING_APP = "androidx.car.app.category.PARKING"
```

> [!CAUTION]
> **This field is deprecated.**   
>
> use `https://developer.android.com/reference/androidx/car/app/CarAppService#CATEGORY_POI_APP()` instead

Used to declare that this app is a parking app in the manifest.

### CATEGORY_POI_APP

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

```
public static final String CATEGORY_POI_APP = "androidx.car.app.category.POI"
```

Used in the app manifest. It declares that this app finds points of interests (POI).

### CATEGORY_SETTINGS_APP

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

```
@RequiresCarApi(value = 6)
public static final String CATEGORY_SETTINGS_APP = "androidx.car.app.category.SETTINGS"
```

Used to declare that this app is a settings app in the manifest. This app can be used to provide screens corresponding to the settings page and/or any error resolution screens e.g. sign-in screen.

### CATEGORY_WEATHER_APP

Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.4.0)

```
@RequiresCarApi(value = 7)
public static final String CATEGORY_WEATHER_APP = "androidx.car.app.category.WEATHER"
```

Used to declare that this app is a weather app in the manifest.

### SERVICE_INTERFACE

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

```
public static final String SERVICE_INTERFACE = "androidx.car.app.CarAppService"
```

The full qualified name of the `https://developer.android.com/reference/androidx/car/app/CarAppService` class.

This is the same name that must be used to declare the action of the intent filter for the app's `https://developer.android.com/reference/androidx/car/app/CarAppService` in the app's manifest.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/CarAppService` |   |

### THEME_SOURCE_APP

Added in [1.9.0-alpha03](https://developer.android.com/jetpack/androidx/releases/car-app#1.9.0-alpha03)

```
@ExperimentalCarApi
@RequiresCarApi(value = 9)
public static final int THEME_SOURCE_APP = 1
```

Request standard/neutral theme experience, bypassing OEM overrides.

### THEME_SOURCE_SYSTEM

Added in [1.9.0-alpha03](https://developer.android.com/jetpack/androidx/releases/car-app#1.9.0-alpha03)

```
@ExperimentalCarApi
@RequiresCarApi(value = 9)
public static final int THEME_SOURCE_SYSTEM = 0
```

Respect system/OEM customization (colors, shapes, typography).

## Public constructors

### CarAppService

Added in 1.0.0

```
public CarAppService()
```

## Public methods

### createHostValidator

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

```
public abstract @NonNull HostValidator createHostValidator()
```

Returns the `https://developer.android.com/reference/androidx/car/app/validation/HostValidator` this service will use to accept or reject host connections.

By default, the provided `https://developer.android.com/reference/androidx/car/app/validation/HostValidator.Builder` would produce a validator that only accepts connections from hosts holding `https://developer.android.com/reference/androidx/car/app/validation/HostValidator#TEMPLATE_RENDERER_PERMISSION()` permission.

Application developers are expected to also allow connections from known hosts which don't hold the aforementioned permission (for example, Android Auto and Android Automotive OS hosts below API level 31), by allow-listing the signatures of those hosts.

Refer to `androidx.car.app.R.array.hosts_allowlist_sample` to obtain a list of package names and signatures that should be allow-listed by default.

It is also advised to allow connections from unknown hosts in debug builds to facilitate debugging and testing.

Below is an example of this method implementation:

```
@Override
@NonNull
public HostValidator createHostValidator() {
    if ((getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
        return HostValidator.ALLOW_ALL_HOSTS_VALIDATOR;
    } else {
        return new HostValidator.Builder(context)
            .addAllowedHosts(androidx.car.app.R.array.hosts_allowlist_sample)
            .build();
    }
}
```

### dump

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

```
@CallSuper
public final void dump(
    @NonNull FileDescriptor fd,
    @NonNull PrintWriter writer,
    @Nullable String[] args
)
```

### getCarAppThemeSource

Added in [1.9.0-alpha03](https://developer.android.com/jetpack/androidx/releases/car-app#1.9.0-alpha03)

```
@RequiresCarApi(value = 9)
@ExperimentalCarApi
public int getCarAppThemeSource()
```

Returns the app-wide theme that should be applied to all templates within this application.

Starting in API 9, by default, this method returns `https://developer.android.com/reference/androidx/car/app/CarAppService#THEME_SOURCE_SYSTEM()`. This means the app will automatically inherit the system-provided theme, which may include dynamic, OEM-specific styling depending on the platform.

App developers are expected to override this method and return `https://developer.android.com/reference/androidx/car/app/CarAppService#THEME_SOURCE_APP()` if they wish to maintain strict control over their brand visual styling.

Below is an example of this method implementation:

```
@Override
public int getCarAppThemeSource() {
    // Return THEME_SOURCE_APP to retain custom app styling with CAL defaults theme,
    // or THEME_SOURCE_SYSTEM to adopt the system styling.
    if (shouldUseCustomBranding()) {
        return CarAppService.THEME_SOURCE_SYSTEM;
    } else {
        return CarAppService.THEME_SOURCE_APP;
    }
}
```

| Returns |
|---|---|
| `int` | the theme to apply to the application globally. |

### getCurrentSession

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0) Deprecated in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
public final @Nullable Session [getCurrentSession](https://developer.android.com/reference/androidx/car/app/CarAppService#getCurrentSession())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> use `https://developer.android.com/reference/androidx/car/app/CarAppService#getSession(androidx.car.app.SessionInfo)`

Returns the current `https://developer.android.com/reference/androidx/car/app/Session` for the main display if one exists, otherwise returns `null`.

### getHostInfo

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

```
public final @Nullable HostInfo getHostInfo()
```

Returns information about the host attached to this service.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/HostInfo` |   |

### getSession

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

```
public final @Nullable Session getSession(@NonNull SessionInfo sessionInfo)
```

Returns the `https://developer.android.com/reference/androidx/car/app/Session` associated to the given `https://developer.android.com/reference/androidx/car/app/SessionInfo`, or `null` if one doesn't exist.

### onBind

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

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

Handles the host binding to this car app.

This method is final to ensure this car app's lifecycle is handled properly.

Use `https://developer.android.com/reference/androidx/car/app/CarAppService#onCreateSession(androidx.car.app.SessionInfo)` and `https://developer.android.com/reference/androidx/car/app/Session#onNewIntent(android.content.Intent)` instead to handle incoming `https://developer.android.com/reference/android/content/Intent.html`s.

### onCreateSession

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

```
public @NonNull Session onCreateSession()
```

Creates a new `https://developer.android.com/reference/androidx/car/app/Session` for the application.

This method is invoked the first time the app is started, or if the previous `https://developer.android.com/reference/androidx/car/app/Session` instance has been destroyed and the system has not yet destroyed this service.

Once the method returns, `https://developer.android.com/reference/androidx/car/app/Session#onCreateScreen(android.content.Intent)` will be called on the `https://developer.android.com/reference/androidx/car/app/Session` returned.

Called by the system, do not call this method directly.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/CarContext#startCarApp(android.content.Intent)` |   |

### onCreateSession

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

```
@RequiresCarApi(value = 6)
public @NonNull Session onCreateSession(@NonNull SessionInfo sessionInfo)
```

Creates a new `https://developer.android.com/reference/androidx/car/app/Session`.

This method is invoked once per app-supported physical display with a unique `https://developer.android.com/reference/androidx/car/app/SessionInfo` identifying the type of display. Support for displays is declared within the AndroidManifest.xml. This method can also be invoked if the previous instance has been destroyed (ie. due to memory pressure) and the system has not yet destroyed this service.

This method is called by the system and should not be called directly.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/CarContext#startCarApp(android.content.Intent)` |   |

### onDestroy

```
@CallSuper
public void onDestroy()
```

### onUnbind

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

```
public final boolean onUnbind(@NonNull Intent intent)
```

Handles the host unbinding from this car app.

This method is final to ensure this car app's lifecycle is handled properly.