Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Inherited Constants](https://developer.android.com/reference/android/content/ContextWrapper#inhconstants) \| [Ctors](https://developer.android.com/reference/android/content/ContextWrapper#pubctors) \| [Methods](https://developer.android.com/reference/android/content/ContextWrapper#pubmethods) \| [Protected Methods](https://developer.android.com/reference/android/content/ContextWrapper#promethods) \| [Inherited Methods](https://developer.android.com/reference/android/content/ContextWrapper#inhmethods)

# ContextWrapper

*** ** * ** ***


`
public


class
ContextWrapper
`


`


`

`

extends https://developer.android.com/reference/android/content/Context


`

`


`

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.content.Context](https://developer.android.com/reference/android/content/Context) ||
|   | ↳ | android.content.ContextWrapper |

Known direct subclasses [Application](https://developer.android.com/reference/android/app/Application), [BackupAgent](https://developer.android.com/reference/android/app/backup/BackupAgent), [ContextThemeWrapper](https://developer.android.com/reference/android/view/ContextThemeWrapper), [IsolatedContext](https://developer.android.com/reference/android/test/IsolatedContext), [MutableContextWrapper](https://developer.android.com/reference/android/content/MutableContextWrapper), [RenamingDelegatingContext](https://developer.android.com/reference/android/test/RenamingDelegatingContext), [Service](https://developer.android.com/reference/android/app/Service) [Application](https://developer.android.com/reference/android/app/Application) Base class for maintaining global application state. [BackupAgent](https://developer.android.com/reference/android/app/backup/BackupAgent) Provides the central interface between an application and Android's data backup infrastructure. [ContextThemeWrapper](https://developer.android.com/reference/android/view/ContextThemeWrapper) A context wrapper that allows you to modify or replace the theme of the wrapped context. [IsolatedContext](https://developer.android.com/reference/android/test/IsolatedContext) *This class was deprecated
in API level 24.
New tests should be written using the
[Android Testing Support Library](https://developer.android.com/tools/testing-support-library).* [MutableContextWrapper](https://developer.android.com/reference/android/content/MutableContextWrapper) Special version of `https://developer.android.com/reference/android/content/ContextWrapper` that allows the base context to be modified after it is initially set. [RenamingDelegatingContext](https://developer.android.com/reference/android/test/RenamingDelegatingContext) *This class was deprecated
in API level 24.
New tests should be written using the
[Android Testing Support Library](https://developer.android.com/tools/testing-support-library).* [Service](https://developer.android.com/reference/android/app/Service) A Service is an application component representing either an application's desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use. Known indirect subclasses [AbstractInputMethodService](https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService), [AccessibilityService](https://developer.android.com/reference/android/accessibilityservice/AccessibilityService), [AccountAuthenticatorActivity](https://developer.android.com/reference/android/accounts/AccountAuthenticatorActivity), [Activity](https://developer.android.com/reference/android/app/Activity), [ActivityGroup](https://developer.android.com/reference/android/app/ActivityGroup), [AliasActivity](https://developer.android.com/reference/android/app/AliasActivity), [AlternativeMessageTransportService](https://developer.android.com/reference/android/service/messaging/AlternativeMessageTransportService), [AppContentProjectionService](https://developer.android.com/reference/android/media/projection/AppContentProjectionService), [AppFunctionService](https://developer.android.com/reference/android/app/appfunctions/AppFunctionService), [AutofillService](https://developer.android.com/reference/android/service/autofill/AutofillService), [BackupAgentHelper](https://developer.android.com/reference/android/app/backup/BackupAgentHelper), [CallRedirectionService](https://developer.android.com/reference/android/telecom/CallRedirectionService), [CallScreeningService](https://developer.android.com/reference/android/telecom/CallScreeningService), [CameraPrewarmService](https://developer.android.com/reference/android/service/media/CameraPrewarmService), [CarrierMessagingClientService](https://developer.android.com/reference/android/service/carrier/CarrierMessagingClientService), and 53 others. [AbstractInputMethodService](https://developer.android.com/reference/android/inputmethodservice/AbstractInputMethodService) AbstractInputMethodService provides a abstract base class for input methods. [AccessibilityService](https://developer.android.com/reference/android/accessibilityservice/AccessibilityService) Accessibility services should only be used to assist users with disabilities in using Android devices and apps. [AccountAuthenticatorActivity](https://developer.android.com/reference/android/accounts/AccountAuthenticatorActivity) *This class was deprecated
in API level 30.
Applications should extend Activity themselves. This class is not compatible with
AppCompat, and the functionality it provides is not complex.* [Activity](https://developer.android.com/reference/android/app/Activity) An activity is a single, focused thing that the user can do. [ActivityGroup](https://developer.android.com/reference/android/app/ActivityGroup) *This class was deprecated
in API level 13.
Use the new `https://developer.android.com/reference/android/app/Fragment` and `https://developer.android.com/reference/android/app/FragmentManager` APIs
instead; these are also
available on older platforms through the Android compatibility package.* [AliasActivity](https://developer.android.com/reference/android/app/AliasActivity) *This class was deprecated
in API level 30.
Use `<activity-alias>` or subclass Activity directly.* [AlternativeMessageTransportService](https://developer.android.com/reference/android/service/messaging/AlternativeMessageTransportService) AlternativeMessageTransportService (AMTS) allows the default SMS app to handle the sending of a message over a different transport (e.g. RCS etc.) other than the SMS or MMS. [AppContentProjectionService](https://developer.android.com/reference/android/media/projection/AppContentProjectionService) Service to be implemented by the application providing the `https://developer.android.com/reference/android/media/projection/MediaProjectionAppContent`. [AppFunctionService](https://developer.android.com/reference/android/app/appfunctions/AppFunctionService) Extend this class to implement app functions, that can be executed by `https://developer.android.com/reference/android/app/appfunctions/AppFunctionManager#executeAppFunction(android.app.AppInteractionSession,%20android.app.appfunctions.ExecuteAppFunctionRequest,%20java.util.concurrent.Executor,%20android.os.CancellationSignal,%20android.os.OutcomeReceiver<android.app.appfunctions.ExecuteAppFunctionResponse,android.app.appfunctions.AppFunctionException>)`. [AutofillService](https://developer.android.com/reference/android/service/autofill/AutofillService) An `AutofillService` is a service used to automatically fill the contents of the screen on behalf of a given user - for more information about autofill, read [Autofill Framework](https://developer.android.com/preview/features/autofill). [BackupAgentHelper](https://developer.android.com/reference/android/app/backup/BackupAgentHelper) A convenient `https://developer.android.com/reference/android/app/backup/BackupAgent` wrapper class that automatically manages heterogeneous data sets within the backup data, each identified by a unique key prefix. [CallRedirectionService](https://developer.android.com/reference/android/telecom/CallRedirectionService) This service can be implemented to interact between Telecom and its implementor for making outgoing call with optional redirection/cancellation purposes. [CallScreeningService](https://developer.android.com/reference/android/telecom/CallScreeningService) This service can be implemented by the default dialer (see `https://developer.android.com/reference/android/telecom/TelecomManager#getDefaultDialerPackage()`) or a third party app to allow or disallow incoming calls before they are shown to a user. [CameraPrewarmService](https://developer.android.com/reference/android/service/media/CameraPrewarmService) Extend this class to implement a camera prewarm service. [CarrierMessagingClientService](https://developer.android.com/reference/android/service/carrier/CarrierMessagingClientService) If the default SMS app has a service that extends this class, the system always tries to bind it so that the process is always running, which allows the app to have a persistent connection to the server. [CarrierMessagingService](https://developer.android.com/reference/android/service/carrier/CarrierMessagingService) A service that receives calls from the system when new SMS and MMS are sent or received. [CarrierService](https://developer.android.com/reference/android/service/carrier/CarrierService) A service that exposes carrier-specific functionality to the system. [ChooserTargetService](https://developer.android.com/reference/android/service/chooser/ChooserTargetService) *This class was deprecated
in API level 30.
For publishing direct share targets, please follow the instructions in
https://developer.android.com/training/sharing/receive.html#providing-direct-share-targets
instead.* [CompanionDeviceService](https://developer.android.com/reference/android/companion/CompanionDeviceService) A service that receives calls from the system with device events. [ConditionProviderService](https://developer.android.com/reference/android/service/notification/ConditionProviderService) *This class was deprecated
in API level 29.
Instead of using an automatically bound service, use
`https://developer.android.com/reference/android/app/NotificationManager#setAutomaticZenRuleState(java.lang.String,%20android.service.notification.Condition)` to tell the
system about the state of your rule. In order to maintain a link from
Settings to your rule configuration screens, provide a configuration activity that handles
`https://developer.android.com/reference/android/app/NotificationManager#ACTION_AUTOMATIC_ZEN_RULE` on your
`https://developer.android.com/reference/android/app/AutomaticZenRule` via
`https://developer.android.com/reference/android/app/AutomaticZenRule#setConfigurationActivity(android.content.ComponentName)`.* [ConnectionService](https://developer.android.com/reference/android/telecom/ConnectionService) An abstract service that should be implemented by any apps which either:

1. Can make phone calls (VoIP or otherwise) and want those calls to be integrated into the built-in phone app.
[ContentSafetyAppService](https://developer.android.com/reference/android/service/contentsafety/ContentSafetyAppService) Base class for a service that the `android.app.role.RoleManager.ROLE_CONTENT_SAFETY` role holder must implement. [ControlsProviderService](https://developer.android.com/reference/android/service/controls/ControlsProviderService) Service implementation allowing applications to contribute controls to the System UI. [CredentialProviderService](https://developer.android.com/reference/android/service/credentials/CredentialProviderService) Service to be extended by credential providers, in order to return user credentials to the framework. [DataMigrationToPccService](https://developer.android.com/reference/android/app/privatecompute/DataMigrationToPccService) Base class for a service that handles data migration to the Private Compute Core (PCC) storage of an application. [DeviceAdminService](https://developer.android.com/reference/android/app/admin/DeviceAdminService) Base class for a service that device owner/profile owners can optionally have. [DreamService](https://developer.android.com/reference/android/service/dreams/DreamService) Extend this class to implement a custom dream (available to the user as a "Daydream"). [EgressReceiverService](https://developer.android.com/reference/android/app/privatecompute/EgressReceiverService) Base Service to be implemented by the partner agent proxy process to receive egress queries from a client running inside the Private Compute Core (PCC) sandbox. [ExpandableListActivity](https://developer.android.com/reference/android/app/ExpandableListActivity) *This class was deprecated
in API level 30.
Use `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.html` or use
`https://developer.android.com/reference/android/widget/ExpandableListView` directly* [HostApduService](https://developer.android.com/reference/android/nfc/cardemulation/HostApduService) HostApduService is a convenience `https://developer.android.com/reference/android/app/Service` class that can be
extended to emulate an NFC card inside an Android
service component.


[HostNfcFService](https://developer.android.com/reference/android/nfc/cardemulation/HostNfcFService) HostNfcFService is a convenience `https://developer.android.com/reference/android/app/Service` class that can be
extended to emulate an NFC-F card inside an Android service component.


[InCallService](https://developer.android.com/reference/android/telecom/InCallService) This service is implemented by an app that wishes to provide functionality for managing phone calls. [InputMethodService](https://developer.android.com/reference/android/inputmethodservice/InputMethodService) InputMethodService provides a standard implementation of an InputMethod, which final implementations can derive from and customize. [IntentService](https://developer.android.com/reference/android/app/IntentService) *This class was deprecated
in API level 30.
IntentService is subject to all the
[background execution limits](https://developer.android.com/about/versions/oreo/background)
imposed with Android 8.0 (API level 26). Consider using `https://developer.android.com/reference/androidx/work/WorkManager.html`
instead.* [IsolatedService](https://developer.android.com/reference/android/adservices/ondevicepersonalization/IsolatedService) *This class was deprecated
in API level 37.
The ODP APIs are deprecated and will not be supported in future Android releases.
There is no direct replacement API available. Developers currently integrated with these APIs
must cease further integration efforts. For comprehensive details regarding this deprecation and
the future roadmap of Privacy Sandbox on Android, please consult the official Privacy Sandbox
developer documentation and announcements:
<https://privacysandbox.google.com>* [JobService](https://developer.android.com/reference/android/app/job/JobService) Entry point for the callback from the `https://developer.android.com/reference/android/app/job/JobScheduler`.


[LauncherActivity](https://developer.android.com/reference/android/app/LauncherActivity) *This class was deprecated
in API level 30.
Applications can implement this UI themselves using
`https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.html` and
`https://developer.android.com/reference/android/content/pm/PackageManager#queryIntentActivities(android.content.Intent,%20int)`* [ListActivity](https://developer.android.com/reference/android/app/ListActivity) *This class was deprecated
in API level 30.
Use `https://developer.android.com/reference/androidx/fragment/app/ListFragment.html` or
`https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.html` to implement your Activity instead.* [MediaBrowserService](https://developer.android.com/reference/android/service/media/MediaBrowserService) Base class for media browser services. [MediaRoute2ProviderService](https://developer.android.com/reference/android/media/MediaRoute2ProviderService) Base class for media route provider services. [MediaSession2Service](https://developer.android.com/reference/android/media/MediaSession2Service) *This class was deprecated
in API level 37.
Use the Media3 support library's `androidx.media3.session.MediaSessionService`
instead.* [MidiDeviceService](https://developer.android.com/reference/android/media/midi/MidiDeviceService) A service that implements a virtual MIDI device. [MidiUmpDeviceService](https://developer.android.com/reference/android/media/midi/MidiUmpDeviceService) A service that implements a virtual MIDI device for Universal MIDI Packets (UMP). [MockApplication](https://developer.android.com/reference/android/test/mock/MockApplication) *This class was deprecated
in API level 24.
Use a mocking framework like [Mockito](https://github.com/mockito/mockito).
New tests should be written using the
[Android Testing Support Library](https://developer.android.com/tools/testing-support-library).* [NativeActivity](https://developer.android.com/reference/android/app/NativeActivity) Convenience for implementing an activity that will be implemented purely in native code. [NotificationListenerService](https://developer.android.com/reference/android/service/notification/NotificationListenerService) A service that receives calls from the system when new notifications are posted or removed, or their ranking changed. [OffHostApduService](https://developer.android.com/reference/android/nfc/cardemulation/OffHostApduService) OffHostApduService is a convenience `https://developer.android.com/reference/android/app/Service` class that can be
extended to describe one or more NFC applications that are residing
off-host, for example on an embedded secure element or a UICC.


[PccService](https://developer.android.com/reference/android/app/privatecompute/PccService) Abstract base class for a PCC service that receives data from other components. [PreferenceActivity](https://developer.android.com/reference/android/preference/PreferenceActivity) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [PrintService](https://developer.android.com/reference/android/printservice/PrintService)
This is the base class for implementing print services.


[QuickAccessWalletService](https://developer.android.com/reference/android/service/quickaccesswallet/QuickAccessWalletService) A `QuickAccessWalletService` provides a list of `WalletCard`s shown in the Quick Access Wallet. [RecognitionService](https://developer.android.com/reference/android/speech/RecognitionService) This class provides a base class for recognition service implementations. [RemoteViewsService](https://developer.android.com/reference/android/widget/RemoteViewsService) The service to be connected to for a remote adapter to request RemoteViews. [SettingInjectorService](https://developer.android.com/reference/android/location/SettingInjectorService) Dynamically specifies the summary (subtitle) and enabled status of a preference injected into the list of app settings displayed by the system settings app

<br />

For use only by apps that are included in the system image, for preferences that affect multiple apps. [SettingsPreferenceService](https://developer.android.com/reference/android/service/settings/preferences/SettingsPreferenceService) Base class for a service that exposes its settings preferences to external access. [SpellCheckerService](https://developer.android.com/reference/android/service/textservice/SpellCheckerService) SpellCheckerService provides an abstract base class for a spell checker. [TabActivity](https://developer.android.com/reference/android/app/TabActivity) *This class was deprecated
in API level 13.
New applications should use Fragments instead of this class;
to continue to run on older devices, you can use the v4 support library
which provides a version of the Fragment API that is compatible down to
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#DONUT`.* [TextToSpeechService](https://developer.android.com/reference/android/speech/tts/TextToSpeechService) Abstract base class for TTS engine implementations. [TileService](https://developer.android.com/reference/android/service/quicksettings/TileService) A TileService provides the user a tile that can be added to Quick Settings. [TvAdService](https://developer.android.com/reference/android/media/tv/ad/TvAdService) The TvAdService class represents a TV client-side advertisement service. [TvInputService](https://developer.android.com/reference/android/media/tv/TvInputService) The TvInputService class represents a TV input or source such as HDMI or built-in tuner which provides pass-through video or broadcast TV programs. [TvInteractiveAppService](https://developer.android.com/reference/android/media/tv/interactive/TvInteractiveAppService) A TV interactive application service is a service that provides runtime environment and runs TV interactive applications. [VisualVoicemailService](https://developer.android.com/reference/android/telephony/VisualVoicemailService) This service is implemented by dialer apps that wishes to handle OMTP or similar visual voicemails. [VoiceInteractionService](https://developer.android.com/reference/android/service/voice/VoiceInteractionService) Top-level service of the current global voice interactor, which is providing support for hotwording, the back-end of a `https://developer.android.com/reference/android/app/VoiceInteractor`, etc. [VoiceInteractionSessionService](https://developer.android.com/reference/android/service/voice/VoiceInteractionSessionService) An active voice interaction session, initiated by a `https://developer.android.com/reference/android/service/voice/VoiceInteractionService`. [VpnService](https://developer.android.com/reference/android/net/VpnService) VpnService is a base class for applications to extend and build their own VPN solutions. [VrListenerService](https://developer.android.com/reference/android/service/vr/VrListenerService) A service that is bound from the system while running in virtual reality (VR) mode. [WallpaperService](https://developer.android.com/reference/android/service/wallpaper/WallpaperService) A wallpaper service is responsible for showing a live wallpaper behind applications that would like to sit on top of it.   

*** ** * ** ***

Proxying implementation of Context that simply delegates all of its calls to
another Context. Can be subclassed to modify behavior without changing
the original Context.

## Summary

### Inherited constants

From class `https://developer.android.com/reference/android/content/Context` `https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ACCESSIBILITY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/accessibility/AccessibilityManager` for giving the user
feedback for UI events through the registered event listeners.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ACCOUNT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/accounts/AccountManager` for receiving intents at a
time of your choosing.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ACTIVITY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/ActivityManager` for interacting with the global
system state.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ADVANCED_PROTECTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/security/advancedprotection/AdvancedProtectionManager`


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ALARM_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/AlarmManager` for receiving intents at a
time of your choosing.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#APPWIDGET_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/appwidget/AppWidgetManager` for accessing AppWidgets.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#APP_FUNCTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/app/appfunctions/AppFunctionManager` for
executing app functions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#APP_INTERACTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/app/AppInteractionManager` for managing app interactions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#APP_OPS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/AppOpsManager` for tracking application operations
on the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#APP_SEARCH_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/app/appsearch/AppSearchManager` for
indexing and querying app data managed by the system.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#AUDIO_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/AudioManager` for handling management of volume,
ringer modes and audio routing.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#AUTHENTICATION_POLICY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an `https://developer.android.com/reference/android/security/authenticationpolicy/AuthenticationPolicyManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#AUTOFILL_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/view/autofill/AutofillManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#BATTERY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/BatteryManager` for managing battery state.


`int` `https://developer.android.com/reference/android/content/Context#BIND_ABOVE_CLIENT`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: indicates that the client application
binding to this service considers the service to be more important than
the app itself.


`int` `https://developer.android.com/reference/android/content/Context#BIND_ADJUST_WITH_ACTIVITY`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: If binding from an activity, allow the
target service's process importance to be raised based on whether the
activity is visible to the user, regardless whether another flag is
used to reduce the amount that the client process's overall importance
is used to impact it.


`int` `https://developer.android.com/reference/android/content/Context#BIND_ALLOW_ACTIVITY_STARTS`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: If binding from an app that is visible, the bound service is
allowed to start an activity from background.


`int` `https://developer.android.com/reference/android/content/Context#BIND_ALLOW_OOM_MANAGEMENT`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: allow the process hosting the bound
service to go through its normal memory management.


`int` `https://developer.android.com/reference/android/content/Context#BIND_AUTO_CREATE`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: automatically create the service as long
as the binding exists.


`int` `https://developer.android.com/reference/android/content/Context#BIND_DEBUG_UNBIND`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: include debugging help for mismatched
calls to unbind.


`int` `https://developer.android.com/reference/android/content/Context#BIND_EXTERNAL_SERVICE`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: The service being bound is an
`https://developer.android.com/reference/android/R.attr#isolatedProcess`,
`https://developer.android.com/reference/android/R.attr#externalService` service.


`long` `https://developer.android.com/reference/android/content/Context#BIND_EXTERNAL_SERVICE_LONG`

Works in the same way as `https://developer.android.com/reference/android/content/Context#BIND_EXTERNAL_SERVICE`, but it's defined as a `long`
value that is compatible to `https://developer.android.com/reference/android/content/Context.BindServiceFlags`.


`int` `https://developer.android.com/reference/android/content/Context#BIND_IMPORTANT`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: this service is very important to
the client, so should be brought to the foreground process level
when the client is.


`int` `https://developer.android.com/reference/android/content/Context#BIND_INCLUDE_CAPABILITIES`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: If binding from an app that has specific capabilities
due to its foreground state such as an activity or foreground service, then this flag will
allow the bound app to get the same capabilities, as long as it has the required permissions
as well.


`int` `https://developer.android.com/reference/android/content/Context#BIND_NOT_FOREGROUND`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: don't allow this binding to raise
the target service's process to the foreground scheduling priority.


`int` `https://developer.android.com/reference/android/content/Context#BIND_NOT_PERCEPTIBLE`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: If binding from an app that is visible or user-perceptible,
lower the target service's importance to below the perceptible level.


`int` `https://developer.android.com/reference/android/content/Context#BIND_PACKAGE_ISOLATED_PROCESS`

Flag for `https://developer.android.com/reference/android/content/Context#bindIsolatedService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: Bind the service into a shared isolated process,
but only with other isolated services from the same package that declare the same process
name.


`int` `https://developer.android.com/reference/android/content/Context#BIND_SHARED_ISOLATED_PROCESS`

Flag for `https://developer.android.com/reference/android/content/Context#bindIsolatedService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: Bind the service into a shared isolated process.


`int` `https://developer.android.com/reference/android/content/Context#BIND_WAIVE_PRIORITY`

Flag for `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: don't impact the scheduling or
memory management priority of the target service's hosting process.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#BIOMETRIC_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/biometrics/BiometricManager` for handling
biometric and PIN/pattern/password authentication.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#BLOB_STORE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/blob/BlobStoreManager` for contributing and accessing data blobs
from the blob store maintained by the system.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#BLUETOOTH_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/bluetooth/BluetoothManager` for using Bluetooth.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#BUGREPORT_SERVICE`

Service to capture a bugreport.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CAMERA_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/camera2/CameraManager` for interacting with
camera devices.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CAPTIONING_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/accessibility/CaptioningManager` for obtaining
captioning properties and listening for changes in captioning
preferences.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CARRIER_CONFIG_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/CarrierConfigManager` for reading carrier configuration values.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CHOOSER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/service/chooser/ChooserManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CLIPBOARD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/ClipboardManager` for accessing and modifying
the contents of the global clipboard.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#COMPANION_DEVICE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/companion/CompanionDeviceManager` for managing companion devices


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CONNECTIVITY_DIAGNOSTICS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/ConnectivityDiagnosticsManager` for performing network connectivity diagnostics
as well as receiving network connectivity information from the system.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CONNECTIVITY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/ConnectivityManager` for handling management of
network connections.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CONSUMER_IR_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/ConsumerIrManager` for transmitting infrared
signals from the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CONTACT_KEYS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/provider/E2eeContactKeysManager` to managing contact keys.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CONTENT_RESTRICTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/contentsafety/ContentSafetyManager`.


`int` `https://developer.android.com/reference/android/content/Context#CONTEXT_IGNORE_SECURITY`

Flag for use with `https://developer.android.com/reference/android/content/Context#createPackageContext(java.lang.String,%20int)`: ignore any security
restrictions on the Context being requested, allowing it to always
be loaded.


`int` `https://developer.android.com/reference/android/content/Context#CONTEXT_INCLUDE_CODE`

Flag for use with `https://developer.android.com/reference/android/content/Context#createPackageContext(java.lang.String,%20int)`: include the application
code with the context.


`int` `https://developer.android.com/reference/android/content/Context#CONTEXT_RESTRICTED`

Flag for use with `https://developer.android.com/reference/android/content/Context#createPackageContext(java.lang.String,%20int)`: a restricted context may
disable specific features.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CREDENTIAL_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/credentials/CredentialManager` to authenticate a user to your app.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#CROSS_PROFILE_APPS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/pm/CrossProfileApps` for cross profile operations.


`int` `https://developer.android.com/reference/android/content/Context#DEVICE_ID_DEFAULT`

The default device ID, which is the ID of the primary (non-virtual) device.


`int` `https://developer.android.com/reference/android/content/Context#DEVICE_ID_INVALID`

Invalid device ID.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DEVICE_LOCK_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/devicelock/DeviceLockManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DEVICE_POLICY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/admin/DevicePolicyManager` for working with global
device policy management.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DISPLAY_HASH_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to access
`https://developer.android.com/reference/android/view/displayhash/DisplayHashManager` to handle display hashes.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DISPLAY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/display/DisplayManager` for interacting with display devices.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DOMAIN_VERIFICATION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to access
`https://developer.android.com/reference/android/content/pm/verify/domain/DomainVerificationManager` to retrieve approval and
user state for declared web domains.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DOWNLOAD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/DownloadManager` for requesting HTTP downloads.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#DROPBOX_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/DropBoxManager` instance for recording
diagnostic logs.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#EUICC_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/euicc/EuiccManager` to manage the device eUICC (embedded SIM).


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#FILE_INTEGRITY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/security/FileIntegrityManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#FILE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/storage/FileManager` for handling file operations.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#GAME_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/GameManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#GRAMMATICAL_INFLECTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/GrammaticalInflectionManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#HARDWARE_PROPERTIES_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/HardwarePropertiesManager` for accessing the hardware properties service.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#HEALTHCONNECT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/health/connect/HealthConnectManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#HID_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/hid/HidManager` for interacting with HID devices.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#INPUT_METHOD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/inputmethod/InputMethodManager` for accessing input
methods.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#INPUT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/hardware/input/InputManager` for interacting with input devices.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#IPSEC_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/net/IpSecManager` for encrypting Sockets or Networks with
IPSec.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#JOB_SCHEDULER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/job/JobScheduler` instance for managing occasional
background tasks.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#KEYCHAIN_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/security/KeyChainManager` for managing KeyChain certificates and grants.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#KEYGUARD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/KeyguardManager` for controlling keyguard.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#KEYSTORE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/security/keystore/KeyStoreManager` for accessing
[Android Keystore](https://developer.android.com/privacy-and-security/keystore)
functions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#LAUNCHER_APPS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/pm/LauncherApps` for querying and monitoring launchable apps across
profiles of a user.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#LAYOUT_INFLATER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/LayoutInflater` for inflating layout resources in this
context.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#LOCALE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/LocaleManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#LOCATION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/location/LocationManager` for controlling location
updates.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_COMMUNICATION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/MediaCommunicationManager`
for managing `https://developer.android.com/reference/android/media/MediaSession2`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_METRICS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/metrics/MediaMetricsManager` for interacting with media metrics
on the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_PROJECTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/media/projection/MediaProjectionManager` instance for managing
media projection sessions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_QUALITY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/quality/MediaQualityManager` for standardize picture
and audio API parameters.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_ROUTER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.Class<T>)` to retrieve a
`https://developer.android.com/reference/android/media/MediaRouter` for controlling and managing
routing of media.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEDIA_SESSION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/session/MediaSessionManager` for managing media Sessions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MEMORY_BUDGET_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/MemoryBudgetManager` for monitoring memory budgets.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MIDI_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/midi/MidiManager` for accessing the MIDI service.


`int` `https://developer.android.com/reference/android/content/Context#MODE_APPEND`

File creation mode: for use with `https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)`, if the file
already exists then write data to the end of the existing file
instead of erasing it.


`int` `https://developer.android.com/reference/android/content/Context#MODE_ENABLE_WRITE_AHEAD_LOGGING`

Database open flag: when set, the database is opened with write-ahead
logging enabled by default.


`int` `https://developer.android.com/reference/android/content/Context#MODE_MULTI_PROCESS`

*This constant was deprecated
in API level 23.
MODE_MULTI_PROCESS does not work reliably in
some versions of Android, and furthermore does not provide any
mechanism for reconciling concurrent modifications across
processes. Applications should not attempt to use it. Instead,
they should use an explicit cross-process data management
approach such as `https://developer.android.com/reference/android/content/ContentProvider`.*


`int` `https://developer.android.com/reference/android/content/Context#MODE_NO_LOCALIZED_COLLATORS`

Database open flag: when set, the database is opened without support for
localized collators.


`int` `https://developer.android.com/reference/android/content/Context#MODE_PRIVATE`

File creation mode: the default mode, where the created file can only
be accessed by the calling application (or all applications sharing the
same user ID).


`int` `https://developer.android.com/reference/android/content/Context#MODE_WORLD_READABLE`

*This constant was deprecated
in API level 17.
Creating world-readable files is very dangerous, and likely
to cause security holes in applications. It is strongly
discouraged; instead, applications should use more formal
mechanism for interactions such as `https://developer.android.com/reference/android/content/ContentProvider`,
`https://developer.android.com/reference/android/content/BroadcastReceiver`, and `https://developer.android.com/reference/android/app/Service`.
There are no guarantees that this access mode will remain on
a file, such as when it goes through a backup and restore.*


`int` `https://developer.android.com/reference/android/content/Context#MODE_WORLD_WRITEABLE`

*This constant was deprecated
in API level 17.
Creating world-writable files is very dangerous, and likely
to cause security holes in applications. It is strongly
discouraged; instead, applications should use more formal
mechanism for interactions such as `https://developer.android.com/reference/android/content/ContentProvider`,
`https://developer.android.com/reference/android/content/BroadcastReceiver`, and `https://developer.android.com/reference/android/app/Service`.
There are no guarantees that this access mode will remain on
a file, such as when it goes through a backup and restore.*


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#MULTISENSORY_MANAGER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve the service that plays multisensory
feedback.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#NETWORK_STATS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/usage/NetworkStatsManager` for querying network usage stats.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#NFC_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/nfc/NfcManager` for using NFC.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#NOTIFICATION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/NotificationManager` for informing the user of
background events.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#NPU_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#NSD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/nsd/NsdManager` for handling management of network service
discovery


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#OVERLAY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/content/om/OverlayManager` for managing overlay packages.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PCC_SANDBOX_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/privatecompute/PccSandboxManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PEOPLE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to access a `https://developer.android.com/reference/android/app/people/PeopleManager` to interact
with your published conversations.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PERFORMANCE_HINT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/PerformanceHintManager` for accessing the performance hinting service.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PERSISTENT_DATA_BLOCK_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/service/persistentdata/PersistentDataBlockManager` instance
for interacting with a storage device that lives across factory resets.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#POWER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/PowerManager` for controlling power management,
including "wake locks," which let you keep the device on while
you're running long tasks.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PRINT_SERVICE`

`https://developer.android.com/reference/android/print/PrintManager` for printing and managing
printers and print tasks.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#PROFILING_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/os/ProfilingManager`.


`int` `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED`

Flag for `https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)`: The receiver can receive broadcasts from other Apps.


`int` `https://developer.android.com/reference/android/content/Context#RECEIVER_NOT_EXPORTED`

Flag for `https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)`: The receiver cannot receive broadcasts from other Apps.


`int` `https://developer.android.com/reference/android/content/Context#RECEIVER_VISIBLE_TO_INSTANT_APPS`

Flag for `https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)`: The receiver can receive broadcasts from Instant Apps.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#RESTRICTIONS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/RestrictionsManager` for retrieving application restrictions
and requesting permissions for restricted operations.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#ROLE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/role/RoleManager`
for managing roles.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SATELLITE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/satellite/SatelliteManager` for accessing satellite functionality.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SEARCH_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/SearchManager` for handling searches.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SECURITY_STATE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/SecurityStateManager` for accessing the security state manager service.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SENSOR_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/hardware/SensorManager` for accessing sensors.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SERIAL_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/hardware/serial/SerialManager` for access to serial ports.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SHORTCUT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/pm/ShortcutManager` for accessing the launcher shortcut service.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#STATUS_BAR_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/StatusBarManager` for interacting with the status bar and quick settings.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#STORAGE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/os/storage/StorageManager` for accessing system storage
functions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#STORAGE_STATS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/usage/StorageStatsManager` for accessing system storage
statistics.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#SYSTEM_HEALTH_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/health/SystemHealthManager` for accessing system health (battery, power,
memory, etc) metrics.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TELECOM_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telecom/TelecomManager` to manage telecom-related features
of the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TELEPHONY_IMS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve an
`https://developer.android.com/reference/android/telephony/ims/ImsManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TELEPHONY_PHONE_NUMBER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/PhoneNumberManager` for parsing phone numbers.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TELEPHONY_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/TelephonyManager` for handling management the
telephony features of the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TELEPHONY_SUBSCRIPTION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/telephony/SubscriptionManager` for handling management the
telephony subscriptions of the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TETHERING_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/TetheringManager`
for managing tethering functions.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TEXT_CLASSIFICATION_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/textclassifier/TextClassificationManager` for text classification services.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TEXT_SERVICES_MANAGER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/textservice/TextServicesManager` for accessing
text services.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TIME_MANAGER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/time/TimeManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TV_AD_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/tv/ad/TvAdManager` for interacting with TV client-side advertisement
services on the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TV_INPUT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/tv/TvInputManager` for interacting with TV inputs
on the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#TV_INTERACTIVE_APP_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/media/tv/interactive/TvInteractiveAppManager` for interacting with TV
interactive applications on the device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#UI_MODE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/app/UiModeManager` for controlling UI modes.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#USAGE_STATS_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/app/usage/UsageStatsManager` for querying device usage stats.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#USB_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/hardware/usb/UsbManager` for access to USB devices (as a USB host)
and for controlling this device's behavior as a USB device.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#USER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/os/UserManager` for managing users on devices that support multiple users.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#VIBRATOR_MANAGER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/os/VibratorManager`
for accessing the device vibrators, interacting with individual ones and playing synchronized
effects on multiple vibrators.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#VIBRATOR_SERVICE`

*This constant was deprecated
in API level 31.
Use `https://developer.android.com/reference/android/os/VibratorManager` to retrieve the default system vibrator.*


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#VIRTUAL_DEVICE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/companion/virtual/VirtualDeviceManager` for managing virtual devices.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#VPN_MANAGEMENT_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/VpnManager` to
manage profiles for the platform built-in VPN.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WALLPAPER_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
com.android.server.WallpaperService for accessing wallpapers.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WEB_APP_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/content/pm/webapp/WebAppManager`.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WIFI_AWARE_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/net/wifi/aware/WifiAwareManager` for handling management of
Wi-Fi Aware.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WIFI_P2P_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager` for handling management of
Wi-Fi peer-to-peer connections.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WIFI_RTT_RANGING_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/wifi/rtt/WifiRttManager` for ranging devices with wifi.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WIFI_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a `https://developer.android.com/reference/android/net/wifi/WifiManager` for handling management of
Wi-Fi access.


`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/content/Context#WINDOW_SERVICE`

Use with `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` to retrieve a
`https://developer.android.com/reference/android/view/WindowManager` for accessing the system's window
manager.


| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/content/ContextWrapper#ContextWrapper(android.content.Context)(https://developer.android.com/reference/android/content/Context base) ` |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#bindIsolatedService(android.content.Intent,%20int,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, int flags, https://developer.android.com/reference/java/lang/String instanceName, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn) ` Variation of `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` that, in the specific case of isolated services, allows the caller to generate multiple instances of a service from a single component declaration. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#bindService(android.content.Intent,%20int,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, int flags, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn) ` Same as `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)` with executor to control ServiceConnection callbacks. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#bindService(android.content.Intent,%20android.content.ServiceConnection,%20android.content.Context.BindServiceFlags)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags) ` See `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)` Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, int flags) ` Connects to an application service, creating it if needed. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn) ` See `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20int,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20int,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, int flags, https://developer.android.com/reference/android/os/UserHandle user) ` Binds to a service in the given `user` in the same manner as `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20android.content.Context.BindServiceFlags,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags, https://developer.android.com/reference/android/os/UserHandle user) ` See `https://developer.android.com/reference/android/content/Context#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20int,%20android.os.UserHandle)` Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object. |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkCallingOrSelfPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission) ` Determine whether the calling process of an IPC *or you* have been granted a particular permission. |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkCallingOrSelfUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags) ` Determine whether the calling process of an IPC *or you* has been granted permission to access a specific URI. |
| ` int[]` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkCallingOrSelfUriPermissions(java.util.List<android.net.Uri>,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int modeFlags) ` Determine whether the calling process of an IPC *or you* has been granted permission to access a list of URIs. |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkCallingPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission) ` Determine whether the calling process of an IPC you are handling has been granted a particular permission. |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkCallingUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags) ` Determine whether the calling process and uid has been granted permission to access a specific URI. |
| ` int[]` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkCallingUriPermissions(java.util.List<android.net.Uri>,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int modeFlags) ` Determine whether the calling process and uid has been granted permission to access a list of URIs. |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkContentUriPermissionFull(android.net.Uri,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags) ` Determine whether a particular process and uid has been granted permission to access a specific content URI. |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkPermission(java.lang.String,%20int,%20int)(https://developer.android.com/reference/java/lang/String permission, int pid, int uid) ` Determine whether the given permission is allowed for a particular process and user ID running in the system. |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkSelfPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission) ` Determine whether *you* have been granted a particular permission. |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkUriPermission(android.net.Uri,%20java.lang.String,%20java.lang.String,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/java/lang/String readPermission, https://developer.android.com/reference/java/lang/String writePermission, int pid, int uid, int modeFlags) ` Check both a Uri and normal permission. |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkUriPermission(android.net.Uri,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags) ` Determine whether a particular process and uid has been granted permission to access a specific URI. |
| ` int[]` | ` https://developer.android.com/reference/android/content/ContextWrapper#checkUriPermissions(java.util.List<android.net.Uri>,%20int,%20int,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int pid, int uid, int modeFlags) ` Determine whether a particular process and uid has been granted permission to access a list of URIs. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#clearWallpaper()() ` *This method is deprecated. Use `https://developer.android.com/reference/android/app/WallpaperManager#clear()` instead.* *This method requires the caller to hold the permission `https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.* |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#createAttributionContext(java.lang.String)(https://developer.android.com/reference/java/lang/String attributionTag) ` Return a new Context object for the current Context but attribute to a different tag. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#createConfigurationContext(android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/Configuration overrideConfiguration) ` Return a new Context object for the current Context but whose resources are adjusted to match the given Configuration. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#createContext(android.content.ContextParams)(https://developer.android.com/reference/android/content/ContextParams contextParams) ` Creates a context with specific properties and behaviors. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#createContextForSplit(java.lang.String)(https://developer.android.com/reference/java/lang/String splitName) ` Return a new Context object for the given split name. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#createDeviceContext(int)(int deviceId) ` Returns a new `Context` object from the current context but with device association given by the `deviceId`. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#createDeviceProtectedStorageContext()() ` Return a new Context object for the current Context but whose storage APIs are backed by device-protected storage. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#createDisplayContext(android.view.Display)(https://developer.android.com/reference/android/view/Display display) ` Returns a new `Context` object from the current context but with resources adjusted to match the metrics of `display`. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#createPackageContext(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String packageName, int flags) ` Return a new Context object for the given application name. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#createWindowContext(int,%20android.os.Bundle)(int type, https://developer.android.com/reference/android/os/Bundle options) ` Creates a Context for a non-activity window. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#createWindowContext(android.view.Display,%20int,%20android.os.Bundle)(https://developer.android.com/reference/android/view/Display display, int type, https://developer.android.com/reference/android/os/Bundle options) ` Creates a `Context` for a non-`https://developer.android.com/reference/android/app/Activity` window on the given `https://developer.android.com/reference/android/view/Display`. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/ContextWrapper#databaseList()() ` Returns an array of strings naming the private databases associated with this Context's application package. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#deleteDatabase(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Delete an existing private SQLiteDatabase associated with this Context's application package. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#deleteFile(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Delete the given private file associated with this Context's application package. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#deleteSharedPreferences(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Delete an existing shared preferences file. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#enforceCallingOrSelfPermission(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, https://developer.android.com/reference/java/lang/String message) ` If neither you nor the calling process of an IPC you are handling has been granted a particular permission, throw a `https://developer.android.com/reference/java/lang/SecurityException`. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#enforceCallingOrSelfUriPermission(android.net.Uri,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags, https://developer.android.com/reference/java/lang/String message) ` If the calling process of an IPC *or you* has not been granted permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#enforceCallingPermission(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, https://developer.android.com/reference/java/lang/String message) ` If the calling process of an IPC you are handling has not been granted a particular permission, throw a `https://developer.android.com/reference/java/lang/SecurityException`. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#enforceCallingUriPermission(android.net.Uri,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags, https://developer.android.com/reference/java/lang/String message) ` If the calling process and uid has not been granted permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#enforcePermission(java.lang.String,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, int pid, int uid, https://developer.android.com/reference/java/lang/String message) ` If the given permission is not allowed for a particular process and user ID running in the system, throw a `https://developer.android.com/reference/java/lang/SecurityException`. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#enforceUriPermission(android.net.Uri,%20java.lang.String,%20java.lang.String,%20int,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/java/lang/String readPermission, https://developer.android.com/reference/java/lang/String writePermission, int pid, int uid, int modeFlags, https://developer.android.com/reference/java/lang/String message) ` Enforce both a Uri and normal permission. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#enforceUriPermission(android.net.Uri,%20int,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags, https://developer.android.com/reference/java/lang/String message) ` If a particular process and uid has not been granted permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/ContextWrapper#fileList()() ` Returns an array of strings naming the private files associated with this Context's application package. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#getApplicationContext()() ` Return the context of the single, global Application object of the current process. |
| ` https://developer.android.com/reference/android/content/pm/ApplicationInfo` | ` https://developer.android.com/reference/android/content/ContextWrapper#getApplicationInfo()() ` Return the full application info for this context's package. |
| ` https://developer.android.com/reference/android/content/res/AssetManager` | ` https://developer.android.com/reference/android/content/ContextWrapper#getAssets()() ` Returns an AssetManager instance for the application's package. |
| ` https://developer.android.com/reference/android/content/AttributionSource` | ` https://developer.android.com/reference/android/content/ContextWrapper#getAttributionSource()() ` |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/ContextWrapper#getAttributionTag()() ` <br /> Attribution can be used in complex apps to logically separate parts of the app. |
| ` https://developer.android.com/reference/android/content/Context` | ` https://developer.android.com/reference/android/content/ContextWrapper#getBaseContext()() ` |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getCacheDir()() ` Returns the absolute path to the application specific cache directory on the filesystem. |
| ` https://developer.android.com/reference/java/lang/ClassLoader` | ` https://developer.android.com/reference/android/content/ContextWrapper#getClassLoader()() ` Return a class loader you can use to retrieve classes in this package. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getCodeCacheDir()() ` Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code. |
| ` https://developer.android.com/reference/android/content/ContentResolver` | ` https://developer.android.com/reference/android/content/ContextWrapper#getContentResolver()() ` Return a ContentResolver instance for your application's package. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getDataDir()() ` Returns the absolute path to the directory on the filesystem where all private files belonging to this app are stored. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getDatabasePath(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Returns the absolute path on the filesystem where a database created with `https://developer.android.com/reference/android/content/Context#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory)` is stored. |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#getDeviceId()() ` Gets the device ID this context is associated with. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getDir(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode) ` Retrieve, creating if needed, a new directory in which the application can place its own custom data files. |
| ` https://developer.android.com/reference/android/view/Display` | ` https://developer.android.com/reference/android/content/ContextWrapper#getDisplay()() ` Get the display this context is associated with. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getExternalCacheDir()() ` Returns absolute path to application-specific directory on the primary shared/external storage device where the application can place cache files it owns. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getExternalCacheDirs()() ` Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place cache files it owns. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getExternalFilesDir(java.lang.String)(https://developer.android.com/reference/java/lang/String type) ` Returns the absolute path to the directory on the primary shared/external storage device where the application can place persistent files it owns. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getExternalFilesDirs(java.lang.String)(https://developer.android.com/reference/java/lang/String type) ` Returns absolute paths to application-specific directories on all shared/external storage devices where the application can place persistent files it owns. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getExternalMediaDirs()() ` *This method is deprecated. These directories still exist and are scanned, but developers are encouraged to migrate to inserting content into a `https://developer.android.com/reference/android/provider/MediaStore` collection directly, as any app can contribute new media to `https://developer.android.com/reference/android/provider/MediaStore` with no permissions required, starting in `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q`.* |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getFileStreamPath(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Returns the absolute path on the filesystem where a file created with `https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)` is stored. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getFilesDir()() ` Returns the absolute path to the directory on the filesystem where files created with `https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)` are stored. |
| ` https://developer.android.com/reference/java/util/concurrent/Executor` | ` https://developer.android.com/reference/android/content/ContextWrapper#getMainExecutor()() ` Return an `https://developer.android.com/reference/java/util/concurrent/Executor` that will run enqueued tasks on the main thread associated with this context. |
| ` https://developer.android.com/reference/android/os/Looper` | ` https://developer.android.com/reference/android/content/ContextWrapper#getMainLooper()() ` Return the Looper for the main thread of the current process. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getNoBackupFilesDir()() ` Returns the absolute path to the directory on the filesystem similar to `https://developer.android.com/reference/android/content/Context#getFilesDir()`. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getObbDir()() ` Return the primary shared/external storage directory where this application's OBB files (if there are any) can be found. |
| ` https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/android/content/ContextWrapper#getObbDirs()() ` Returns absolute paths to application-specific directories on all shared/external storage devices where the application's OBB files (if there are any) can be found. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/ContextWrapper#getOpPackageName()() ` Return the package name that should be used for `https://developer.android.com/reference/android/app/AppOpsManager` calls from this context, so that app ops manager's uid verification will work with the name. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/ContextWrapper#getPackageCodePath()() ` Return the full path to this context's primary Android package. |
| ` https://developer.android.com/reference/android/content/pm/PackageManager` | ` https://developer.android.com/reference/android/content/ContextWrapper#getPackageManager()() ` Return PackageManager instance to find global package information. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/ContextWrapper#getPackageName()() ` Return the name of this application's package. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/ContextWrapper#getPackageResourcePath()() ` Return the full path to this context's primary Android package. |
| ` https://developer.android.com/reference/android/content/ContextParams` | ` https://developer.android.com/reference/android/content/ContextWrapper#getParams()() ` Return the set of parameters which this Context was created with, if it was created via `https://developer.android.com/reference/android/content/Context#createContext(android.content.ContextParams)`. |
| ` https://developer.android.com/reference/android/content/res/Resources` | ` https://developer.android.com/reference/android/content/ContextWrapper#getResources()() ` Returns a Resources instance for the application's package. |
| ` https://developer.android.com/reference/android/content/SharedPreferences` | ` https://developer.android.com/reference/android/content/ContextWrapper#getSharedPreferences(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode) ` Retrieve and hold the contents of the preferences file 'name', returning a SharedPreferences through which you can retrieve and modify its values. |
| ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/android/content/ContextWrapper#getSystemService(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Return the handle to a system-level service by name. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/ContextWrapper#getSystemServiceName(java.lang.Class<?>)(https://developer.android.com/reference/java/lang/Class<?> serviceClass) ` Gets the name of the system-level service that is represented by the specified class. |
| ` https://developer.android.com/reference/android/content/res/Resources.Theme` | ` https://developer.android.com/reference/android/content/ContextWrapper#getTheme()() ` Return the Theme object associated with this Context. |
| ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/content/ContextWrapper#getWallpaper()() ` *This method is deprecated. Use `https://developer.android.com/reference/android/app/WallpaperManager#getDrawable()` instead.* |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#getWallpaperDesiredMinimumHeight()() ` *This method is deprecated. Use `https://developer.android.com/reference/android/app/WallpaperManager#getDesiredMinimumHeight()` instead.* |
| ` int` | ` https://developer.android.com/reference/android/content/ContextWrapper#getWallpaperDesiredMinimumWidth()() ` *This method is deprecated. Use `https://developer.android.com/reference/android/app/WallpaperManager#getDesiredMinimumWidth()` instead.* |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)(https://developer.android.com/reference/java/lang/String toPackage, https://developer.android.com/reference/android/net/Uri uri, int modeFlags) ` Grant permission to access a specific Uri to another package, regardless of whether that package has general permission to access the Uri's content provider. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#isDeviceProtectedStorage()() ` Indicates if the storage APIs of this Context are backed by device-protected storage. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#isRestricted()() ` Indicates whether this Context is restricted. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#isUiContext()() ` Returns `true` if the context is a UI context which can access UI components such as `https://developer.android.com/reference/android/view/WindowManager`, `https://developer.android.com/reference/android/view/LayoutInflater` or `https://developer.android.com/reference/android/app/WallpaperManager`. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#moveDatabaseFrom(android.content.Context,%20java.lang.String)(https://developer.android.com/reference/android/content/Context sourceContext, https://developer.android.com/reference/java/lang/String name) ` Move an existing database file from the given source storage context to this context. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#moveSharedPreferencesFrom(android.content.Context,%20java.lang.String)(https://developer.android.com/reference/android/content/Context sourceContext, https://developer.android.com/reference/java/lang/String name) ` Move an existing shared preferences file from the given source storage context to this context. |
| ` https://developer.android.com/reference/java/io/FileInputStream` | ` https://developer.android.com/reference/android/content/ContextWrapper#openFileInput(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Open a private file associated with this Context's application package for reading. |
| ` https://developer.android.com/reference/java/io/FileOutputStream` | ` https://developer.android.com/reference/android/content/ContextWrapper#openFileOutput(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode) ` Open a private file associated with this Context's application package for writing. |
| ` https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase` | ` https://developer.android.com/reference/android/content/ContextWrapper#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory,%20android.database.DatabaseErrorHandler)(https://developer.android.com/reference/java/lang/String name, int mode, https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory factory, https://developer.android.com/reference/android/database/DatabaseErrorHandler errorHandler) ` Open a new private SQLiteDatabase associated with this Context's application package. |
| ` https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase` | ` https://developer.android.com/reference/android/content/ContextWrapper#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory)(https://developer.android.com/reference/java/lang/String name, int mode, https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory factory) ` Open a new private SQLiteDatabase associated with this Context's application package. |
| ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/content/ContextWrapper#peekWallpaper()() ` *This method is deprecated. Use `https://developer.android.com/reference/android/app/WallpaperManager#peekDrawable()` instead.* |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#rebindService(android.content.ServiceConnection,%20android.content.Context.BindServiceFlags)(https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags) ` Rebind an application service with updated bind service flags |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#registerComponentCallbacks(android.content.ComponentCallbacks)(https://developer.android.com/reference/android/content/ComponentCallbacks callback) ` Add a new `https://developer.android.com/reference/android/content/ComponentCallbacks` to the base application of the Context, which will be called at the same times as the ComponentCallbacks methods of activities and other components are called. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#registerDeviceIdChangeListener(java.util.concurrent.Executor,%20java.util.function.IntConsumer)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/IntConsumer listener) ` Adds a new device ID changed listener to the `Context`, which will be called when the device association is changed by the system. |
| ` https://developer.android.com/reference/android/content/Intent` | ` https://developer.android.com/reference/android/content/ContextWrapper#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter) ` Register a BroadcastReceiver to be run in the main activity thread. |
| ` https://developer.android.com/reference/android/content/Intent` | ` https://developer.android.com/reference/android/content/ContextWrapper#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20int)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, int flags) ` Register to receive intent broadcasts, with the receiver optionally being exposed to Instant Apps. |
| ` https://developer.android.com/reference/android/content/Intent` | ` https://developer.android.com/reference/android/content/ContextWrapper#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler,%20int)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, https://developer.android.com/reference/java/lang/String broadcastPermission, https://developer.android.com/reference/android/os/Handler scheduler, int flags) ` Register to receive intent broadcasts, to run in the context of <var translate="no">scheduler</var>. |
| ` https://developer.android.com/reference/android/content/Intent` | ` https://developer.android.com/reference/android/content/ContextWrapper#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, https://developer.android.com/reference/java/lang/String broadcastPermission, https://developer.android.com/reference/android/os/Handler scheduler) ` Register to receive intent broadcasts, to run in the context of <var translate="no">scheduler</var>. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#removeStickyBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent) ` *This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that *something* has changed, with another mechanism for apps to retrieve the current value whenever desired.* |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#removeStickyBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user) ` *This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that *something* has changed, with another mechanism for apps to retrieve the current value whenever desired.* |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#revokeSelfPermissionsOnKill(java.util.Collection<java.lang.String>)(https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/java/lang/String> permissions) ` Triggers the revocation of one or more permissions for the calling package. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#revokeUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags) ` Remove all permissions to access a particular content provider Uri that were previously added with `https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)` or *any other* mechanism. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#revokeUriPermission(java.lang.String,%20android.net.Uri,%20int)(https://developer.android.com/reference/java/lang/String targetPackage, https://developer.android.com/reference/android/net/Uri uri, int modeFlags) ` Remove permissions to access a particular content provider Uri that were previously added with `https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)` for a specific target package. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options) ` Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission) ` Broadcast the given intent to all interested BroadcastReceivers, allowing an optional required permission to be enforced. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent) ` Broadcast the given intent to all interested BroadcastReceivers. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user) ` Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to specify the user the broadcast will be sent to. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/java/lang/String receiverPermission) ` Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent,%20java.lang.String)` that allows you to specify the user the broadcast will be sent to. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/java/lang/String receiverAppOp, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras) ` Version of `https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)` that allows you to specify the App Op to enforce restrictions on which receivers the broadcast will be sent to. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20int,%20java.lang.String,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20java.lang.String,%20android.os.Bundle,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, int initialCode, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/java/lang/String receiverAppOp, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras, https://developer.android.com/reference/android/os/Bundle options) ` |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras) ` Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to receive data back from the broadcast. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options) ` Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras) ` Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to receive data back from the broadcast. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission) ` Broadcast the given intent to all interested BroadcastReceivers, delivering them one at a time to allow more preferred receivers to consume the broadcast before it is delivered to less preferred receivers. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendOrderedBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras) ` Version of `https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)` that allows you to specify the user the broadcast will be sent to. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendStickyBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent) ` *This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that *something* has changed, with another mechanism for apps to retrieve the current value whenever desired.* |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendStickyBroadcast(android.content.Intent,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/Bundle options) ` *This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that *something* has changed, with another mechanism for apps to retrieve the current value whenever desired.* |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendStickyBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user) ` *This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that *something* has changed, with another mechanism for apps to retrieve the current value whenever desired.* |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendStickyOrderedBroadcast(android.content.Intent,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras) ` *This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that *something* has changed, with another mechanism for apps to retrieve the current value whenever desired.* |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#sendStickyOrderedBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras) ` *This method is deprecated. Sticky broadcasts should not be used. They provide no security (anyone can access them), no protection (anyone can modify them), and many other problems. The recommended pattern is to use a non-sticky broadcast to report that *something* has changed, with another mechanism for apps to retrieve the current value whenever desired.* |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#setTheme(int)(int resid) ` Set the base theme for this context. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#setWallpaper(android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Bitmap bitmap) ` *This method is deprecated. Use `https://developer.android.com/reference/android/app/WallpaperManager#setBitmap(android.graphics.Bitmap)` instead.* *This method requires the caller to hold the permission `https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.* |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#setWallpaper(java.io.InputStream)(https://developer.android.com/reference/java/io/InputStream data) ` *This method is deprecated. Use `https://developer.android.com/reference/android/app/WallpaperManager#setStream(java.io.InputStream)` instead.* *This method requires the caller to hold the permission `https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.* |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#shouldShowRequestPermissionRationale(java.lang.String)(https://developer.android.com/reference/java/lang/String permission) ` Gets whether you should show UI with rationale before requesting a permission. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#startActivities(android.content.Intent[],%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intents, https://developer.android.com/reference/android/os/Bundle options) ` Launch multiple new activities. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#startActivities(android.content.Intent[])(https://developer.android.com/reference/android/content/Intent intents) ` Same as `https://developer.android.com/reference/android/content/Context#startActivities(android.content.Intent[],%20android.os.Bundle)` with no options specified. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#startActivity(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent) ` Same as `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)` with no options specified. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#startActivity(android.content.Intent,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/Bundle options) ` Launch a new activity. |
| ` https://developer.android.com/reference/android/content/ComponentName` | ` https://developer.android.com/reference/android/content/ContextWrapper#startForegroundService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent service) ` Similar to `https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)`, but with an implicit promise that the Service will call `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)` once it begins running. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#startInstrumentation(android.content.ComponentName,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/ComponentName className, https://developer.android.com/reference/java/lang/String profileFile, https://developer.android.com/reference/android/os/Bundle arguments) ` Start executing an `https://developer.android.com/reference/android/app/Instrumentation` class. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int)(https://developer.android.com/reference/android/content/IntentSender intent, https://developer.android.com/reference/android/content/Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags) ` Same as `https://developer.android.com/reference/android/content/Context#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle)` with no options specified. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle)(https://developer.android.com/reference/android/content/IntentSender intent, https://developer.android.com/reference/android/content/Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, https://developer.android.com/reference/android/os/Bundle options) ` Like `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)`, but taking a IntentSender to start. |
| ` https://developer.android.com/reference/android/content/ComponentName` | ` https://developer.android.com/reference/android/content/ContextWrapper#startService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent service) ` Request that a given application service be started. |
| ` boolean` | ` https://developer.android.com/reference/android/content/ContextWrapper#stopService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent name) ` Request that a given application service be stopped. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#unbindService(android.content.ServiceConnection)(https://developer.android.com/reference/android/content/ServiceConnection conn) ` Disconnect from an application service. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#unregisterComponentCallbacks(android.content.ComponentCallbacks)(https://developer.android.com/reference/android/content/ComponentCallbacks callback) ` Remove a `https://developer.android.com/reference/android/content/ComponentCallbacks` object that was previously registered with `https://developer.android.com/reference/android/content/ContextWrapper#registerComponentCallbacks(android.content.ComponentCallbacks)`. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#unregisterDeviceIdChangeListener(java.util.function.IntConsumer)(https://developer.android.com/reference/java/util/function/IntConsumer listener) ` Removes a device ID changed listener from the Context. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#unregisterReceiver(android.content.BroadcastReceiver)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver) ` Unregister a previously registered BroadcastReceiver. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#updateServiceBindings(java.util.Collection<android.content.Context.UpdateBindingParams>)(https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/android/content/Context.UpdateBindingParams> params) ` Perform a batch update of existing bindings. |
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#updateServiceGroup(android.content.ServiceConnection,%20int,%20int)(https://developer.android.com/reference/android/content/ServiceConnection conn, int group, int importance) ` For a service previously bound with `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` or a related method, change how the system manages that service's process in relation to other processes. |

| ### Protected methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/content/ContextWrapper#attachBaseContext(android.content.Context)(https://developer.android.com/reference/android/content/Context base) ` Set the base context for this ContextWrapper. |

### Inherited methods

From class `

https://developer.android.com/reference/android/content/Context

` `


boolean` `
https://developer.android.com/reference/android/content/Context#bindIsolatedService(android.content.Intent,%20int,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, int flags, https://developer.android.com/reference/java/lang/String instanceName, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn)
`

Variation of `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` that, in the specific case of isolated
services, allows the caller to generate multiple instances of a service
from a single component declaration.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindIsolatedService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags, https://developer.android.com/reference/java/lang/String instanceName, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn)
`

See `https://developer.android.com/reference/android/content/Context#bindIsolatedService(android.content.Intent,%20int,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20int,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, int flags, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn)
`

Same as `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)` with executor to control ServiceConnection
callbacks.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20android.content.Context.BindServiceFlags)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags)
`

See `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, int flags)
`

Connects to an application service, creating it if needed.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/content/ServiceConnection conn)
`

See `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20int,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20int,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, int flags, https://developer.android.com/reference/android/os/UserHandle user)
`

Binds to a service in the given `user` in the same manner as `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`.


`


boolean` `
https://developer.android.com/reference/android/content/Context#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20android.content.Context.BindServiceFlags,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent service, https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags, https://developer.android.com/reference/android/os/UserHandle user)
`

See `https://developer.android.com/reference/android/content/Context#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20int,%20android.os.UserHandle)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkCallingOrSelfPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Determine whether the calling process of an IPC *or you* have been
granted a particular permission.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkCallingOrSelfUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Determine whether the calling process of an IPC *or you* has been granted
permission to access a specific URI.


`


int[]` `
https://developer.android.com/reference/android/content/Context#checkCallingOrSelfUriPermissions(java.util.List<android.net.Uri>,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int modeFlags)
`

Determine whether the calling process of an IPC *or you* has been granted
permission to access a list of URIs.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkCallingPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Determine whether the calling process of an IPC you are handling has been
granted a particular permission.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkCallingUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Determine whether the calling process and uid has been
granted permission to access a specific URI.


`


int[]` `
https://developer.android.com/reference/android/content/Context#checkCallingUriPermissions(java.util.List<android.net.Uri>,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int modeFlags)
`

Determine whether the calling process and uid has been
granted permission to access a list of URIs.


`


int` `
https://developer.android.com/reference/android/content/Context#checkContentUriPermissionFull(android.net.Uri,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags)
`

Determine whether a particular process and uid has been granted
permission to access a specific content URI.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkPermission(java.lang.String,%20int,%20int)(https://developer.android.com/reference/java/lang/String permission, int pid, int uid)
`

Determine whether the given permission is allowed for a particular process and user ID
running in the system.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkSelfPermission(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Determine whether *you* have been granted a particular permission.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkUriPermission(android.net.Uri,%20java.lang.String,%20java.lang.String,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/java/lang/String readPermission, https://developer.android.com/reference/java/lang/String writePermission, int pid, int uid, int modeFlags)
`

Check both a Uri and normal permission.


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#checkUriPermission(android.net.Uri,%20int,%20int,%20int)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags)
`

Determine whether a particular process and uid has been granted
permission to access a specific URI.


`


int[]` `
https://developer.android.com/reference/android/content/Context#checkUriPermissions(java.util.List<android.net.Uri>,%20int,%20int,%20int)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/net/Uri> uris, int pid, int uid, int modeFlags)
`

Determine whether a particular process and uid has been granted
permission to access a list of URIs.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#clearWallpaper()()
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#clear()` instead.*

*This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.*


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createAttributionContext(java.lang.String)(https://developer.android.com/reference/java/lang/String attributionTag)
`

Return a new Context object for the current Context but attribute to a different tag.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createConfigurationContext(android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/Configuration overrideConfiguration)
`

Return a new Context object for the current Context but whose resources
are adjusted to match the given Configuration.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createContext(android.content.ContextParams)(https://developer.android.com/reference/android/content/ContextParams contextParams)
`

Creates a context with specific properties and behaviors.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createContextForSplit(java.lang.String)(https://developer.android.com/reference/java/lang/String splitName)
`

Return a new Context object for the given split name.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createDeviceContext(int)(int deviceId)
`

Returns a new `Context` object from the current context but with device association
given by the `deviceId`.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createDeviceProtectedStorageContext()()
`

Return a new Context object for the current Context but whose storage
APIs are backed by device-protected storage.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createDisplayContext(android.view.Display)(https://developer.android.com/reference/android/view/Display display)
`

Returns a new `Context` object from the current context but with resources
adjusted to match the metrics of `display`.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createPackageContext(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String packageName, int flags)
`

Return a new Context object for the given application name.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)(int type, https://developer.android.com/reference/android/os/Bundle options)
`

Creates a Context for a non-activity window.


`


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#createWindowContext(android.view.Display,%20int,%20android.os.Bundle)(https://developer.android.com/reference/android/view/Display display, int type, https://developer.android.com/reference/android/os/Bundle options)
`

Creates a `Context` for a non-`https://developer.android.com/reference/android/app/Activity` window on the given
`https://developer.android.com/reference/android/view/Display`.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#databaseList()()
`

Returns an array of strings naming the private databases associated with
this Context's application package.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#deleteDatabase(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Delete an existing private SQLiteDatabase associated with this Context's
application package.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#deleteFile(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Delete the given private file associated with this Context's
application package.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#deleteSharedPreferences(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Delete an existing shared preferences file.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceCallingOrSelfPermission(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, https://developer.android.com/reference/java/lang/String message)
`

If neither you nor the calling process of an IPC you are
handling has been granted a particular permission, throw a
`https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceCallingOrSelfUriPermission(android.net.Uri,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

If the calling process of an IPC *or you* has not been
granted permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceCallingPermission(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, https://developer.android.com/reference/java/lang/String message)
`

If the calling process of an IPC you are handling has not been
granted a particular permission, throw a `https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceCallingUriPermission(android.net.Uri,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

If the calling process and uid has not been granted
permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforcePermission(java.lang.String,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/java/lang/String permission, int pid, int uid, https://developer.android.com/reference/java/lang/String message)
`

If the given permission is not allowed for a particular process
and user ID running in the system, throw a `https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceUriPermission(android.net.Uri,%20java.lang.String,%20java.lang.String,%20int,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, https://developer.android.com/reference/java/lang/String readPermission, https://developer.android.com/reference/java/lang/String writePermission, int pid, int uid, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

Enforce both a Uri and normal permission.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#enforceUriPermission(android.net.Uri,%20int,%20int,%20int,%20java.lang.String)(https://developer.android.com/reference/android/net/Uri uri, int pid, int uid, int modeFlags, https://developer.android.com/reference/java/lang/String message)
`

If a particular process and uid has not been granted
permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#fileList()()
`

Returns an array of strings naming the private files associated with
this Context's application package.


`
abstract


https://developer.android.com/reference/android/content/Context` `
https://developer.android.com/reference/android/content/Context#getApplicationContext()()
`

Return the context of the single, global Application object of the
current process.


`
abstract


https://developer.android.com/reference/android/content/pm/ApplicationInfo` `
https://developer.android.com/reference/android/content/Context#getApplicationInfo()()
`

Return the full application info for this context's package.


`
abstract


https://developer.android.com/reference/android/content/res/AssetManager` `
https://developer.android.com/reference/android/content/Context#getAssets()()
`

Returns an AssetManager instance for the application's package.


`


https://developer.android.com/reference/android/content/AttributionSource` `
https://developer.android.com/reference/android/content/Context#getAttributionSource()()
` `


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getAttributionTag()()
`

<br />

Attribution can be used in complex apps to logically separate parts of the app.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getCacheDir()()
`

Returns the absolute path to the application specific cache directory on
the filesystem.


`
abstract


https://developer.android.com/reference/java/lang/ClassLoader` `
https://developer.android.com/reference/android/content/Context#getClassLoader()()
`

Return a class loader you can use to retrieve classes in this package.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getCodeCacheDir()()
`

Returns the absolute path to the application specific cache directory on
the filesystem designed for storing cached code.


`


final

int` `
https://developer.android.com/reference/android/content/Context#getColor(int)(int id)
`

Returns a color associated with a particular resource ID and styled for
the current theme.


`


final

https://developer.android.com/reference/android/content/res/ColorStateList` `
https://developer.android.com/reference/android/content/Context#getColorStateList(int)(int id)
`

Returns a color state list associated with a particular resource ID and
styled for the current theme.


`
abstract


https://developer.android.com/reference/android/content/ContentResolver` `
https://developer.android.com/reference/android/content/Context#getContentResolver()()
`

Return a ContentResolver instance for your application's package.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getDataDir()()
`

Returns the absolute path to the directory on the filesystem where all
private files belonging to this app are stored.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getDatabasePath(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Returns the absolute path on the filesystem where a database created with
`https://developer.android.com/reference/android/content/Context#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory)` is stored.


`


int` `
https://developer.android.com/reference/android/content/Context#getDeviceId()()
`

Gets the device ID this context is associated with.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getDir(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode)
`

Retrieve, creating if needed, a new directory in which the application
can place its own custom data files.


`


https://developer.android.com/reference/android/view/Display` `
https://developer.android.com/reference/android/content/Context#getDisplay()()
`

Get the display this context is associated with.


`


final

https://developer.android.com/reference/android/graphics/drawable/Drawable` `
https://developer.android.com/reference/android/content/Context#getDrawable(int)(int id)
`

Returns a drawable object associated with a particular resource ID and
styled for the current theme.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getExternalCacheDir()()
`

Returns absolute path to application-specific directory on the primary
shared/external storage device where the application can place cache
files it owns.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getExternalCacheDirs()()
`

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application can place cache
files it owns.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getExternalFilesDir(java.lang.String)(https://developer.android.com/reference/java/lang/String type)
`

Returns the absolute path to the directory on the primary shared/external
storage device where the application can place persistent files it owns.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getExternalFilesDirs(java.lang.String)(https://developer.android.com/reference/java/lang/String type)
`

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application can place
persistent files it owns.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getExternalMediaDirs()()
`

*This method was deprecated
in API level 30.
These directories still exist and are scanned, but developers
are encouraged to migrate to inserting content into a
`https://developer.android.com/reference/android/provider/MediaStore` collection directly, as any app can
contribute new media to `https://developer.android.com/reference/android/provider/MediaStore` with no
permissions required, starting in
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q`.*


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getFileStreamPath(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Returns the absolute path on the filesystem where a file created with
`https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)` is stored.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getFilesDir()()
`

Returns the absolute path to the directory on the filesystem where files
created with `https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)` are stored.


`


https://developer.android.com/reference/java/util/concurrent/Executor` `
https://developer.android.com/reference/android/content/Context#getMainExecutor()()
`

Return an `https://developer.android.com/reference/java/util/concurrent/Executor` that will run enqueued tasks on the main
thread associated with this context.


`
abstract


https://developer.android.com/reference/android/os/Looper` `
https://developer.android.com/reference/android/content/Context#getMainLooper()()
`

Return the Looper for the main thread of the current process.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getNoBackupFilesDir()()
`

Returns the absolute path to the directory on the filesystem similar to
`https://developer.android.com/reference/android/content/Context#getFilesDir()`.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getObbDir()()
`

Return the primary shared/external storage directory where this
application's OBB files (if there are any) can be found.


`
abstract


https://developer.android.com/reference/java/io/File` `
https://developer.android.com/reference/android/content/Context#getObbDirs()()
`

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application's OBB files (if
there are any) can be found.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getOpPackageName()()
`

Return the package name that should be used for `https://developer.android.com/reference/android/app/AppOpsManager` calls from
this context, so that app ops manager's uid verification will work with the name.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getPackageCodePath()()
`

Return the full path to this context's primary Android package.


`
abstract


https://developer.android.com/reference/android/content/pm/PackageManager` `
https://developer.android.com/reference/android/content/Context#getPackageManager()()
`

Return PackageManager instance to find global package information.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getPackageName()()
`

Return the name of this application's package.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getPackageResourcePath()()
`

Return the full path to this context's primary Android package.


`


https://developer.android.com/reference/android/content/ContextParams` `
https://developer.android.com/reference/android/content/Context#getParams()()
`

Return the set of parameters which this Context was created with, if it
was created via `https://developer.android.com/reference/android/content/Context#createContext(android.content.ContextParams)`.


`
abstract


https://developer.android.com/reference/android/content/res/Resources` `
https://developer.android.com/reference/android/content/Context#getResources()()
`

Returns a Resources instance for the application's package.


`
abstract


https://developer.android.com/reference/android/content/SharedPreferences` `
https://developer.android.com/reference/android/content/Context#getSharedPreferences(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode)
`

Retrieve and hold the contents of the preferences file 'name', returning
a SharedPreferences through which you can retrieve and modify its
values.


`


final

https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getString(int)(int resId)
`

Returns a localized string from the application's package's
default string table.


`


final

https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getString(int,%20java.lang.Object[])(int resId, https://developer.android.com/reference/java/lang/Object formatArgs)
`

Returns a localized formatted string from the application's package's
default string table, substituting the format arguments as defined in
`https://developer.android.com/reference/java/util/Formatter` and `https://developer.android.com/reference/java/lang/String#format(java.lang.String,%20java.lang.Object[])`.


`


final
<T>
T` `
https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.Class<T>)(https://developer.android.com/reference/java/lang/Class<T> serviceClass)
`

Return the handle to a system-level service by class.


`
abstract


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Return the handle to a system-level service by name.


`
abstract


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/android/content/Context#getSystemServiceName(java.lang.Class<?>)(https://developer.android.com/reference/java/lang/Class<?> serviceClass)
`

Gets the name of the system-level service that is represented by the specified class.


`


final

https://developer.android.com/reference/java/lang/CharSequence` `
https://developer.android.com/reference/android/content/Context#getText(int)(int resId)
`

Return a localized, styled CharSequence from the application's package's
default string table.


`
abstract


https://developer.android.com/reference/android/content/res/Resources.Theme` `
https://developer.android.com/reference/android/content/Context#getTheme()()
`

Return the Theme object associated with this Context.


`


https://developer.android.com/reference/android/content/Context.BindServiceFlags` `
https://developer.android.com/reference/android/content/Context#getUpdateableFlags()()
`

Gets the list of bind flags that may be updated (i.e.


`
abstract


https://developer.android.com/reference/android/graphics/drawable/Drawable` `
https://developer.android.com/reference/android/content/Context#getWallpaper()()
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#getDrawable()` instead.*


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#getWallpaperDesiredMinimumHeight()()
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#getDesiredMinimumHeight()` instead.*


`
abstract


int` `
https://developer.android.com/reference/android/content/Context#getWallpaperDesiredMinimumWidth()()
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#getDesiredMinimumWidth()` instead.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)(https://developer.android.com/reference/java/lang/String toPackage, https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Grant permission to access a specific Uri to another package, regardless
of whether that package has general permission to access the Uri's
content provider.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#isDeviceProtectedStorage()()
`

Indicates if the storage APIs of this Context are backed by
device-protected storage.


`


boolean` `
https://developer.android.com/reference/android/content/Context#isRestricted()()
`

Indicates whether this Context is restricted.


`


boolean` `
https://developer.android.com/reference/android/content/Context#isUiContext()()
`

Returns `true` if the context is a UI context which can access UI components such as
`https://developer.android.com/reference/android/view/WindowManager`, `https://developer.android.com/reference/android/view/LayoutInflater` or
`https://developer.android.com/reference/android/app/WallpaperManager`.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#moveDatabaseFrom(android.content.Context,%20java.lang.String)(https://developer.android.com/reference/android/content/Context sourceContext, https://developer.android.com/reference/java/lang/String name)
`

Move an existing database file from the given source storage context to
this context.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#moveSharedPreferencesFrom(android.content.Context,%20java.lang.String)(https://developer.android.com/reference/android/content/Context sourceContext, https://developer.android.com/reference/java/lang/String name)
`

Move an existing shared preferences file from the given source storage
context to this context.


`


final

https://developer.android.com/reference/android/content/res/TypedArray` `
https://developer.android.com/reference/android/content/Context#obtainStyledAttributes(android.util.AttributeSet,%20int[])(https://developer.android.com/reference/android/util/AttributeSet set, int[] attrs)
`

Retrieve styled attribute information in this Context's theme.


`


final

https://developer.android.com/reference/android/content/res/TypedArray` `
https://developer.android.com/reference/android/content/Context#obtainStyledAttributes(android.util.AttributeSet,%20int[],%20int,%20int)(https://developer.android.com/reference/android/util/AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes)
`

Retrieve styled attribute information in this Context's theme.


`


final

https://developer.android.com/reference/android/content/res/TypedArray` `
https://developer.android.com/reference/android/content/Context#obtainStyledAttributes(int,%20int[])(int resid, int[] attrs)
`

Retrieve styled attribute information in this Context's theme.


`


final

https://developer.android.com/reference/android/content/res/TypedArray` `
https://developer.android.com/reference/android/content/Context#obtainStyledAttributes(int[])(int[] attrs)
`

Retrieve styled attribute information in this Context's theme.


`
abstract


https://developer.android.com/reference/java/io/FileInputStream` `
https://developer.android.com/reference/android/content/Context#openFileInput(java.lang.String)(https://developer.android.com/reference/java/lang/String name)
`

Open a private file associated with this Context's application package
for reading.


`
abstract


https://developer.android.com/reference/java/io/FileOutputStream` `
https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)(https://developer.android.com/reference/java/lang/String name, int mode)
`

Open a private file associated with this Context's application package
for writing.


`
abstract


https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase` `
https://developer.android.com/reference/android/content/Context#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory,%20android.database.DatabaseErrorHandler)(https://developer.android.com/reference/java/lang/String name, int mode, https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory factory, https://developer.android.com/reference/android/database/DatabaseErrorHandler errorHandler)
`

Open a new private SQLiteDatabase associated with this Context's
application package.


`
abstract


https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase` `
https://developer.android.com/reference/android/content/Context#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory)(https://developer.android.com/reference/java/lang/String name, int mode, https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.CursorFactory factory)
`

Open a new private SQLiteDatabase associated with this Context's
application package.


`
abstract


https://developer.android.com/reference/android/graphics/drawable/Drawable` `
https://developer.android.com/reference/android/content/Context#peekWallpaper()()
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#peekDrawable()` instead.*


`


void` `
https://developer.android.com/reference/android/content/Context#rebindService(android.content.ServiceConnection,%20android.content.Context.BindServiceFlags)(https://developer.android.com/reference/android/content/ServiceConnection conn, https://developer.android.com/reference/android/content/Context.BindServiceFlags flags)
`

Rebind an application service with updated bind service flags


`


void` `
https://developer.android.com/reference/android/content/Context#registerComponentCallbacks(android.content.ComponentCallbacks)(https://developer.android.com/reference/android/content/ComponentCallbacks callback)
`

Add a new `https://developer.android.com/reference/android/content/ComponentCallbacks` to the base application of the
Context, which will be called at the same times as the ComponentCallbacks
methods of activities and other components are called.


`


void` `
https://developer.android.com/reference/android/content/Context#registerDeviceIdChangeListener(java.util.concurrent.Executor,%20java.util.function.IntConsumer)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/IntConsumer listener)
`

Adds a new device ID changed listener to the `Context`, which will be called when
the device association is changed by the system.


`
abstract


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter)
`

Register a BroadcastReceiver to be run in the main activity thread.


`
abstract


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20int)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, int flags)
`

Register to receive intent broadcasts, with the receiver optionally being
exposed to Instant Apps.


`
abstract


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler,%20int)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, https://developer.android.com/reference/java/lang/String broadcastPermission, https://developer.android.com/reference/android/os/Handler scheduler, int flags)
`

Register to receive intent broadcasts, to run in the context of
<var translate="no">scheduler</var>.


`
abstract


https://developer.android.com/reference/android/content/Intent` `
https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver, https://developer.android.com/reference/android/content/IntentFilter filter, https://developer.android.com/reference/java/lang/String broadcastPermission, https://developer.android.com/reference/android/os/Handler scheduler)
`

Register to receive intent broadcasts, to run in the context of
<var translate="no">scheduler</var>.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#removeStickyBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#removeStickyBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`


void` `
https://developer.android.com/reference/android/content/Context#revokeSelfPermissionOnKill(java.lang.String)(https://developer.android.com/reference/java/lang/String permName)
`

Triggers the asynchronous revocation of a runtime permission.


`


void` `
https://developer.android.com/reference/android/content/Context#revokeSelfPermissionsOnKill(java.util.Collection<java.lang.String>)(https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/java/lang/String> permissions)
`

Triggers the revocation of one or more permissions for the calling package.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#revokeUriPermission(android.net.Uri,%20int)(https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Remove all permissions to access a particular content provider Uri
that were previously added with `https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)` or *any other* mechanism.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#revokeUriPermission(java.lang.String,%20android.net.Uri,%20int)(https://developer.android.com/reference/java/lang/String toPackage, https://developer.android.com/reference/android/net/Uri uri, int modeFlags)
`

Remove permissions to access a particular content provider Uri
that were previously added with `https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)` for a specific target
package.


`


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options)
`

Broadcast the given intent to all interested BroadcastReceivers, allowing
an optional required permission to be enforced.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission)
`

Broadcast the given intent to all interested BroadcastReceivers, allowing
an optional required permission to be enforced.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

Broadcast the given intent to all interested BroadcastReceivers.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to specify the
user the broadcast will be sent to.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/java/lang/String receiverPermission)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent,%20java.lang.String)` that allows you to specify the
user the broadcast will be sent to.


`


void` `
https://developer.android.com/reference/android/content/Context#sendBroadcastWithMultiplePermissions(android.content.Intent,%20java.lang.String[])(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermissions)
`

Broadcast the given intent to all interested BroadcastReceivers, allowing
an array of required permissions to be enforced.


`


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/java/lang/String receiverAppOp, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)` that allows you to specify the App Op to enforce restrictions on which receivers
the broadcast will be sent to.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to
receive data back from the broadcast.


`


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options)
`

Broadcast the given intent to all interested BroadcastReceivers, delivering
them one at a time to allow more preferred receivers to consume the
broadcast before it is delivered to less preferred receivers.


`


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.os.Bundle,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/os/Bundle options, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to
receive data back from the broadcast.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/java/lang/String receiverPermission)
`

Broadcast the given intent to all interested BroadcastReceivers, delivering
them one at a time to allow more preferred receivers to consume the
broadcast before it is delivered to less preferred receivers.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendOrderedBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/java/lang/String receiverPermission, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

Version of
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)`
that allows you to specify the
user the broadcast will be sent to.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendStickyBroadcast(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`


void` `
https://developer.android.com/reference/android/content/Context#sendStickyBroadcast(android.content.Intent,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/Bundle options)
`

*This method was deprecated
in API level 31.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendStickyBroadcastAsUser(android.content.Intent,%20android.os.UserHandle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendStickyOrderedBroadcast(android.content.Intent,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#sendStickyOrderedBroadcastAsUser(android.content.Intent,%20android.os.UserHandle,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/UserHandle user, https://developer.android.com/reference/android/content/BroadcastReceiver resultReceiver, https://developer.android.com/reference/android/os/Handler scheduler, int initialCode, https://developer.android.com/reference/java/lang/String initialData, https://developer.android.com/reference/android/os/Bundle initialExtras)
`

*This method was deprecated
in API level 21.
Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#setTheme(int)(int resid)
`

Set the base theme for this context.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#setWallpaper(android.graphics.Bitmap)(https://developer.android.com/reference/android/graphics/Bitmap bitmap)
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#setBitmap(android.graphics.Bitmap)` instead.*

*This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.*


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#setWallpaper(java.io.InputStream)(https://developer.android.com/reference/java/io/InputStream data)
`

*This method was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/app/WallpaperManager#setStream(java.io.InputStream)` instead.*

*This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.*


`


boolean` `
https://developer.android.com/reference/android/content/Context#shouldShowRequestPermissionRationale(java.lang.String)(https://developer.android.com/reference/java/lang/String permission)
`

Gets whether you should show UI with rationale before requesting a permission.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startActivities(android.content.Intent[],%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intents, https://developer.android.com/reference/android/os/Bundle options)
`

Launch multiple new activities.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startActivities(android.content.Intent[])(https://developer.android.com/reference/android/content/Intent intents)
`

Same as `https://developer.android.com/reference/android/content/Context#startActivities(android.content.Intent[],%20android.os.Bundle)` with no options
specified.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent)
`

Same as `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)` with no options
specified.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)(https://developer.android.com/reference/android/content/Intent intent, https://developer.android.com/reference/android/os/Bundle options)
`

Launch a new activity.


`
abstract


https://developer.android.com/reference/android/content/ComponentName` `
https://developer.android.com/reference/android/content/Context#startForegroundService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent service)
`

Similar to `https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)`, but with an implicit promise that the
Service will call `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)` once it begins running.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#startInstrumentation(android.content.ComponentName,%20java.lang.String,%20android.os.Bundle)(https://developer.android.com/reference/android/content/ComponentName className, https://developer.android.com/reference/java/lang/String profileFile, https://developer.android.com/reference/android/os/Bundle arguments)
`

Start executing an `https://developer.android.com/reference/android/app/Instrumentation` class.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int)(https://developer.android.com/reference/android/content/IntentSender intent, https://developer.android.com/reference/android/content/Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
`

Same as `https://developer.android.com/reference/android/content/Context#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle)`
with no options specified.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle)(https://developer.android.com/reference/android/content/IntentSender intent, https://developer.android.com/reference/android/content/Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, https://developer.android.com/reference/android/os/Bundle options)
`

Like `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)`, but taking a IntentSender
to start.


`
abstract


https://developer.android.com/reference/android/content/ComponentName` `
https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent service)
`

Request that a given application service be started.


`
abstract


boolean` `
https://developer.android.com/reference/android/content/Context#stopService(android.content.Intent)(https://developer.android.com/reference/android/content/Intent service)
`

Request that a given application service be stopped.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#unbindService(android.content.ServiceConnection)(https://developer.android.com/reference/android/content/ServiceConnection conn)
`

Disconnect from an application service.


`


void` `
https://developer.android.com/reference/android/content/Context#unregisterComponentCallbacks(android.content.ComponentCallbacks)(https://developer.android.com/reference/android/content/ComponentCallbacks callback)
`

Remove a `https://developer.android.com/reference/android/content/ComponentCallbacks` object that was previously registered
with `https://developer.android.com/reference/android/content/Context#registerComponentCallbacks(android.content.ComponentCallbacks)`.


`


void` `
https://developer.android.com/reference/android/content/Context#unregisterDeviceIdChangeListener(java.util.function.IntConsumer)(https://developer.android.com/reference/java/util/function/IntConsumer listener)
`

Removes a device ID changed listener from the Context.


`
abstract


void` `
https://developer.android.com/reference/android/content/Context#unregisterReceiver(android.content.BroadcastReceiver)(https://developer.android.com/reference/android/content/BroadcastReceiver receiver)
`

Unregister a previously registered BroadcastReceiver.


`


void` `
https://developer.android.com/reference/android/content/Context#updateServiceBindings(java.util.Collection<android.content.Context.UpdateBindingParams>)(https://developer.android.com/reference/java/util/Collection<https://developer.android.com/reference/android/content/Context.UpdateBindingParams> params)
`

Perform a batch update of existing bindings.


`


void` `
https://developer.android.com/reference/android/content/Context#updateServiceGroup(android.content.ServiceConnection,%20int,%20int)(https://developer.android.com/reference/android/content/ServiceConnection conn, int group, int importance)
`

For a service previously bound with `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` or a related method, change
how the system manages that service's process in relation to other processes.


From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Public constructors

### ContextWrapper

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ContextWrapper (Context base)
```

<br />

<br />

| Parameters ||
|---|---|
| `base` | `Context` <br /> |

## Public methods

### bindIsolatedService

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean bindIsolatedService (Intent service, 
                int flags, 
                String instanceName, 
                Executor executor, 
                ServiceConnection conn)
```

Variation of `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` that, in the specific case of isolated
services, allows the caller to generate multiple instances of a service
from a single component declaration. In other words, you can use this to bind
to a service that has specified `https://developer.android.com/reference/android/R.attr#isolatedProcess` and, in
addition to the existing behavior of running in an isolated process, you can
also through the arguments here have the system bring up multiple concurrent
processes hosting their own instances of that service. The <var translate="no">instanceName</var>
you provide here identifies the different instances, and you can use
`https://developer.android.com/reference/android/content/Context#updateServiceGroup(android.content.ServiceConnection,%20int,%20int)` to tell the system how it
should manage each of these instances.

<br />

| Parameters ||
|---|---|
| `service` | `Intent`: Identifies the service to connect to. The Intent must specify an explicit component name. This value cannot be `null`. <br /> |
| `flags` | `int`: Operation options for the binding as per `https://developer.android.com/reference/android/content/ContextWrapper#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`. <br /> |
| `instanceName` | `String`: Unique identifier for the service instance. Each unique name here will result in a different service instance being created. Identifiers must only contain ASCII letters, digits, underscores, and periods. This value cannot be `null`. <br /> |
| `executor` | `Executor`: Callbacks on ServiceConnection will be called on executor. Must use same instance for the same instance of ServiceConnection. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/ContextWrapper#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `conn` | `ServiceConnection`: Receives information as the service is started and stopped. This must be a valid ServiceConnection object; it must not be null. <br /> |

| Returns ||
|---|---|
| `boolean` | Returns success of binding as per `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`. <br /> |

### bindService

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean bindService (Intent service, 
                int flags, 
                Executor executor, 
                ServiceConnection conn)
```

Same as `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)` with executor to control ServiceConnection
callbacks.

This method only accepts a 32 bits flag, to pass in a 64 bits flag, call
`https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` instead.

<br />

<br />

| Parameters ||
|---|---|
| `service` | `Intent`: This value cannot be `null`. <br /> |
| `flags` | `int`: Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Context#BIND_AUTO_CREATE` - `https://developer.android.com/reference/android/content/Context#BIND_DEBUG_UNBIND` - `https://developer.android.com/reference/android/content/Context#BIND_NOT_FOREGROUND` - `https://developer.android.com/reference/android/content/Context#BIND_ABOVE_CLIENT` - `https://developer.android.com/reference/android/content/Context#BIND_ALLOW_OOM_MANAGEMENT` - `https://developer.android.com/reference/android/content/Context#BIND_WAIVE_PRIORITY` - `https://developer.android.com/reference/android/content/Context#BIND_IMPORTANT` - `https://developer.android.com/reference/android/content/Context#BIND_ADJUST_WITH_ACTIVITY` - `https://developer.android.com/reference/android/content/Context#BIND_NOT_PERCEPTIBLE` - `https://developer.android.com/reference/android/content/Context#BIND_ALLOW_ACTIVITY_STARTS` - `https://developer.android.com/reference/android/content/Context#BIND_INCLUDE_CAPABILITIES` - `https://developer.android.com/reference/android/content/Context#BIND_SHARED_ISOLATED_PROCESS` - `https://developer.android.com/reference/android/content/Context#BIND_PACKAGE_ISOLATED_PROCESS` - `https://developer.android.com/reference/android/content/Context#BIND_EXTERNAL_SERVICE` |
| `executor` | `Executor`: Callbacks on ServiceConnection will be called on executor. Must use same instance for the same instance of ServiceConnection. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/ContextWrapper#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `conn` | `ServiceConnection`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | The result of the binding as described in `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)`. <br /> |

### bindService

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean bindService (Intent service, 
                ServiceConnection conn, 
                Context.BindServiceFlags flags)
```

See `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.

<br />

| Parameters ||
|---|---|
| `service` | `Intent`: This value cannot be `null`. <br /> |
| `conn` | `ServiceConnection`: This value cannot be `null`. <br /> |
| `flags` | `Context.BindServiceFlags`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### bindService

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean bindService (Intent service, 
                ServiceConnection conn, 
                int flags)
```

Connects to an application service, creating it if needed. This defines
a dependency between your application and the service. The given
<var translate="no">conn</var> will receive the service object when it is created and be
told if it dies and restarts. The service will be considered required
by the system only for as long as the calling context exists. For
example, if this Context is an Activity that is stopped, the service will
not be required to continue running until the Activity is resumed.

If the service does not support binding, it may return `null` from
its `https://developer.android.com/reference/android/app/Service#onBind(android.content.Intent)` method. If it does, then
the ServiceConnection's
`https://developer.android.com/reference/android/content/ServiceConnection#onNullBinding(android.content.ComponentName)` method
will be invoked instead of
`https://developer.android.com/reference/android/content/ServiceConnection#onServiceConnected(android.content.ComponentName,%20android.os.IBinder)`.

**Note:** This method *cannot* be called from a
`https://developer.android.com/reference/android/content/BroadcastReceiver` component. A pattern you can use to
communicate from a BroadcastReceiver to a Service is to call
`https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)` with the arguments containing the command to be
sent, with the service calling its
`https://developer.android.com/reference/android/app/Service#stopSelf(int)` method when done executing
that command. See the API demo App/Service/Service Start Arguments
Controller for an illustration of this. It is okay, however, to use
this method from a BroadcastReceiver that has been registered with
`https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)`, since the lifetime of this BroadcastReceiver
is tied to another object (the one that registered it).

This method only accepts a int type flag, to pass in a long type flag, call
`https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20android.content.Context.BindServiceFlags)` instead.

<br />

<br />

| Parameters ||
|---|---|
| `service` | `Intent`: Identifies the service to connect to. The Intent must specify an explicit component name. This value cannot be `null`. <br /> |
| `conn` | `ServiceConnection`: Receives information as the service is started and stopped. This must be a valid ServiceConnection object; it must not be null. <br /> |
| `flags` | `int`: Operation options for the binding. Can be: - 0 - `https://developer.android.com/reference/android/content/Context#BIND_AUTO_CREATE` - `https://developer.android.com/reference/android/content/Context#BIND_DEBUG_UNBIND` - `https://developer.android.com/reference/android/content/Context#BIND_NOT_FOREGROUND` - `https://developer.android.com/reference/android/content/Context#BIND_ABOVE_CLIENT` - `https://developer.android.com/reference/android/content/Context#BIND_ALLOW_OOM_MANAGEMENT` - `https://developer.android.com/reference/android/content/Context#BIND_WAIVE_PRIORITY` - `https://developer.android.com/reference/android/content/Context#BIND_IMPORTANT` - `https://developer.android.com/reference/android/content/Context#BIND_ADJUST_WITH_ACTIVITY` - `https://developer.android.com/reference/android/content/Context#BIND_NOT_PERCEPTIBLE` - `https://developer.android.com/reference/android/content/Context#BIND_INCLUDE_CAPABILITIES` <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the system is in the process of bringing up a service that your client has permission to bind to; `false` if the system couldn't find the service or if your client doesn't have permission to bind to it. Regardless of the return value, you should later call `https://developer.android.com/reference/android/content/Context#unbindService(android.content.ServiceConnection)` to release the connection. <br /> |

### bindService

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean bindService (Intent service, 
                Context.BindServiceFlags flags, 
                Executor executor, 
                ServiceConnection conn)
```

See `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20int,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.

<br />

| Parameters ||
|---|---|
| `service` | `Intent`: This value cannot be `null`. <br /> |
| `flags` | `Context.BindServiceFlags`: This value cannot be `null`. <br /> |
| `executor` | `Executor`: This value cannot be `null`. <br /> |
| `conn` | `ServiceConnection`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### bindServiceAsUser

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean bindServiceAsUser (Intent service, 
                ServiceConnection conn, 
                int flags, 
                UserHandle user)
```

Binds to a service in the given `user` in the same manner as `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`.

Requires that one of the following conditions are met:

- caller has `android.Manifest.permission.INTERACT_ACROSS_USERS_FULL`
- caller has `android.Manifest.permission.INTERACT_ACROSS_USERS` and is the same package as the `service` (determined by its component's package) and the Android version is at least `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`
- caller has `android.Manifest.permission.INTERACT_ACROSS_USERS` and is in same profile group as the given `user`
- caller has `android.Manifest.permission.INTERACT_ACROSS_PROFILES` and is in same profile group as the given `user` and is the same package as the `service`

<br />

<br />

| Parameters ||
|---|---|
| `service` | `Intent`: Identifies the service to connect to. The Intent must specify an explicit component name. This value cannot be `null`. <br /> |
| `conn` | `ServiceConnection`: Receives information as the service is started and stopped. This must be a valid ServiceConnection object; it must not be null. <br /> |
| `flags` | `int`: Operation options for the binding. May be 0, `https://developer.android.com/reference/android/content/Context#BIND_AUTO_CREATE`, `https://developer.android.com/reference/android/content/Context#BIND_DEBUG_UNBIND`, `https://developer.android.com/reference/android/content/Context#BIND_NOT_FOREGROUND`, `https://developer.android.com/reference/android/content/Context#BIND_ABOVE_CLIENT`, `https://developer.android.com/reference/android/content/Context#BIND_ALLOW_OOM_MANAGEMENT`, `https://developer.android.com/reference/android/content/Context#BIND_WAIVE_PRIORITY`. `https://developer.android.com/reference/android/content/Context#BIND_IMPORTANT`, or `https://developer.android.com/reference/android/content/Context#BIND_ADJUST_WITH_ACTIVITY`. <br /> |
| `user` | `UserHandle`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the system is in the process of bringing up a service that your client has permission to bind to; `false` if the system couldn't find the service. You should call `https://developer.android.com/reference/android/content/Context#unbindService(android.content.ServiceConnection)` to release the connection even if this method returned `false`. <br /> |

### bindServiceAsUser

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean bindServiceAsUser (Intent service, 
                ServiceConnection conn, 
                Context.BindServiceFlags flags, 
                UserHandle user)
```

See `https://developer.android.com/reference/android/content/Context#bindServiceAsUser(android.content.Intent,%20android.content.ServiceConnection,%20int,%20android.os.UserHandle)`
Call `https://developer.android.com/reference/android/content/Context.BindServiceFlags#of(long)` to obtain a BindServiceFlags object.

<br />

| Parameters ||
|---|---|
| `service` | `Intent`: This value cannot be `null`. <br /> |
| `conn` | `ServiceConnection`: This value cannot be `null`. <br /> |
| `flags` | `Context.BindServiceFlags`: This value cannot be `null`. <br /> |
| `user` | `UserHandle`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### checkCallingOrSelfPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int checkCallingOrSelfPermission (String permission)
```

Determine whether the calling process of an IPC *or you* have been
granted a particular permission. This is the same as
`https://developer.android.com/reference/android/content/Context#checkCallingPermission(java.lang.String)`, except it grants your own permissions
if you are not currently processing an IPC. Use with care!

<br />

| Parameters ||
|---|---|
| `permission` | `String`: The name of the permission being checked. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` if the calling pid/uid is allowed that permission, or `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` if it is not. Value is one of the following: - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` |

### checkCallingOrSelfUriPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int checkCallingOrSelfUriPermission (Uri uri, 
                int modeFlags)
```

Determine whether the calling process of an IPC *or you* has been granted
permission to access a specific URI. This is the same as
`https://developer.android.com/reference/android/content/Context#checkCallingUriPermission(android.net.Uri,%20int)`, except it grants your own permissions
if you are not currently processing an IPC. Use with care!

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: The uri that is being checked. <br /> |
| `modeFlags` | `int`: The access modes to check. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` if the caller is allowed to access that uri, or `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` if it is not. Value is one of the following: - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` |

### checkCallingOrSelfUriPermissions

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int[] checkCallingOrSelfUriPermissions (List<Uri> uris, 
                int modeFlags)
```

Determine whether the calling process of an IPC *or you* has been granted
permission to access a list of URIs. This is the same as
`https://developer.android.com/reference/android/content/Context#checkCallingUriPermission(android.net.Uri,%20int)`, except it grants your own permissions
if you are not currently processing an IPC. Use with care!

<br />

| Parameters ||
|---|---|
| `uris` | `List`: This value cannot be `null`. <br /> |
| `modeFlags` | `int`: The access modes to check. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |

| Returns ||
|---|---|
| `int[]` | This value cannot be `null`. <br /> |

### checkCallingPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int checkCallingPermission (String permission)
```

Determine whether the calling process of an IPC you are handling has been
granted a particular permission. This is basically the same as calling
`https://developer.android.com/reference/android/content/Context#checkPermission(java.lang.String,%20int,%20int)` with the pid and uid returned
by `https://developer.android.com/reference/android/os/Binder#getCallingPid()` and
`https://developer.android.com/reference/android/os/Binder#getCallingUid()`. One important difference
is that if you are not currently processing an IPC, this function
will always fail. This is done to protect against accidentally
leaking permissions; you can use `https://developer.android.com/reference/android/content/Context#checkCallingOrSelfPermission(java.lang.String)`
to avoid this protection.

<br />

| Parameters ||
|---|---|
| `permission` | `String`: The name of the permission being checked. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` if the calling pid/uid is allowed that permission, or `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` if it is not. Value is one of the following: - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` |

### checkCallingUriPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int checkCallingUriPermission (Uri uri, 
                int modeFlags)
```

Determine whether the calling process and uid has been
granted permission to access a specific URI. This is basically
the same as calling `https://developer.android.com/reference/android/content/Context#checkUriPermission(android.net.Uri,%20int,%20int,%20int)` with the pid and uid returned by `https://developer.android.com/reference/android/os/Binder#getCallingPid()` and `https://developer.android.com/reference/android/os/Binder#getCallingUid()`. One important difference is
that if you are not currently processing an IPC, this function
will always fail.

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: The uri that is being checked. <br /> |
| `modeFlags` | `int`: The access modes to check. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` if the caller is allowed to access that uri, or `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` if it is not. Value is one of the following: - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` |

### checkCallingUriPermissions

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int[] checkCallingUriPermissions (List<Uri> uris, 
                int modeFlags)
```

Determine whether the calling process and uid has been
granted permission to access a list of URIs. This is basically
the same as calling `https://developer.android.com/reference/android/content/Context#checkUriPermissions(java.util.List<android.net.Uri>,%20int,%20int,%20int)`
with the pid and uid returned by `https://developer.android.com/reference/android/os/Binder#getCallingPid()` and `https://developer.android.com/reference/android/os/Binder#getCallingUid()`. One important difference is
that if you are not currently processing an IPC, this function
will always fail.

<br />

| Parameters ||
|---|---|
| `uris` | `List`: This value cannot be `null`. <br /> |
| `modeFlags` | `int`: The access modes to check. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |

| Returns ||
|---|---|
| `int[]` | This value cannot be `null`. <br /> |

### checkContentUriPermissionFull

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int checkContentUriPermissionFull (Uri uri, 
                int pid, 
                int uid, 
                int modeFlags)
```

Determine whether a particular process and uid has been granted
permission to access a specific content URI.

Unlike `https://developer.android.com/reference/android/content/Context#checkUriPermission(android.net.Uri,%20int,%20int,%20int)`, this method
checks for general access to the URI's content provider, as well as
explicitly granted permissions.

Note, this check will throw an `https://developer.android.com/reference/java/lang/IllegalArgumentException`
for non-content URIs.

<br />

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: This value cannot be `null`. <br /> |
| `pid` | `int`: (Optional) The process ID being checked against. If the pid is unknown, pass -1. <br /> |
| `uid` | `int`: The UID being checked against. A uid of 0 is the root user, which will pass every permission check. <br /> |
| `modeFlags` | `int`: The access modes to check. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` if the given pid/uid is allowed to access that uri, or `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` if it is not. Value is one of the following: - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` |

### checkPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int checkPermission (String permission, 
                int pid, 
                int uid)
```

Determine whether the given permission is allowed for a particular process and user ID
running in the system.

<br />

| Parameters ||
|---|---|
| `permission` | `String`: The name of the permission being checked. This value cannot be `null`. <br /> |
| `pid` | `int`: The process ID being checked against. Must be \> 0. <br /> |
| `uid` | `int`: The UID being checked against. A uid of 0 is the root user, which will pass every permission check. <br /> |

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` if the given pid/uid is allowed that permission, or `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` if it is not. Value is one of the following: - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` |

### checkSelfPermission

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int checkSelfPermission (String permission)
```

Determine whether *you* have been granted a particular permission.

<br />

| Parameters ||
|---|---|
| `permission` | `String`: The name of the permission being checked. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` if you have the permission, or `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` if not. Value is one of the following: - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` |

### checkUriPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int checkUriPermission (Uri uri, 
                String readPermission, 
                String writePermission, 
                int pid, 
                int uid, 
                int modeFlags)
```

Check both a Uri and normal permission. This allows you to perform
both `https://developer.android.com/reference/android/content/Context#checkPermission(java.lang.String,%20int,%20int)` and `https://developer.android.com/reference/android/content/Context#checkUriPermission(android.net.Uri,%20int,%20int,%20int)` in one
call.

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: This value may be `null`. <br /> |
| `readPermission` | `String`: This value may be `null`. <br /> |
| `writePermission` | `String`: This value may be `null`. <br /> |
| `pid` | `int`: The process ID being checked against. Must be \> 0. <br /> |
| `uid` | `int`: The UID being checked against. A uid of 0 is the root user, which will pass every permission check. <br /> |
| `modeFlags` | `int`: The access modes to check. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` if the caller is allowed to access that uri or holds one of the given permissions, or `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` if it is not. Value is one of the following: - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` |

### checkUriPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int checkUriPermission (Uri uri, 
                int pid, 
                int uid, 
                int modeFlags)
```

Determine whether a particular process and uid has been granted
permission to access a specific URI. This only checks for permissions
that have been explicitly granted -- if the given process/uid has
more general access to the URI's content provider then this check will
always fail.

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: The uri that is being checked. <br /> |
| `pid` | `int`: The process ID being checked against. Must be \> 0. <br /> |
| `uid` | `int`: The UID being checked against. A uid of 0 is the root user, which will pass every permission check. <br /> |
| `modeFlags` | `int`: The access modes to check. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` if the given pid/uid is allowed to access that uri, or `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` if it is not. Value is one of the following: - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_GRANTED` - `https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` |

### checkUriPermissions

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int[] checkUriPermissions (List<Uri> uris, 
                int pid, 
                int uid, 
                int modeFlags)
```

Determine whether a particular process and uid has been granted
permission to access a list of URIs. This only checks for permissions
that have been explicitly granted -- if the given process/uid has
more general access to the URI's content provider then this check will
always fail.

**Note:** On SDK Version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S`,
calling this method from a secondary-user's context will incorrectly return
`https://developer.android.com/reference/android/content/pm/PackageManager#PERMISSION_DENIED` for all {code uris}.

<br />

| Parameters ||
|---|---|
| `uris` | `List`: This value cannot be `null`. <br /> |
| `pid` | `int`: The process ID being checked against. Must be \> 0. <br /> |
| `uid` | `int`: The UID being checked against. A uid of 0 is the root user, which will pass every permission check. <br /> |
| `modeFlags` | `int`: The access modes to check for the list of uris. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |

| Returns ||
|---|---|
| `int[]` | This value cannot be `null`. <br /> |

### clearWallpaper

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void clearWallpaper ()
```


**This method is deprecated.**   

Use `https://developer.android.com/reference/android/app/WallpaperManager#clear()` instead.

This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.

<br />

<br />

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` |   |

### createAttributionContext

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context createAttributionContext (String attributionTag)
```

Return a new Context object for the current Context but attribute to a different tag.
In complex apps attribution tagging can be used to distinguish between separate logical
parts.

<br />

| Parameters ||
|---|---|
| `attributionTag` | `String`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | This value cannot be `null`. <br /> |

### createConfigurationContext

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context createConfigurationContext (Configuration overrideConfiguration)
```

Return a new Context object for the current Context but whose resources
are adjusted to match the given Configuration. Each call to this method
returns a new instance of a Context object; Context objects are not
shared, however common state (ClassLoader, other Resources for the
same configuration) may be so the Context itself can be fairly lightweight.

<br />

| Parameters ||
|---|---|
| `overrideConfiguration` | `Configuration`: A `https://developer.android.com/reference/android/content/res/Configuration` specifying what values to modify in the base Configuration of the original Context's resources. If the base configuration changes (such as due to an orientation change), the resources of this context will also change except for those that have been explicitly overridden with a value here. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | A `https://developer.android.com/reference/android/content/Context` with the given configuration override. <br /> |

### createContext

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context createContext (ContextParams contextParams)
```

Creates a context with specific properties and behaviors.

<br />

| Parameters ||
|---|---|
| `contextParams` | `ContextParams`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | This value cannot be `null`. <br /> |

### createContextForSplit

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context createContextForSplit (String splitName)
```

Return a new Context object for the given split name. The new Context has a ClassLoader and
Resources object that can access the split's and all of its dependencies' code/resources.
Each call to this method returns a new instance of a Context object;
Context objects are not shared, however common state (ClassLoader, other Resources for
the same split) may be so the Context itself can be fairly lightweight.

<br />

| Parameters ||
|---|---|
| `splitName` | `String`: The name of the split to include, as declared in the split's `AndroidManifest.xml`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | A `https://developer.android.com/reference/android/content/Context` with the given split's code and/or resources loaded. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/pm/PackageManager.NameNotFoundException` |   |

### createDeviceContext

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context createDeviceContext (int deviceId)
```

Returns a new `Context` object from the current context but with device association
given by the `deviceId`. Each call to this method returns a new instance of a context
object. Context objects are not shared; however, common state (such as the
`https://developer.android.com/reference/java/lang/ClassLoader` and other resources for the same configuration) can be shared, so the
`Context` itself is lightweight.


Applications that run on virtual devices may use this method to access the default device
capabilities and functionality (by passing
`https://developer.android.com/reference/android/content/Context#DEVICE_ID_DEFAULT`. Similarly,
applications running on the default device may access the functionality of virtual devices.


Note that the newly created instance will be associated with the same display as the parent
Context, regardless of the device ID passed here.

<br />

<br />

| Parameters ||
|---|---|
| `deviceId` | `int`: The ID of the device to associate with this context. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | This value cannot be `null`. <br /> |

### createDeviceProtectedStorageContext

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context createDeviceProtectedStorageContext ()
```

Return a new Context object for the current Context but whose storage
APIs are backed by device-protected storage.


On devices with direct boot, data stored in this location is encrypted
with a key tied to the physical device, and it can be accessed
immediately after the device has booted successfully, both
*before and after* the user has authenticated with their
credentials (such as a lock pattern or PIN).


Because device-protected data is available without user authentication,
you should carefully limit the data you store using this Context. For
example, storing sensitive authentication tokens or passwords in the
device-protected area is strongly discouraged.


If the underlying device does not have the ability to store
device-protected and credential-protected data using different keys, then
both storage areas will become available at the same time. They remain as
two distinct storage locations on disk, and only the window of
availability changes.


Each call to this method returns a new instance of a Context object;
Context objects are not shared, however common state (ClassLoader, other
Resources for the same configuration) may be so the Context itself can be
fairly lightweight.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | <br /> |

### createDisplayContext

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context createDisplayContext (Display display)
```

Returns a new `Context` object from the current context but with resources
adjusted to match the metrics of `display`. Each call to this method
returns a new instance of a context object. Context objects are not shared; however,
common state (such as the `https://developer.android.com/reference/java/lang/ClassLoader` and other resources for the same
configuration) can be shared, so the `Context` itself is lightweight.

**Note:**
This `Context` is **not** expected to be updated with new configuration if the
underlying display configuration changes and the cached `Resources` it returns
could be stale. It is suggested to use
`https://developer.android.com/reference/android/hardware/display/DisplayManager.DisplayListener` to listen for
changes and re-create an instance if necessary.


This `Context` is **not** a UI context, do not use it to access UI components
or obtain a `https://developer.android.com/reference/android/view/WindowManager` instance.


To obtain an instance of `https://developer.android.com/reference/android/view/WindowManager` configured to show windows on the given
display, call `https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)` on the returned display context,
then call `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)` or `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.Class<T>)` on the
returned window context.

<br />

<br />

| Parameters ||
|---|---|
| `display` | `Display`: The display to which the current context's resources are adjusted. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | A context for the display. <br /> |

### createPackageContext

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context createPackageContext (String packageName, 
                int flags)
```

Return a new Context object for the given application name. This
Context is the same as what the named application gets when it is
launched, containing the same resources and class loader. Each call to
this method returns a new instance of a Context object; Context objects
are not shared, however they share common state (Resources, ClassLoader,
etc) so the Context instance itself is fairly lightweight.

Throws `https://developer.android.com/reference/android/content/pm/PackageManager.NameNotFoundException` if there is no
application with the given package name.

Throws `https://developer.android.com/reference/java/lang/SecurityException` if the Context requested
can not be loaded into the caller's process for security reasons (see
`https://developer.android.com/reference/android/content/Context#CONTEXT_INCLUDE_CODE` for more information}.

<br />

| Parameters ||
|---|---|
| `packageName` | `String`: Name of the application's package. <br /> |
| `flags` | `int`: Option flags. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Context#CONTEXT_INCLUDE_CODE` - `https://developer.android.com/reference/android/content/Context#CONTEXT_IGNORE_SECURITY` - `https://developer.android.com/reference/android/content/Context#CONTEXT_RESTRICTED` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | A `https://developer.android.com/reference/android/content/Context` for the application. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/pm/PackageManager.NameNotFoundException` |   |

### createWindowContext

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context createWindowContext (int type, 
                Bundle options)
```

Creates a Context for a non-activity window.


A window context is a context that can be used to add non-activity windows, such as
`https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY`. A window context
must be created from a context that has an associated `https://developer.android.com/reference/android/view/Display`, such as
`https://developer.android.com/reference/android/app/Activity` or a context created with
`https://developer.android.com/reference/android/content/Context#createDisplayContext(android.view.Display)`.


The window context is created with the appropriate `https://developer.android.com/reference/android/content/res/Configuration` for the area of the
display that the windows created with it can occupy; it must be used when
`https://developer.android.com/reference/android/view/LayoutInflater` views, such that they can be inflated with
proper `https://developer.android.com/reference/android/content/res/Resources`.

Below is a sample code to **add an application overlay window on the primary display:**

```
...
final DisplayManager dm = anyContext.getSystemService(DisplayManager.class);
final Display primaryDisplay = dm.getDisplay(DEFAULT_DISPLAY);
final Context windowContext = anyContext.createDisplayContext(primaryDisplay)
        .createWindowContext(TYPE_APPLICATION_OVERLAY, null);
final View overlayView = Inflater.from(windowContext).inflate(someLayoutXml, null);

// WindowManager.LayoutParams initialization
...
// The types used in addView and createWindowContext must match.
mParams.type = TYPE_APPLICATION_OVERLAY;
...

windowContext.getSystemService(WindowManager.class).addView(overlayView, mParams);
```


This context's configuration and resources are adjusted to an area of the display where
the windows with provided type will be added. **Note that all windows associated with the
same context will have an affinity and can only be moved together between different displays
or areas on a display.** If there is a need to add different window types, or
non-associated windows, separate Contexts should be used.


Creating a window context is an expensive operation. Misuse of this API may lead to a huge
performance drop. The best practice is to use the same window context when possible.
An approach is to create one window context with specific window type and display and
use it everywhere it's needed.


After `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S`, window context provides the capability to receive
configuration changes for existing token by overriding the
`https://developer.android.com/reference/android/view/WindowManager.LayoutParams#token` of the
`https://developer.android.com/reference/android/view/WindowManager.LayoutParams` passed in
`https://developer.android.com/reference/android/view/ViewManager#addView(android.view.View,%20android.view.ViewGroup.LayoutParams)`. This is useful when an application needs
to attach its window to an existing activity for window token sharing use-case.


Note that the window context in `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` didn't have this
capability. This is a no-op for the window context in `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R`.
Below is sample code to **attach an existing token to a window context:**

```
final DisplayManager dm = anyContext.getSystemService(DisplayManager.class);
final Display primaryDisplay = dm.getDisplay(DEFAULT_DISPLAY);
final Context windowContext = anyContext.createWindowContext(primaryDisplay,
        TYPE_APPLICATION, null);

// Get an existing token.
final IBinder existingToken = activity.getWindow().getAttributes().token;

// The types used in addView() and createWindowContext() must match.
final WindowManager.LayoutParams params = new WindowManager.LayoutParams(TYPE_APPLICATION);
params.token = existingToken;

// After WindowManager#addView(), the server side will extract the provided token from
// LayoutParams#token (existingToken in the sample code), and switch to propagate
// configuration changes from the node associated with the provided token.
windowContext.getSystemService(WindowManager.class).addView(overlayView, mParams);
```


After `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S`, window context provides the capability to listen to its
`https://developer.android.com/reference/android/content/res/Configuration` changes by calling
`https://developer.android.com/reference/android/content/Context#registerComponentCallbacks(android.content.ComponentCallbacks)`, while other kinds of `https://developer.android.com/reference/android/content/Context`
will register the `https://developer.android.com/reference/android/content/ComponentCallbacks` to `https://developer.android.com/reference/android/content/Context#getApplicationContext()`. Note that window context only propagate
`https://developer.android.com/reference/android/content/ComponentCallbacks#onConfigurationChanged(android.content.res.Configuration)` callback.
`https://developer.android.com/reference/android/content/ComponentCallbacks#onLowMemory()` or other callbacks in `https://developer.android.com/reference/android/content/ComponentCallbacks2`
won't be invoked.


Note that using `https://developer.android.com/reference/android/app/Application` or `https://developer.android.com/reference/android/app/Service` context for
UI-related queries may result in layout or continuity issues on devices with variable screen
sizes (e.g. foldables) or in multi-window modes, since these non-UI contexts may not reflect
the `https://developer.android.com/reference/android/content/res/Configuration` changes for the visual container.

<br />

<br />

| Parameters ||
|---|---|
| `type` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_BASE_APPLICATION` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_STARTING` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_DRAWN_APPLICATION` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_PANEL` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_MEDIA` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_SUB_PANEL` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_ATTACHED_DIALOG` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_STATUS_BAR` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_SEARCH_BAR` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_PHONE` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_SYSTEM_ALERT` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_TOAST` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_SYSTEM_OVERLAY` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_PRIORITY_PHONE` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_SYSTEM_DIALOG` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_KEYGUARD_DIALOG` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_SYSTEM_ERROR` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_INPUT_METHOD` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_INPUT_METHOD_DIALOG` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_WALLPAPER` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_PRIVATE_PRESENTATION` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_ACCESSIBILITY_OVERLAY` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY` |
| `options` | `Bundle`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | This value cannot be `null`. <br /> |

### createWindowContext

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context createWindowContext (Display display, 
                int type, 
                Bundle options)
```

Creates a `Context` for a non-`https://developer.android.com/reference/android/app/Activity` window on the given
`https://developer.android.com/reference/android/view/Display`.


Similar to `https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)`, but the `display` is passed in,
instead of implicitly using the `https://developer.android.com/reference/android/content/Context#getDisplay()`.

<br />

<br />

| Parameters ||
|---|---|
| `display` | `Display`: This value cannot be `null`. <br /> |
| `type` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_BASE_APPLICATION` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_STARTING` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_DRAWN_APPLICATION` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_PANEL` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_MEDIA` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_SUB_PANEL` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_ATTACHED_DIALOG` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_STATUS_BAR` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_SEARCH_BAR` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_PHONE` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_SYSTEM_ALERT` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_TOAST` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_SYSTEM_OVERLAY` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_PRIORITY_PHONE` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_SYSTEM_DIALOG` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_KEYGUARD_DIALOG` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_SYSTEM_ERROR` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_INPUT_METHOD` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_INPUT_METHOD_DIALOG` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_WALLPAPER` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_PRIVATE_PRESENTATION` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_ACCESSIBILITY_OVERLAY` - `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY` |
| `options` | `Bundle`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | This value cannot be `null`. <br /> |

### databaseList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] databaseList ()
```

Returns an array of strings naming the private databases associated with
this Context's application package.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | Array of strings naming the private databases. <br /> |

### deleteDatabase

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean deleteDatabase (String name)
```

Delete an existing private SQLiteDatabase associated with this Context's
application package.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name (unique in the application package) of the database. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the database was successfully deleted; else `false`. <br /> |

### deleteFile

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean deleteFile (String name)
```

Delete the given private file associated with this Context's
application package.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name of the file to delete; can not contain path separators. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the file was successfully deleted; else `false`. <br /> |

### deleteSharedPreferences

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean deleteSharedPreferences (String name)
```

Delete an existing shared preferences file.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name (unique in the application package) of the shared preferences file. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the shared preferences file was successfully deleted; else `false`. <br /> |

### enforceCallingOrSelfPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void enforceCallingOrSelfPermission (String permission, 
                String message)
```

If neither you nor the calling process of an IPC you are
handling has been granted a particular permission, throw a
`https://developer.android.com/reference/java/lang/SecurityException`. This is the same as `https://developer.android.com/reference/android/content/Context#enforceCallingPermission(java.lang.String,%20java.lang.String)`, except it grants your own
permissions if you are not currently processing an IPC. Use
with care!

<br />

| Parameters ||
|---|---|
| `permission` | `String`: The name of the permission being checked. This value cannot be `null`. <br /> |
| `message` | `String`: This value may be `null`. <br /> |

### enforceCallingOrSelfUriPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void enforceCallingOrSelfUriPermission (Uri uri, 
                int modeFlags, 
                String message)
```

If the calling process of an IPC *or you* has not been
granted permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`. This is the same as `https://developer.android.com/reference/android/content/Context#enforceCallingUriPermission(android.net.Uri,%20int,%20java.lang.String)`, except it grants your own
permissions if you are not currently processing an IPC. Use
with care!

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: The uri that is being checked. <br /> |
| `modeFlags` | `int`: The access modes to enforce. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |
| `message` | `String`: A message to include in the exception if it is thrown. <br /> |

### enforceCallingPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void enforceCallingPermission (String permission, 
                String message)
```

If the calling process of an IPC you are handling has not been
granted a particular permission, throw a `https://developer.android.com/reference/java/lang/SecurityException`. This is basically the same as calling
`https://developer.android.com/reference/android/content/Context#enforcePermission(java.lang.String,%20int,%20int,%20java.lang.String)` with the
pid and uid returned by `https://developer.android.com/reference/android/os/Binder#getCallingPid()`
and `https://developer.android.com/reference/android/os/Binder#getCallingUid()`. One important
difference is that if you are not currently processing an IPC,
this function will always throw the SecurityException. This is
done to protect against accidentally leaking permissions; you
can use `https://developer.android.com/reference/android/content/Context#enforceCallingOrSelfPermission(java.lang.String,%20java.lang.String)` to avoid this
protection.

<br />

| Parameters ||
|---|---|
| `permission` | `String`: The name of the permission being checked. This value cannot be `null`. <br /> |
| `message` | `String`: This value may be `null`. <br /> |

### enforceCallingUriPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void enforceCallingUriPermission (Uri uri, 
                int modeFlags, 
                String message)
```

If the calling process and uid has not been granted
permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`. This is basically the same as calling
`https://developer.android.com/reference/android/content/Context#enforceUriPermission(android.net.Uri,%20int,%20int,%20int,%20java.lang.String)` with
the pid and uid returned by `https://developer.android.com/reference/android/os/Binder#getCallingPid()` and `https://developer.android.com/reference/android/os/Binder#getCallingUid()`. One important difference is
that if you are not currently processing an IPC, this function
will always throw a SecurityException.

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: The uri that is being checked. <br /> |
| `modeFlags` | `int`: The access modes to enforce. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |
| `message` | `String`: A message to include in the exception if it is thrown. <br /> |

### enforcePermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void enforcePermission (String permission, 
                int pid, 
                int uid, 
                String message)
```

If the given permission is not allowed for a particular process
and user ID running in the system, throw a `https://developer.android.com/reference/java/lang/SecurityException`.

<br />

| Parameters ||
|---|---|
| `permission` | `String`: The name of the permission being checked. This value cannot be `null`. <br /> |
| `pid` | `int`: The process ID being checked against. Must be \> 0. <br /> |
| `uid` | `int`: The UID being checked against. A uid of 0 is the root user, which will pass every permission check. <br /> |
| `message` | `String`: This value may be `null`. <br /> |

### enforceUriPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void enforceUriPermission (Uri uri, 
                String readPermission, 
                String writePermission, 
                int pid, 
                int uid, 
                int modeFlags, 
                String message)
```

Enforce both a Uri and normal permission. This allows you to perform
both `https://developer.android.com/reference/android/content/Context#enforcePermission(java.lang.String,%20int,%20int,%20java.lang.String)` and `https://developer.android.com/reference/android/content/Context#enforceUriPermission(android.net.Uri,%20int,%20int,%20int,%20java.lang.String)` in one
call.

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: This value may be `null`. <br /> |
| `readPermission` | `String`: This value may be `null`. <br /> |
| `writePermission` | `String`: This value may be `null`. <br /> |
| `pid` | `int`: The process ID being checked against. Must be \> 0. <br /> |
| `uid` | `int`: The UID being checked against. A uid of 0 is the root user, which will pass every permission check. <br /> |
| `modeFlags` | `int`: The access modes to enforce. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |
| `message` | `String`: This value may be `null`. <br /> |

### enforceUriPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void enforceUriPermission (Uri uri, 
                int pid, 
                int uid, 
                int modeFlags, 
                String message)
```

If a particular process and uid has not been granted
permission to access a specific URI, throw `https://developer.android.com/reference/java/lang/SecurityException`. This only checks for permissions that have
been explicitly granted -- if the given process/uid has more
general access to the URI's content provider then this check
will always fail.

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: The uri that is being checked. <br /> |
| `pid` | `int`: The process ID being checked against. Must be \> 0. <br /> |
| `uid` | `int`: The UID being checked against. A uid of 0 is the root user, which will pass every permission check. <br /> |
| `modeFlags` | `int`: The access modes to enforce. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |
| `message` | `String`: A message to include in the exception if it is thrown. <br /> |

### fileList

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] fileList ()
```

Returns an array of strings naming the private files associated with
this Context's application package.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | Array of strings naming the private files. <br /> |

### getApplicationContext

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context getApplicationContext ()
```

Return the context of the single, global Application object of the
current process. This generally should only be used if you need a
Context whose lifecycle is separate from the current context, that is
tied to the lifetime of the process rather than the current component.

Consider for example how this interacts with
`https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)`:

- If used from an Activity context, the receiver is being registered
  within that activity. This means that you are expected to unregister
  before the activity is done being destroyed; in fact if you do not do
  so, the framework will clean up your leaked registration as it removes
  the activity and log an error. Thus, if you use the Activity context
  to register a receiver that is static (global to the process, not
  associated with an Activity instance) then that registration will be
  removed on you at whatever point the activity you used is destroyed.

- If used from the Context returned here, the receiver is being
  registered with the global state associated with your application. Thus
  it will never be unregistered for you. This is necessary if the receiver
  is associated with static data, not a particular component. However
  using the ApplicationContext elsewhere can easily lead to serious leaks
  if you forget to unregister, unbind, etc.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | <br /> |

### getApplicationInfo

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ApplicationInfo getApplicationInfo ()
```

Return the full application info for this context's package.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/pm/ApplicationInfo` | <br /> |

### getAssets

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public AssetManager getAssets ()
```

Returns an AssetManager instance for the application's package.


**Note:** Implementations of this method should return
an AssetManager instance that is consistent with the Resources instance
returned by `https://developer.android.com/reference/android/content/Context#getResources()`. For example, they should share the
same `https://developer.android.com/reference/android/content/res/Configuration` object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/AssetManager` | an AssetManager instance for the application's package <br /> |

### getAttributionSource

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public AttributionSource getAttributionSource ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/AttributionSource` | This value cannot be `null`. <br /> |

### getAttributionTag

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getAttributionTag ()
```

<br />

Attribution can be used in complex apps to logically separate parts of the app. E.g. a
blogging app might also have a instant messaging app built in. In this case two separate tags
can for used each sub-feature.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value may be `null`. <br /> |

### getBaseContext

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Context getBaseContext ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Context` | the base context as set by the constructor or setBaseContext <br /> |

### getCacheDir

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File getCacheDir ()
```

Returns the absolute path to the application specific cache directory on
the filesystem.


The system will automatically delete files in this directory as disk
space is needed elsewhere on the device. The system will always delete
older files first, as reported by `https://developer.android.com/reference/java/io/File#lastModified()`. If
desired, you can exert more control over how files are deleted using
`https://developer.android.com/reference/android/os/storage/StorageManager#setCacheBehaviorGroup(java.io.File,%20boolean)` and
`https://developer.android.com/reference/android/os/storage/StorageManager#setCacheBehaviorTombstone(java.io.File,%20boolean)`.


Apps are strongly encouraged to keep their usage of cache space below the
quota returned by
`https://developer.android.com/reference/android/os/storage/StorageManager#getCacheQuotaBytes(java.util.UUID)`. If your app
goes above this quota, your cached files will be some of the first to be
deleted when additional disk space is needed. Conversely, if your app
stays under this quota, your cached files will be some of the last to be
deleted when additional disk space is needed.


Note that your cache quota will change over time depending on how
frequently the user interacts with your app, and depending on how much
system-wide disk space is used.


The returned path may change over time if the calling app is moved to an
adopted storage device, so only relative paths should be persisted.


Apps require no extra permissions to read or write to the returned path,
since this path lives in their private storage.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | The path of the directory holding application cache files. <br /> |

### getClassLoader

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ClassLoader getClassLoader ()
```

Return a class loader you can use to retrieve classes in this package.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/ClassLoader` | <br /> |

### getCodeCacheDir

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File getCodeCacheDir ()
```

Returns the absolute path to the application specific cache directory on
the filesystem designed for storing cached code.


The system will delete any files stored in this location both when your
specific application is upgraded, and when the entire platform is
upgraded.


This location is optimal for storing compiled or optimized code generated
by your application at runtime.


The returned path may change over time if the calling app is moved to an
adopted storage device, so only relative paths should be persisted.


Apps require no extra permissions to read or write to the returned path,
since this path lives in their private storage.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | The path of the directory holding application code cache files. <br /> |

### getContentResolver

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ContentResolver getContentResolver ()
```

Return a ContentResolver instance for your application's package.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/ContentResolver` | <br /> |

### getDataDir

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File getDataDir ()
```

Returns the absolute path to the directory on the filesystem where all
private files belonging to this app are stored. Apps should not use this
path directly; they should instead use `https://developer.android.com/reference/android/content/Context#getFilesDir()`,
`https://developer.android.com/reference/android/content/Context#getCacheDir()`, `https://developer.android.com/reference/android/content/Context#getDir(java.lang.String,%20int)`, or other storage
APIs on this class.


The returned path may change over time if the calling app is moved to an
adopted storage device, so only relative paths should be persisted.


No additional permissions are required for the calling app to read or
write files under the returned path.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | <br /> |

### getDatabasePath

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File getDatabasePath (String name)
```

Returns the absolute path on the filesystem where a database created with
`https://developer.android.com/reference/android/content/Context#openOrCreateDatabase(java.lang.String,%20int,%20android.database.sqlite.SQLiteDatabase.CursorFactory)` is stored.


The returned path may change over time if the calling app is moved to an
adopted storage device, so only relative paths should be persisted.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name of the database for which you would like to get its path. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | An absolute path to the given database. <br /> |

### getDeviceId

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getDeviceId ()
```

Gets the device ID this context is associated with. Applications can use this method to
determine whether they are running on a virtual device and identify that device.

The device ID of the host device is
`https://developer.android.com/reference/android/content/Context#DEVICE_ID_DEFAULT`


If the underlying device ID is changed by the system, for example, when an
`https://developer.android.com/reference/android/app/Activity` is moved to a different virtual device, applications can register to listen
to changes by calling
`https://developer.android.com/reference/android/content/Context#registerDeviceIdChangeListener(java.util.concurrent.Executor,%20java.util.function.IntConsumer)`.


This method will only return a reliable value for this instance if it was created with
`https://developer.android.com/reference/android/content/Context#createDeviceContext(int)`, or if this instance is a UI or Display Context.
Contexts created with `https://developer.android.com/reference/android/content/Context#createDeviceContext(int)` will have an explicit
device association, which will never change, even if the underlying device is closed or is
removed. UI Contexts and Display Contexts are
already associated with a display, so if the device association is not explicitly
given, `https://developer.android.com/reference/android/content/Context#getDeviceId()` will return the ID of the device associated with
the associated display. The system can assign an arbitrary device id value for Contexts not
logically associated with a device.

<br />

<br />

| Returns ||
|---|---|
| `int` | the ID of the device this context is associated with. <br /> |

### getDir

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File getDir (String name, 
                int mode)
```

Retrieve, creating if needed, a new directory in which the application
can place its own custom data files. You can use the returned File
object to create and access files in this directory. Note that files
created through a File object will only be accessible by your own
application; you can only set the mode of the entire directory, not
of individual files.


The returned path may change over time if the calling app is moved to an
adopted storage device, so only relative paths should be persisted.


Apps require no extra permissions to read or write to the returned path,
since this path lives in their private storage.

<br />

| Parameters ||
|---|---|
| `name` | `String`: Name of the directory to retrieve. This is a directory that is created as part of your application data. <br /> |
| `mode` | `int`: Operating mode. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Context#MODE_PRIVATE` - `https://developer.android.com/reference/android/content/Context#MODE_WORLD_READABLE` - `https://developer.android.com/reference/android/content/Context#MODE_WORLD_WRITEABLE` - `https://developer.android.com/reference/android/content/Context#MODE_APPEND` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | A `https://developer.android.com/reference/java/io/File` object for the requested directory. The directory will have been created if it does not already exist. <br /> |

### getDisplay

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Display getDisplay ()
```

Get the display this context is associated with. Applications should use this method with
`https://developer.android.com/reference/android/app/Activity` or a context associated with a `https://developer.android.com/reference/android/view/Display` via
`https://developer.android.com/reference/android/content/Context#createDisplayContext(android.view.Display)` to get a display object associated with a Context, or
`https://developer.android.com/reference/android/hardware/display/DisplayManager#getDisplay(int)` to get a display object by id.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/Display` | This value may be `null`. <br /> |

### getExternalCacheDir

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File getExternalCacheDir ()
```

Returns absolute path to application-specific directory on the primary
shared/external storage device where the application can place cache
files it owns. These files are internal to the application, and not
typically visible to the user as media.


This is like `https://developer.android.com/reference/android/content/Context#getCacheDir()` in that these files will be deleted
when the application is uninstalled, however there are some important
differences:

- The platform does not always monitor the space available in shared storage, and thus may not automatically delete these files. Apps should always manage the maximum space used in this location. Currently the only time files here will be deleted by the platform is when running on `https://developer.android.com/reference/android/os/Build.VERSION_CODES#JELLY_BEAN_MR1` or later and `https://developer.android.com/reference/android/os/Environment#isExternalStorageEmulated(java.io.File)` returns true.
- Shared storage may not always be available, since removable media can be ejected by the user. Media state can be checked using `https://developer.android.com/reference/android/os/Environment#getExternalStorageState(java.io.File)`.
- There is no security enforced with these files. For example, any application holding `https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE` can write to these files.


If a shared storage device is emulated (as determined by
`https://developer.android.com/reference/android/os/Environment#isExternalStorageEmulated(java.io.File)`), its contents are
backed by a private user data partition, which means there is little
benefit to storing data here instead of the private directory returned by
`https://developer.android.com/reference/android/content/Context#getCacheDir()`.


Starting in `https://developer.android.com/reference/android/os/Build.VERSION_CODES#KITKAT`, no permissions
are required to read or write to the returned path; it's always
accessible to the calling app. This only applies to paths generated for
package name of the calling application. To access paths belonging to
other packages,
`https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE` and/or
`https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE` are required.


On devices with multiple users (as described by `https://developer.android.com/reference/android/os/UserManager`),
each user has their own isolated shared storage. Applications only have
access to the shared storage for the user they're running as.


The returned path may change over time if different shared storage media
is inserted, so only relative paths should be persisted.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | This value may be `null`. <br /> |

### getExternalCacheDirs

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File[] getExternalCacheDirs ()
```

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application can place cache
files it owns. These files are internal to the application, and not
typically visible to the user as media.


This is like `https://developer.android.com/reference/android/content/Context#getCacheDir()` in that these files will be deleted
when the application is uninstalled, however there are some important
differences:

- The platform does not always monitor the space available in shared storage, and thus may not automatically delete these files. Apps should always manage the maximum space used in this location. Currently the only time files here will be deleted by the platform is when running on `https://developer.android.com/reference/android/os/Build.VERSION_CODES#JELLY_BEAN_MR1` or later and `https://developer.android.com/reference/android/os/Environment#isExternalStorageEmulated(java.io.File)` returns true.
- Shared storage may not always be available, since removable media can be ejected by the user. Media state can be checked using `https://developer.android.com/reference/android/os/Environment#getExternalStorageState(java.io.File)`.
- There is no security enforced with these files. For example, any application holding `https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE` can write to these files.


If a shared storage device is emulated (as determined by
`https://developer.android.com/reference/android/os/Environment#isExternalStorageEmulated(java.io.File)`), its contents are
backed by a private user data partition, which means there is little
benefit to storing data here instead of the private directory returned by
`https://developer.android.com/reference/android/content/Context#getCacheDir()`.


Shared storage devices returned here are considered a stable part of the
device, including physical media slots under a protective cover. The
returned paths do not include transient devices, such as USB flash drives
connected to handheld devices.


An application may store data on any or all of the returned devices. For
example, an app may choose to store large files on the device with the
most available space, as measured by `https://developer.android.com/reference/android/os/StatFs`.


No additional permissions are required for the calling app to read or
write files under the returned path. Write access outside of these paths
on secondary external storage devices is not available.


The returned paths may change over time if different shared storage media
is inserted, so only relative paths should be persisted.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | the absolute paths to application-specific directories. Some individual paths may be `null` if that shared storage is not currently available. The first path returned is the same as `https://developer.android.com/reference/android/content/Context#getExternalCacheDir()`. <br /> |

### getExternalFilesDir

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File getExternalFilesDir (String type)
```

Returns the absolute path to the directory on the primary shared/external
storage device where the application can place persistent files it owns.
These files are internal to the applications, and not typically visible
to the user as media.


This is like `https://developer.android.com/reference/android/content/Context#getFilesDir()` in that these files will be deleted
when the application is uninstalled, however there are some important
differences:

- Shared storage may not always be available, since removable media can be ejected by the user. Media state can be checked using `https://developer.android.com/reference/android/os/Environment#getExternalStorageState(java.io.File)`.
- There is no security enforced with these files. For example, any application holding `https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE` can write to these files.


If a shared storage device is emulated (as determined by
`https://developer.android.com/reference/android/os/Environment#isExternalStorageEmulated(java.io.File)`), its contents are
backed by a private user data partition, which means there is little
benefit to storing data here instead of the private directories returned
by `https://developer.android.com/reference/android/content/Context#getFilesDir()`, etc.


Starting in `https://developer.android.com/reference/android/os/Build.VERSION_CODES#KITKAT`, no permissions
are required to read or write to the returned path; it's always
accessible to the calling app. This only applies to paths generated for
package name of the calling application. To access paths belonging to
other packages,
`https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE` and/or
`https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE` are required.


On devices with multiple users (as described by `https://developer.android.com/reference/android/os/UserManager`),
each user has their own isolated shared storage. Applications only have
access to the shared storage for the user they're running as.


The returned path may change over time if different shared storage media
is inserted, so only relative paths should be persisted.


Here is an example of typical code to manipulate a file in an
application's shared storage:

```
void createExternalStoragePrivateFile() {
    // Create a path where we will place our private file on external
    // storage.
    File file = new File(getExternalFilesDir(null), "DemoFile.jpg");

    try {
        // Very simple code to copy a picture from the application's
        // resource into the external file.  Note that this code does
        // no error checking, and assumes the picture is small (does not
        // try to copy it in chunks).  Note that if external storage is
        // not currently mounted this will silently fail.
        InputStream is = getResources().openRawResource(R.drawable.balloons);
        OutputStream os = new FileOutputStream(file);
        byte[] data = new byte[is.available()];
        is.read(data);
        os.write(data);
        is.close();
        os.close();
    } catch (IOException e) {
        // Unable to create file, likely because external storage is
        // not currently mounted.
        Log.w("ExternalStorage", "Error writing " + file, e);
    }
}

void deleteExternalStoragePrivateFile() {
    // Get path for the file on external storage.  If external
    // storage is not currently mounted this will fail.
    File file = new File(getExternalFilesDir(null), "DemoFile.jpg");
    file.delete();
}

boolean hasExternalStoragePrivateFile() {
    // Get path for the file on external storage.  If external
    // storage is not currently mounted this will fail.
    File file = new File(getExternalFilesDir(null), "DemoFile.jpg");
    return file.exists();
}
```


If you supply a non-null <var translate="no">type</var> to this function, the returned
file will be a path to a sub-directory of the given type. Though these
files are not automatically scanned by the media scanner, you can
explicitly add them to the media database with
`https://developer.android.com/reference/android/media/MediaScannerConnection#scanFile(android.content.Context,%20java.lang.String[],%20java.lang.String[],%20android.media.MediaScannerConnection.OnScanCompletedListener)`. Note that this is not the same as
`https://developer.android.com/reference/android/os/Environment#getExternalStoragePublicDirectory(java.lang.String)`, which provides
directories of media shared by all applications. The directories returned
here are owned by the application, and their contents will be removed
when the application is uninstalled. Unlike
`https://developer.android.com/reference/android/os/Environment#getExternalStoragePublicDirectory(java.lang.String)`, the directory returned
here will be automatically created for you.


Here is an example of typical code to manipulate a picture in an
application's shared storage and add it to the media database:

```
void createExternalStoragePrivatePicture() {
    // Create a path where we will place our picture in our own private
    // pictures directory.  Note that we don't really need to place a
    // picture in DIRECTORY_PICTURES, since the media scanner will see
    // all media in these directories; this may be useful with other
    // media types such as DIRECTORY_MUSIC however to help it classify
    // your media for display to the user.
    File path = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
    File file = new File(path, "DemoPicture.jpg");

    try {
        // Very simple code to copy a picture from the application's
        // resource into the external file.  Note that this code does
        // no error checking, and assumes the picture is small (does not
        // try to copy it in chunks).  Note that if external storage is
        // not currently mounted this will silently fail.
        InputStream is = getResources().openRawResource(R.drawable.balloons);
        OutputStream os = new FileOutputStream(file);
        byte[] data = new byte[is.available()];
        is.read(data);
        os.write(data);
        is.close();
        os.close();

        // Tell the media scanner about the new file so that it is
        // immediately available to the user.
        MediaScannerConnection.scanFile(this,
                new String[] { file.toString() }, null,
                new MediaScannerConnection.OnScanCompletedListener() {
            public void onScanCompleted(String path, Uri uri) {
                Log.i("ExternalStorage", "Scanned " + path + ":");
                Log.i("ExternalStorage", "-> uri=" + uri);
            }
        });
    } catch (IOException e) {
        // Unable to create file, likely because external storage is
        // not currently mounted.
        Log.w("ExternalStorage", "Error writing " + file, e);
    }
}

void deleteExternalStoragePrivatePicture() {
    // Create a path where we will place our picture in the user's
    // public pictures directory and delete the file.  If external
    // storage is not currently mounted this will fail.
    File path = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
    if (path != null) {
        File file = new File(path, "DemoPicture.jpg");
        file.delete();
    }
}

boolean hasExternalStoragePrivatePicture() {
    // Create a path where we will place our picture in the user's
    // public pictures directory and check if the file exists.  If
    // external storage is not currently mounted this will think the
    // picture doesn't exist.
    File path = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
    if (path != null) {
        File file = new File(path, "DemoPicture.jpg");
        return file.exists();
    }
    return false;
}
```

<br />

<br />

| Parameters ||
|---|---|
| `type` | `String`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | This value may be `null`. <br /> |

### getExternalFilesDirs

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File[] getExternalFilesDirs (String type)
```

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application can place
persistent files it owns. These files are internal to the application,
and not typically visible to the user as media.


This is like `https://developer.android.com/reference/android/content/Context#getFilesDir()` in that these files will be deleted
when the application is uninstalled, however there are some important
differences:

- Shared storage may not always be available, since removable media can be ejected by the user. Media state can be checked using `https://developer.android.com/reference/android/os/Environment#getExternalStorageState(java.io.File)`.
- There is no security enforced with these files. For example, any application holding `https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE` can write to these files.


If a shared storage device is emulated (as determined by
`https://developer.android.com/reference/android/os/Environment#isExternalStorageEmulated(java.io.File)`), its contents are
backed by a private user data partition, which means there is little
benefit to storing data here instead of the private directories returned
by `https://developer.android.com/reference/android/content/Context#getFilesDir()`, etc.


Shared storage devices returned here are considered a stable part of the
device, including physical media slots under a protective cover. The
returned paths do not include transient devices, such as USB flash drives
connected to handheld devices.


An application may store data on any or all of the returned devices. For
example, an app may choose to store large files on the device with the
most available space, as measured by `https://developer.android.com/reference/android/os/StatFs`.


No additional permissions are required for the calling app to read or
write files under the returned path. Write access outside of these paths
on secondary external storage devices is not available.


The returned path may change over time if different shared storage media
is inserted, so only relative paths should be persisted.

<br />

| Parameters ||
|---|---|
| `type` | `String`: The type of files directory to return. May be `null` for the root of the files directory or one of the following constants for a subdirectory: `https://developer.android.com/reference/android/os/Environment#DIRECTORY_MUSIC`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_PODCASTS`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_RINGTONES`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_ALARMS`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_NOTIFICATIONS`, `https://developer.android.com/reference/android/os/Environment#DIRECTORY_PICTURES`, or `https://developer.android.com/reference/android/os/Environment#DIRECTORY_MOVIES`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | the absolute paths to application-specific directories. Some individual paths may be `null` if that shared storage is not currently available. The first path returned is the same as `https://developer.android.com/reference/android/content/Context#getExternalFilesDir(java.lang.String)`. <br /> |

### getExternalMediaDirs

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File[] getExternalMediaDirs ()
```


**This method is deprecated.**   

These directories still exist and are scanned, but developers
are encouraged to migrate to inserting content into a
`https://developer.android.com/reference/android/provider/MediaStore` collection directly, as any app can
contribute new media to `https://developer.android.com/reference/android/provider/MediaStore` with no
permissions required, starting in
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q`.

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application can place media
files. These files are scanned and made available to other apps through
`https://developer.android.com/reference/android/provider/MediaStore`.


This is like `https://developer.android.com/reference/android/content/Context#getExternalFilesDirs(java.lang.String)` in that these files will be
deleted when the application is uninstalled, however there are some
important differences:

- Shared storage may not always be available, since removable media can be ejected by the user. Media state can be checked using `https://developer.android.com/reference/android/os/Environment#getExternalStorageState(java.io.File)`.
- There is no security enforced with these files. For example, any application holding `https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE` can write to these files.


Shared storage devices returned here are considered a stable part of the
device, including physical media slots under a protective cover. The
returned paths do not include transient devices, such as USB flash drives
connected to handheld devices.


An application may store data on any or all of the returned devices. For
example, an app may choose to store large files on the device with the
most available space, as measured by `https://developer.android.com/reference/android/os/StatFs`.


No additional permissions are required for the calling app to read or
write files under the returned path. Write access outside of these paths
on secondary external storage devices is not available.


The returned paths may change over time if different shared storage media
is inserted, so only relative paths should be persisted.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | the absolute paths to application-specific directories. Some individual paths may be `null` if that shared storage is not currently available. <br /> |

### getFileStreamPath

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File getFileStreamPath (String name)
```

Returns the absolute path on the filesystem where a file created with
`https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)` is stored.


The returned path may change over time if the calling app is moved to an
adopted storage device, so only relative paths should be persisted.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name of the file for which you would like to get its path. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | An absolute path to the given file. <br /> |

### getFilesDir

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File getFilesDir ()
```

Returns the absolute path to the directory on the filesystem where files
created with `https://developer.android.com/reference/android/content/Context#openFileOutput(java.lang.String,%20int)` are stored.


The returned path may change over time if the calling app is moved to an
adopted storage device, so only relative paths should be persisted.


No additional permissions are required for the calling app to read or
write files under the returned path.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | The path of the directory holding application files. <br /> |

### getMainExecutor

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Executor getMainExecutor ()
```

Return an `https://developer.android.com/reference/java/util/concurrent/Executor` that will run enqueued tasks on the main
thread associated with this context. This is the thread used to dispatch
calls to application components (activities, services, etc).

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/concurrent/Executor` | <br /> |

### getMainLooper

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Looper getMainLooper ()
```

Return the Looper for the main thread of the current process. This is
the thread used to dispatch calls to application components (activities,
services, etc).


By definition, this method returns the same result as would be obtained
by calling `https://developer.android.com/reference/android/os/Looper#getMainLooper()`.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Looper` | The main looper. <br /> |

### getNoBackupFilesDir

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File getNoBackupFilesDir ()
```

Returns the absolute path to the directory on the filesystem similar to
`https://developer.android.com/reference/android/content/Context#getFilesDir()`. The difference is that files placed under this
directory will be excluded from automatic backup to remote storage. See
`https://developer.android.com/reference/android/app/backup/BackupAgent` for a full discussion
of the automatic backup mechanism in Android.


The returned path may change over time if the calling app is moved to an
adopted storage device, so only relative paths should be persisted.


No additional permissions are required for the calling app to read or
write files under the returned path.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | The path of the directory holding application files that will not be automatically backed up to remote storage. <br /> |

### getObbDir

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File getObbDir ()
```

Return the primary shared/external storage directory where this
application's OBB files (if there are any) can be found. Note if the
application does not have any OBB files, this directory may not exist.


This is like `https://developer.android.com/reference/android/content/Context#getFilesDir()` in that these files will be deleted
when the application is uninstalled, however there are some important
differences:

- Shared storage may not always be available, since removable media can be ejected by the user. Media state can be checked using `https://developer.android.com/reference/android/os/Environment#getExternalStorageState(java.io.File)`.
- There is no security enforced with these files. For example, any application holding `https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE` can write to these files.


Starting in `https://developer.android.com/reference/android/os/Build.VERSION_CODES#KITKAT`, no permissions
are required to read or write to the path that this method returns.
However, starting from `https://developer.android.com/reference/android/os/Build.VERSION_CODES#M`,
to read the OBB expansion files, you must declare the
`https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE` permission in the app manifest and ask for
permission at runtime as follows:


`<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="23" />`


Starting from `https://developer.android.com/reference/android/os/Build.VERSION_CODES#N`,
`https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE`
permission is not required, so don\\u2019t ask for this
permission at runtime. To handle both cases, your app must first try to read the OBB file,
and if it fails, you must request
`https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE` permission at runtime.


The following code snippet shows how to do this:

```
File obb = new File(obb_filename);
boolean open_failed = false;

try {
    BufferedReader br = new BufferedReader(new FileReader(obb));
    open_failed = false;
    ReadObbFile(br);
} catch (IOException e) {
    open_failed = true;
}

if (open_failed) {
    // request READ_EXTERNAL_STORAGE permission before reading OBB file
    ReadObbFileWithPermission();
}
```
On devices with multiple users (as described by `https://developer.android.com/reference/android/os/UserManager`), multiple users may share the same OBB storage location. Applications should ensure that multiple instances running under different users don't interfere with each other.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | the absolute path to application-specific directory. May return `null` if shared storage is not currently available. <br /> |

### getObbDirs

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public File[] getObbDirs ()
```

Returns absolute paths to application-specific directories on all
shared/external storage devices where the application's OBB files (if
there are any) can be found. Note if the application does not have any
OBB files, these directories may not exist.


This is like `https://developer.android.com/reference/android/content/Context#getFilesDir()` in that these files will be deleted
when the application is uninstalled, however there are some important
differences:

- Shared storage may not always be available, since removable media can be ejected by the user. Media state can be checked using `https://developer.android.com/reference/android/os/Environment#getExternalStorageState(java.io.File)`.
- There is no security enforced with these files. For example, any application holding `https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE` can write to these files.


Shared storage devices returned here are considered a stable part of the
device, including physical media slots under a protective cover. The
returned paths do not include transient devices, such as USB flash drives
connected to handheld devices.


An application may store data on any or all of the returned devices. For
example, an app may choose to store large files on the device with the
most available space, as measured by `https://developer.android.com/reference/android/os/StatFs`.


No additional permissions are required for the calling app to read or
write files under the returned path. Write access outside of these paths
on secondary external storage devices is not available.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | the absolute paths to application-specific directories. Some individual paths may be `null` if that shared storage is not currently available. The first path returned is the same as `https://developer.android.com/reference/android/content/Context#getObbDir()` <br /> |

### getOpPackageName

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getOpPackageName ()
```

Return the package name that should be used for `https://developer.android.com/reference/android/app/AppOpsManager` calls from
this context, so that app ops manager's uid verification will work with the name.


This is not generally intended for third party application developers.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### getPackageCodePath

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getPackageCodePath ()
```

Return the full path to this context's primary Android package.
The Android package is a ZIP file which contains application's
primary code and assets.

Note: this is not generally useful for applications, since they should
not be directly accessing the file system.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | String Path to the code and assets. <br /> |

### getPackageManager

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public PackageManager getPackageManager ()
```

Return PackageManager instance to find global package information.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/pm/PackageManager` | <br /> |

### getPackageName

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getPackageName ()
```

Return the name of this application's package.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getPackageResourcePath

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getPackageResourcePath ()
```

Return the full path to this context's primary Android package.
The Android package is a ZIP file which contains the application's
primary resources.

Note: this is not generally useful for applications, since they should
not be directly accessing the file system.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | String Path to the resources. <br /> |

### getParams

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ContextParams getParams ()
```

Return the set of parameters which this Context was created with, if it
was created via `https://developer.android.com/reference/android/content/Context#createContext(android.content.ContextParams)`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/ContextParams` | This value may be `null`. <br /> |

### getResources

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Resources getResources ()
```

Returns a Resources instance for the application's package.


**Note:** Implementations of this method should return
a Resources instance that is consistent with the AssetManager instance
returned by `https://developer.android.com/reference/android/content/Context#getAssets()`. For example, they should share the
same `https://developer.android.com/reference/android/content/res/Configuration` object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources` | a Resources instance for the application's package <br /> |

### getSharedPreferences

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SharedPreferences getSharedPreferences (String name, 
                int mode)
```

Retrieve and hold the contents of the preferences file 'name', returning
a SharedPreferences through which you can retrieve and modify its
values. Only one instance of the SharedPreferences object is returned
to any callers for the same name, meaning they will see each other's
edits as soon as they are made.

This method is thread-safe.

If the preferences directory does not already exist, it will be created when this method
is called.

If a preferences file by this name does not exist, it will be created when you retrieve an
editor (`https://developer.android.com/reference/android/content/SharedPreferences#edit()`) and then commit changes (`https://developer.android.com/reference/android/content/SharedPreferences.Editor#commit()` or `https://developer.android.com/reference/android/content/SharedPreferences.Editor#apply()`).

<br />

| Parameters ||
|---|---|
| `name` | `String`: Desired preferences file. <br /> |
| `mode` | `int`: Operating mode. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Context#MODE_PRIVATE` - `https://developer.android.com/reference/android/content/Context#MODE_WORLD_READABLE` - `https://developer.android.com/reference/android/content/Context#MODE_WORLD_WRITEABLE` - `https://developer.android.com/reference/android/content/Context#MODE_MULTI_PROCESS` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/SharedPreferences` | The single `https://developer.android.com/reference/android/content/SharedPreferences` instance that can be used to retrieve and modify the preference values. <br /> |

### getSystemService

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Object getSystemService (String name)
```

Return the handle to a system-level service by name. The class of the returned object varies
by the requested name. Currently available names are:

`https://developer.android.com/reference/android/content/Context#WINDOW_SERVICE` ("window")
:   The top-level window manager in which you can place custom windows. The returned object
    is a `https://developer.android.com/reference/android/view/WindowManager`. Must only be obtained from a visual context
    such as Activity or a Context created with `https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)`,
    which are adjusted to the configuration and visual bounds of an area on screen.

`https://developer.android.com/reference/android/content/Context#LAYOUT_INFLATER_SERVICE` ("layout_inflater")
:   A `https://developer.android.com/reference/android/view/LayoutInflater` for inflating layout resources in this context.
    Must only be obtained from a visual context such as Activity or a Context created with
    `https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)`, which are adjusted to the configuration and
    visual bounds of an area on screen.

`https://developer.android.com/reference/android/content/Context#ACTIVITY_SERVICE` ("activity")
:   A `https://developer.android.com/reference/android/app/ActivityManager` for interacting with the global activity state of
    the system.

`https://developer.android.com/reference/android/content/Context#WALLPAPER_SERVICE` ("wallpaper")
:   A `https://developer.android.com/reference/android/service/wallpaper/WallpaperService` for accessing wallpapers in this
    context. Must only be obtained from a visual context such as Activity or a Context
    created with `https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)`, which are adjusted to the
    configuration and visual bounds of an area on screen.

`https://developer.android.com/reference/android/content/Context#POWER_SERVICE` ("power")
:   A `https://developer.android.com/reference/android/os/PowerManager` for controlling power management.

`https://developer.android.com/reference/android/content/Context#ALARM_SERVICE` ("alarm")
:   A `https://developer.android.com/reference/android/app/AlarmManager` for receiving intents at the time of your choosing.

`https://developer.android.com/reference/android/content/Context#NOTIFICATION_SERVICE` ("notification")
:   A `https://developer.android.com/reference/android/app/NotificationManager` for informing the user of background events.

`https://developer.android.com/reference/android/content/Context#KEYGUARD_SERVICE` ("keyguard")
:   A `https://developer.android.com/reference/android/app/KeyguardManager` for controlling keyguard.

`https://developer.android.com/reference/android/content/Context#LOCATION_SERVICE` ("location")
:   A `https://developer.android.com/reference/android/location/LocationManager` for controlling location (e.g., GPS)
    updates.

`https://developer.android.com/reference/android/content/Context#SEARCH_SERVICE` ("search")
:   A `https://developer.android.com/reference/android/app/SearchManager` for handling search.

`https://developer.android.com/reference/android/content/Context#VIBRATOR_MANAGER_SERVICE` ("vibrator_manager")
:   A `https://developer.android.com/reference/android/os/VibratorManager` for accessing the device vibrators, interacting
    with individual ones and playing synchronized effects on multiple vibrators.

`https://developer.android.com/reference/android/content/Context#MULTISENSORY_MANAGER_SERVICE` ("multisensory_manager")
:   A `https://developer.android.com/reference/android/os/multisensory/MultisensoryManager` for delivering audio-haptic
    feedback in the Multisensory Design System

`https://developer.android.com/reference/android/content/Context#VIBRATOR_SERVICE` ("vibrator")
:   A `https://developer.android.com/reference/android/os/Vibrator` for interacting with the vibrator hardware.

`https://developer.android.com/reference/android/content/Context#CONNECTIVITY_SERVICE` ("connectivity")
:   A `https://developer.android.com/reference/android/net/ConnectivityManager` for handling management
    of network connections.

`https://developer.android.com/reference/android/content/Context#IPSEC_SERVICE` ("ipsec")
:   A `https://developer.android.com/reference/android/net/IpSecManager` for managing IPSec on sockets and
    networks.

`https://developer.android.com/reference/android/content/Context#WIFI_SERVICE` ("wifi")
:   A `https://developer.android.com/reference/android/net/wifi/WifiManager` for management of Wi-Fi
    connectivity. On releases before Android 7, it should only be obtained from an
    application context, and not from any other derived context to avoid memory leaks
    within the calling process.

`https://developer.android.com/reference/android/content/Context#WIFI_AWARE_SERVICE` ("wifiaware")
:   A `https://developer.android.com/reference/android/net/wifi/aware/WifiAwareManager` for management of
    Wi-Fi Aware discovery and connectivity.

`https://developer.android.com/reference/android/content/Context#WIFI_P2P_SERVICE` ("wifip2p")
:   A `https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager` for management of Wi-Fi
    Direct connectivity.

`https://developer.android.com/reference/android/content/Context#INPUT_METHOD_SERVICE` ("input_method")
:   An `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager` for
    management of input methods.

`https://developer.android.com/reference/android/content/Context#UI_MODE_SERVICE` ("uimode")
:   An `https://developer.android.com/reference/android/app/UiModeManager` for controlling UI modes.

`https://developer.android.com/reference/android/content/Context#DOWNLOAD_SERVICE` ("download")
:   A `https://developer.android.com/reference/android/app/DownloadManager` for requesting HTTP downloads

`https://developer.android.com/reference/android/content/Context#BATTERY_SERVICE` ("batterymanager")
:   A `https://developer.android.com/reference/android/os/BatteryManager` for managing battery state

`https://developer.android.com/reference/android/content/Context#JOB_SCHEDULER_SERVICE` ("taskmanager")
:   A `https://developer.android.com/reference/android/app/job/JobScheduler` for managing scheduled tasks

`https://developer.android.com/reference/android/content/Context#NETWORK_STATS_SERVICE` ("netstats")
:   A `https://developer.android.com/reference/android/app/usage/NetworkStatsManager` for querying
    network usage statistics.

`https://developer.android.com/reference/android/content/Context#HARDWARE_PROPERTIES_SERVICE` ("hardware_properties")
:   A `https://developer.android.com/reference/android/os/HardwarePropertiesManager` for accessing hardware properties.

`https://developer.android.com/reference/android/content/Context#DOMAIN_VERIFICATION_SERVICE` ("domain_verification")
:   A `https://developer.android.com/reference/android/content/pm/verify/domain/DomainVerificationManager` for accessing web
    domain approval state.

`https://developer.android.com/reference/android/content/Context#DISPLAY_HASH_SERVICE` ("display_hash")
:   A `https://developer.android.com/reference/android/view/displayhash/DisplayHashManager` for management of display hashes.

`https://developer.android.com/reference/android/content/Context#AUTHENTICATION_POLICY_SERVICE` ("authentication_policy")
:   A `https://developer.android.com/reference/android/security/authenticationpolicy/AuthenticationPolicyManager` for
    managing authentication related policies on the device.

Note: System services obtained via this API may be closely associated with the Context in
which they are obtained from. In general, do not share the service objects between various
different contexts (Activities, Applications, Services, Providers, etc.)

Note: Instant apps, for which `https://developer.android.com/reference/android/content/pm/PackageManager#isInstantApp()` returns true, don't
have access to the following system services: `https://developer.android.com/reference/android/content/Context#DEVICE_POLICY_SERVICE`, `https://developer.android.com/`, `https://developer.android.com/reference/android/content/Context#KEYGUARD_SERVICE`, `https://developer.android.com/reference/android/content/Context#SHORTCUT_SERVICE`, `https://developer.android.com/reference/android/content/Context#USB_SERVICE`, `https://developer.android.com/reference/android/content/Context#WALLPAPER_SERVICE`, `https://developer.android.com/reference/android/content/Context#WIFI_P2P_SERVICE`, `https://developer.android.com/reference/android/content/Context#WIFI_SERVICE`,
`https://developer.android.com/reference/android/content/Context#WIFI_AWARE_SERVICE`. For these services this method will return `null`.
Generally, if you are running as an instant app you should always check whether the result of
this method is `null`.

Note: When implementing this method, keep in mind that new services can be added on newer
Android releases, so if you're looking for just the explicit names mentioned above, make sure
to return `null` when you don't recognize the name --- if you throw a `https://developer.android.com/reference/java/lang/RuntimeException` exception instead, your app might break on new Android releases.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name of the desired service. Value is one of the following: - `https://developer.android.com/reference/android/content/Context#POWER_SERVICE` - `https://developer.android.com/reference/android/content/Context#WINDOW_SERVICE` - `https://developer.android.com/reference/android/content/Context#LAYOUT_INFLATER_SERVICE` - `https://developer.android.com/reference/android/content/Context#ACCOUNT_SERVICE` - `https://developer.android.com/reference/android/content/Context#ACTIVITY_SERVICE` - `https://developer.android.com/reference/android/content/Context#ALARM_SERVICE` - `https://developer.android.com/reference/android/content/Context#NOTIFICATION_SERVICE` - `https://developer.android.com/reference/android/content/Context#ACCESSIBILITY_SERVICE` - `https://developer.android.com/reference/android/content/Context#CAPTIONING_SERVICE` - `https://developer.android.com/reference/android/content/Context#KEYGUARD_SERVICE` - `https://developer.android.com/reference/android/content/Context#LOCATION_SERVICE` - `https://developer.android.com/reference/android/content/Context#HEALTHCONNECT_SERVICE` - `https://developer.android.com/reference/android/content/Context#SEARCH_SERVICE` - `https://developer.android.com/reference/android/content/Context#SENSOR_SERVICE` - `https://developer.android.com/reference/android/content/Context#STORAGE_SERVICE` - `https://developer.android.com/reference/android/content/Context#STORAGE_STATS_SERVICE` - `https://developer.android.com/reference/android/content/Context#WALLPAPER_SERVICE` - `https://developer.android.com/reference/android/content/Context#VIBRATOR_MANAGER_SERVICE` - `https://developer.android.com/reference/android/content/Context#MULTISENSORY_MANAGER_SERVICE` - `https://developer.android.com/reference/android/content/Context#VIBRATOR_SERVICE` - `https://developer.android.com/reference/android/content/Context#CONNECTIVITY_SERVICE` - `https://developer.android.com/reference/android/content/Context#TETHERING_SERVICE` - `https://developer.android.com/reference/android/content/Context#IPSEC_SERVICE` - `https://developer.android.com/reference/android/content/Context#VPN_MANAGEMENT_SERVICE` - `https://developer.android.com/reference/android/content/Context#NETWORK_STATS_SERVICE` - `https://developer.android.com/reference/android/content/Context#WIFI_SERVICE` - `https://developer.android.com/reference/android/content/Context#WIFI_AWARE_SERVICE` - `https://developer.android.com/reference/android/content/Context#WIFI_P2P_SERVICE` - `https://developer.android.com/reference/android/content/Context#WIFI_RTT_RANGING_SERVICE` - `https://developer.android.com/reference/android/content/Context#NSD_SERVICE` - `https://developer.android.com/reference/android/content/Context#AUDIO_SERVICE` - `https://developer.android.com/reference/android/content/Context#BIOMETRIC_SERVICE` - `https://developer.android.com/reference/android/content/Context#AUTHENTICATION_POLICY_SERVICE` - `https://developer.android.com/reference/android/content/Context#MEDIA_ROUTER_SERVICE` - `https://developer.android.com/reference/android/content/Context#TELEPHONY_SERVICE` - `https://developer.android.com/reference/android/content/Context#TELEPHONY_SUBSCRIPTION_SERVICE` - `https://developer.android.com/reference/android/content/Context#TELEPHONY_PHONE_NUMBER_SERVICE` - `https://developer.android.com/reference/android/content/Context#CARRIER_CONFIG_SERVICE` - `https://developer.android.com/reference/android/content/Context#EUICC_SERVICE` - `https://developer.android.com/reference/android/content/Context#TELECOM_SERVICE` - `https://developer.android.com/reference/android/content/Context#CLIPBOARD_SERVICE` - `https://developer.android.com/reference/android/content/Context#INPUT_METHOD_SERVICE` - `https://developer.android.com/reference/android/content/Context#TEXT_SERVICES_MANAGER_SERVICE` - `https://developer.android.com/reference/android/content/Context#TEXT_CLASSIFICATION_SERVICE` - `https://developer.android.com/reference/android/content/Context#APPWIDGET_SERVICE` - `https://developer.android.com/reference/android/content/Context#DROPBOX_SERVICE` - `https://developer.android.com/reference/android/content/Context#DEVICE_POLICY_SERVICE` - `https://developer.android.com/reference/android/content/Context#UI_MODE_SERVICE` - `https://developer.android.com/reference/android/content/Context#DOWNLOAD_SERVICE` - `https://developer.android.com/reference/android/content/Context#NFC_SERVICE` - `https://developer.android.com/reference/android/content/Context#BLUETOOTH_SERVICE` - `https://developer.android.com/reference/android/content/Context#USB_SERVICE` - `https://developer.android.com/reference/android/content/Context#LAUNCHER_APPS_SERVICE` - `https://developer.android.com/reference/android/content/Context#SERIAL_SERVICE` - `https://developer.android.com/reference/android/content/Context#INPUT_SERVICE` - `https://developer.android.com/reference/android/content/Context#DISPLAY_SERVICE` - `https://developer.android.com/reference/android/content/Context#USER_SERVICE` - `https://developer.android.com/reference/android/content/Context#RESTRICTIONS_SERVICE` - `https://developer.android.com/reference/android/content/Context#APP_OPS_SERVICE` - `https://developer.android.com/reference/android/content/Context#ROLE_SERVICE` - `https://developer.android.com/reference/android/content/Context#CAMERA_SERVICE` - `https://developer.android.com/reference/android/content/Context#PRINT_SERVICE` - `https://developer.android.com/reference/android/content/Context#CONSUMER_IR_SERVICE` - `https://developer.android.com/reference/android/content/Context#TV_INTERACTIVE_APP_SERVICE` - `https://developer.android.com/reference/android/content/Context#TV_INPUT_SERVICE` - `https://developer.android.com/reference/android/content/Context#USAGE_STATS_SERVICE` - `https://developer.android.com/reference/android/content/Context#MEDIA_SESSION_SERVICE` - `https://developer.android.com/reference/android/content/Context#MEDIA_COMMUNICATION_SERVICE` - `https://developer.android.com/reference/android/content/Context#BATTERY_SERVICE` - `https://developer.android.com/reference/android/content/Context#JOB_SCHEDULER_SERVICE` - `https://developer.android.com/reference/android/content/Context#PERSISTENT_DATA_BLOCK_SERVICE` - `https://developer.android.com/reference/android/content/Context#MEDIA_PROJECTION_SERVICE` - `https://developer.android.com/reference/android/content/Context#MIDI_SERVICE` - `https://developer.android.com/reference/android/content/Context#HARDWARE_PROPERTIES_SERVICE` - `https://developer.android.com/reference/android/content/Context#SHORTCUT_SERVICE` - `https://developer.android.com/reference/android/content/Context#SYSTEM_HEALTH_SERVICE` - `https://developer.android.com/reference/android/content/Context#COMPANION_DEVICE_SERVICE` - `https://developer.android.com/reference/android/content/Context#VIRTUAL_DEVICE_SERVICE` - `https://developer.android.com/reference/android/content/Context#CROSS_PROFILE_APPS_SERVICE` - `https://developer.android.com/reference/android/content/Context#LOCALE_SERVICE` - `https://developer.android.com/reference/android/content/Context#MEDIA_METRICS_SERVICE` - `https://developer.android.com/reference/android/content/Context#DISPLAY_HASH_SERVICE` - `https://developer.android.com/reference/android/content/Context#CREDENTIAL_SERVICE` - `https://developer.android.com/reference/android/content/Context#DEVICE_LOCK_SERVICE` - `https://developer.android.com/reference/android/content/Context#GRAMMATICAL_INFLECTION_SERVICE` - `https://developer.android.com/reference/android/content/Context#SECURITY_STATE_SERVICE` - `https://developer.android.com/reference/android/content/Context#CONTACT_KEYS_SERVICE` - `https://developer.android.com/reference/android/content/Context#MEDIA_QUALITY_SERVICE` - `https://developer.android.com/reference/android/content/Context#ADVANCED_PROTECTION_SERVICE` - `https://developer.android.com/reference/android/content/Context#NPU_SERVICE` - `https://developer.android.com/reference/android/content/Context#WEB_APP_SERVICE` - `https://developer.android.com/reference/android/content/Context#HID_SERVICE` - `https://developer.android.com/reference/android/content/Context#MEMORY_BUDGET_SERVICE` . This value cannot be `null`. |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | The service or `null` if the name does not exist. <br /> |

### getSystemServiceName

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getSystemServiceName (Class<?> serviceClass)
```

Gets the name of the system-level service that is represented by the specified class.

<br />

| Parameters ||
|---|---|
| `serviceClass` | `Class`: The class of the desired service. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The service name or null if the class is not a supported system service. <br /> |

### getTheme

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Resources.Theme getTheme ()
```

Return the Theme object associated with this Context.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/Resources.Theme` | <br /> |

### getWallpaper

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Drawable getWallpaper ()
```


**This method is deprecated.**   

Use `https://developer.android.com/reference/android/app/WallpaperManager#getDrawable()` instead.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | <br /> |

### getWallpaperDesiredMinimumHeight

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getWallpaperDesiredMinimumHeight ()
```


**This method is deprecated.**   

Use `https://developer.android.com/reference/android/app/WallpaperManager#getDesiredMinimumHeight()` instead.

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getWallpaperDesiredMinimumWidth

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getWallpaperDesiredMinimumWidth ()
```


**This method is deprecated.**   

Use `https://developer.android.com/reference/android/app/WallpaperManager#getDesiredMinimumWidth()` instead.

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### grantUriPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void grantUriPermission (String toPackage, 
                Uri uri, 
                int modeFlags)
```

Grant permission to access a specific Uri to another package, regardless
of whether that package has general permission to access the Uri's
content provider. This can be used to grant specific, temporary
permissions, typically in response to user interaction (such as the
user opening an attachment that you would like someone else to
display).

Normally you should use `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` or
`https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` with the Intent being used to
start an activity instead of this function directly. If you use this
function directly, you should be sure to call
`https://developer.android.com/reference/android/content/Context#revokeUriPermission(android.net.Uri,%20int)` when the target should no longer be allowed
to access it.

To succeed, the content provider owning the Uri must have set the
`https://developer.android.com/reference/android/R.styleable#AndroidManifestProvider_grantUriPermissions` attribute in its manifest or included the
`https://developer.android.com/reference/android/R.styleable#AndroidManifestGrantUriPermission` tag.

<br />

| Parameters ||
|---|---|
| `toPackage` | `String`: The package you would like to allow to access the Uri. <br /> |
| `uri` | `Uri`: The Uri you would like to grant access to. <br /> |
| `modeFlags` | `int`: The desired access modes. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_PERSISTABLE_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_PREFIX_URI_PERMISSION` |

### isDeviceProtectedStorage

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isDeviceProtectedStorage ()
```

Indicates if the storage APIs of this Context are backed by
device-protected storage.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isRestricted

Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isRestricted ()
```

Indicates whether this Context is restricted.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if this Context is restricted, `false` otherwise. <br /> |

### isUiContext

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isUiContext ()
```

Returns `true` if the context is a UI context which can access UI components such as
`https://developer.android.com/reference/android/view/WindowManager`, `https://developer.android.com/reference/android/view/LayoutInflater` or
`https://developer.android.com/reference/android/app/WallpaperManager`. Accessing UI components from non-UI
contexts throws `https://developer.android.com/reference/android/os/strictmode/Violation` if
`https://developer.android.com/reference/android/os/StrictMode.VmPolicy.Builder#detectIncorrectContextUse()` is enabled.


Examples of UI contexts are
an `https://developer.android.com/reference/android/app/Activity`, a context created from
`https://developer.android.com/reference/android/content/Context#createWindowContext(int,%20android.os.Bundle)` or
`https://developer.android.com/reference/android/inputmethodservice/InputMethodService`


Note that even if it is allowed programmatically, it is not suggested to override this
method to bypass `https://developer.android.com/reference/android/os/strictmode/IncorrectContextUseViolation` verification.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### moveDatabaseFrom

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean moveDatabaseFrom (Context sourceContext, 
                String name)
```

Move an existing database file from the given source storage context to
this context. This is typically used to migrate data between storage
locations after an upgrade, such as migrating to device protected
storage.


The database must be closed before being moved.

<br />

| Parameters ||
|---|---|
| `sourceContext` | `Context`: The source context which contains the existing database to move. <br /> |
| `name` | `String`: The name of the database file. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the move was successful or if the database didn't exist in the source context, otherwise `false`. <br /> |

### moveSharedPreferencesFrom

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean moveSharedPreferencesFrom (Context sourceContext, 
                String name)
```

Move an existing shared preferences file from the given source storage
context to this context. This is typically used to migrate data between
storage locations after an upgrade, such as moving to device protected
storage.

<br />

| Parameters ||
|---|---|
| `sourceContext` | `Context`: The source context which contains the existing shared preferences to move. <br /> |
| `name` | `String`: The name of the shared preferences file. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the move was successful or if the shared preferences didn't exist in the source context, otherwise `false`. <br /> |

### openFileInput

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FileInputStream openFileInput (String name)
```

Open a private file associated with this Context's application package
for reading.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name of the file to open; can not contain path separators. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/FileInputStream` | The resulting `https://developer.android.com/reference/java/io/FileInputStream`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/FileNotFoundException` |   |

### openFileOutput

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FileOutputStream openFileOutput (String name, 
                int mode)
```

Open a private file associated with this Context's application package
for writing. Creates the file if it doesn't already exist.


No additional permissions are required for the calling app to read or
write the returned file.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name of the file to open; can not contain path separators. <br /> |
| `mode` | `int`: Operating mode. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Context#MODE_PRIVATE` - `https://developer.android.com/reference/android/content/Context#MODE_WORLD_READABLE` - `https://developer.android.com/reference/android/content/Context#MODE_WORLD_WRITEABLE` - `https://developer.android.com/reference/android/content/Context#MODE_APPEND` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/FileOutputStream` | The resulting `https://developer.android.com/reference/java/io/FileOutputStream`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/FileNotFoundException` |   |

### openOrCreateDatabase

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SQLiteDatabase openOrCreateDatabase (String name, 
                int mode, 
                SQLiteDatabase.CursorFactory factory, 
                DatabaseErrorHandler errorHandler)
```

Open a new private SQLiteDatabase associated with this Context's
application package. Creates the database file if it doesn't exist.


Accepts input param: a concrete instance of `https://developer.android.com/reference/android/database/DatabaseErrorHandler`
to be used to handle corruption when sqlite reports database corruption.

<br />

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name (unique in the application package) of the database. <br /> |
| `mode` | `int`: Operating mode. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Context#MODE_PRIVATE` - `https://developer.android.com/reference/android/content/Context#MODE_WORLD_READABLE` - `https://developer.android.com/reference/android/content/Context#MODE_WORLD_WRITEABLE` - `https://developer.android.com/reference/android/content/Context#MODE_ENABLE_WRITE_AHEAD_LOGGING` - `https://developer.android.com/reference/android/content/Context#MODE_NO_LOCALIZED_COLLATORS` |
| `factory` | `SQLiteDatabase.CursorFactory`: An optional factory class that is called to instantiate a cursor when query is called. <br /> |
| `errorHandler` | `DatabaseErrorHandler`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase` | The contents of a newly created database with the given name. <br /> |

### openOrCreateDatabase

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SQLiteDatabase openOrCreateDatabase (String name, 
                int mode, 
                SQLiteDatabase.CursorFactory factory)
```

Open a new private SQLiteDatabase associated with this Context's
application package. Create the database file if it doesn't exist.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name (unique in the application package) of the database. <br /> |
| `mode` | `int`: Operating mode. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Context#MODE_PRIVATE` - `https://developer.android.com/reference/android/content/Context#MODE_WORLD_READABLE` - `https://developer.android.com/reference/android/content/Context#MODE_WORLD_WRITEABLE` - `https://developer.android.com/reference/android/content/Context#MODE_ENABLE_WRITE_AHEAD_LOGGING` - `https://developer.android.com/reference/android/content/Context#MODE_NO_LOCALIZED_COLLATORS` |
| `factory` | `SQLiteDatabase.CursorFactory`: An optional factory class that is called to instantiate a cursor when query is called. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase` | The contents of a newly created database with the given name. <br /> |

### peekWallpaper

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Drawable peekWallpaper ()
```


**This method is deprecated.**   

Use `https://developer.android.com/reference/android/app/WallpaperManager#peekDrawable()` instead.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | <br /> |

### rebindService

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void rebindService (ServiceConnection conn, 
                Context.BindServiceFlags flags)
```

Rebind an application service with updated bind service flags

<br />

| Parameters ||
|---|---|
| `conn` | `ServiceConnection`: This value cannot be `null`. <br /> |
| `flags` | `Context.BindServiceFlags`: This value cannot be `null`. <br /> |

### registerComponentCallbacks

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void registerComponentCallbacks (ComponentCallbacks callback)
```

Add a new `https://developer.android.com/reference/android/content/ComponentCallbacks` to the base application of the
Context, which will be called at the same times as the ComponentCallbacks
methods of activities and other components are called. Note that you
*must* be sure to use `https://developer.android.com/reference/android/content/ContextWrapper#unregisterComponentCallbacks(android.content.ComponentCallbacks)` when
appropriate in the future; this will not be removed for you.


After `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`, the `https://developer.android.com/reference/android/content/ComponentCallbacks` will be registered
to `https://developer.android.com/reference/android/content/ContextWrapper#getBaseContext()`, and can be only used after
`https://developer.android.com/reference/android/content/ContextWrapper#attachBaseContext(android.content.Context)`. Users can still call to
`getApplicationContext().registerComponentCallbacks(ComponentCallbacks)` to add
`https://developer.android.com/reference/android/content/ComponentCallbacks` to the base application.

<br />

| Parameters ||
|---|---|
| `callback` | `ComponentCallbacks`: The interface to call. This can be either a `https://developer.android.com/reference/android/content/ComponentCallbacks` or `https://developer.android.com/reference/android/content/ComponentCallbacks2` interface. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if this method calls before `https://developer.android.com/reference/android/content/ContextWrapper#attachBaseContext(android.content.Context)` |

### registerDeviceIdChangeListener

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void registerDeviceIdChangeListener (Executor executor, 
                IntConsumer listener)
```

Adds a new device ID changed listener to the `Context`, which will be called when
the device association is changed by the system.


The callback can be called when an app is moved to a different device and the `Context`
is not explicitly associated with a specific device.

When an application receives a device id update callback, this Context is guaranteed to
also have an updated display ID(if any) and `https://developer.android.com/reference/android/content/res/Configuration`.

<br />

<br />

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `listener` | `IntConsumer`: This value cannot be `null`. <br /> |

### registerReceiver

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Intent registerReceiver (BroadcastReceiver receiver, 
                IntentFilter filter)
```

Register a BroadcastReceiver to be run in the main activity thread. The
<var translate="no">receiver</var> will be called with any broadcast Intent that
matches <var translate="no">filter</var>, in the main application thread.

The system may broadcast Intents that are "sticky" -- these stay
around after the broadcast has finished, to be sent to any later
registrations. If your IntentFilter matches one of these sticky
Intents, that Intent will be returned by this function
**and** sent to your <var translate="no">receiver</var> as if it had just
been broadcast.

There may be multiple sticky Intents that match <var translate="no">filter</var>,
in which case each of these will be sent to <var translate="no">receiver</var>. In
this case, only one of these can be returned directly by the function;
which of these that is returned is arbitrarily decided by the system.

If you know the Intent you are registering for is sticky, you can
supply null for your <var translate="no">receiver</var>. In this case, no receiver is
registered -- the function simply returns the sticky Intent that
matches <var translate="no">filter</var>. In the case of multiple matches, the same
rules as described above apply.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

As of `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE`, the system can [place
context-registered broadcasts in a queue while the app is in the](https://developer.android.com/develop/background-work/background-tasks/broadcasts#android-14)[cached state](https://developer.android.com/guide/components/activities/process-lifecycle).
When the app leaves the cached state, such as returning to the
foreground, the system delivers any queued broadcasts. Multiple instances
of certain broadcasts might be merged into one broadcast.

As of `https://developer.android.com/reference/android/os/Build.VERSION_CODES#ICE_CREAM_SANDWICH`, receivers
registered with this method will correctly respect the
`https://developer.android.com/reference/android/content/Intent#setPackage(java.lang.String)` specified for an Intent being broadcast.
Prior to that, it would be ignored and delivered to all matching registered
receivers. Be careful if using this for security.

For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE`,
either `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED` or `https://developer.android.com/reference/android/content/Context#RECEIVER_NOT_EXPORTED` must be
specified if the receiver is not being registered for [system broadcasts](https://developer.android.com/guide/components/broadcasts#system-broadcasts)
or a `https://developer.android.com/reference/java/lang/SecurityException` will be thrown. See `https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20int)` to register a receiver with
flags.

Note: this method *cannot be called from a
`https://developer.android.com/reference/android/content/BroadcastReceiver` component;* that is, from a BroadcastReceiver
that is declared in an application's manifest. It is okay, however, to call
this method from another BroadcastReceiver that has itself been registered
at run time with `https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)`, since the lifetime of such a
registered BroadcastReceiver is tied to the object that registered it.

<br />

<br />

| Parameters ||
|---|---|
| `receiver` | `BroadcastReceiver`: This value may be `null`. <br /> |
| `filter` | `IntentFilter`: Selects the Intent broadcasts to be received. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Intent` | The first sticky intent found that matches <var translate="no">filter</var>, or null if there are none. <br /> |

### registerReceiver

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Intent registerReceiver (BroadcastReceiver receiver, 
                IntentFilter filter, 
                int flags)
```

Register to receive intent broadcasts, with the receiver optionally being
exposed to Instant Apps. See
`https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)` for more
information. By default Instant Apps cannot interact with receivers in other
applications, this allows you to expose a receiver that Instant Apps can
interact with.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

As of `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE`, the system can [place
context-registered broadcasts in a queue while the app is in the](https://developer.android.com/develop/background-work/background-tasks/broadcasts#android-14)[cached state](https://developer.android.com/guide/components/activities/process-lifecycle).
When the app leaves the cached state, such as returning to the
foreground, the system delivers any queued broadcasts. Multiple instances
of certain broadcasts might be merged into one broadcast.

As of `https://developer.android.com/reference/android/os/Build.VERSION_CODES#ICE_CREAM_SANDWICH`, receivers
registered with this method will correctly respect the
`https://developer.android.com/reference/android/content/Intent#setPackage(java.lang.String)` specified for an Intent being broadcast.
Prior to that, it would be ignored and delivered to all matching registered
receivers. Be careful if using this for security.

<br />

<br />

| Parameters ||
|---|---|
| `receiver` | `BroadcastReceiver`: This value may be `null`. <br /> |
| `filter` | `IntentFilter`: Selects the Intent broadcasts to be received. <br /> |
| `flags` | `int`: Additional options for the receiver. For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` either `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED` or `https://developer.android.com/reference/android/content/Context#RECEIVER_NOT_EXPORTED` must be specified if the receiver isn't being registered for [system broadcasts](https://developer.android.com/guide/components/broadcasts#system-broadcasts) or a `https://developer.android.com/reference/java/lang/SecurityException` will be thrown. If `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED` is specified, a receiver may additionally specify `https://developer.android.com/reference/android/content/Context#RECEIVER_VISIBLE_TO_INSTANT_APPS`. For a complete list of system broadcast actions, see the BROADCAST_ACTIONS.TXT file in the Android SDK. If both `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED` and `https://developer.android.com/reference/android/content/Context#RECEIVER_NOT_EXPORTED` are specified, an `https://developer.android.com/reference/java/lang/IllegalArgumentException` will be thrown. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Context#RECEIVER_VISIBLE_TO_INSTANT_APPS` - `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED` - `https://developer.android.com/reference/android/content/Context#RECEIVER_NOT_EXPORTED` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Intent` | The first sticky intent found that matches <var translate="no">filter</var>, or null if there are none. <br /> |

### registerReceiver

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Intent registerReceiver (BroadcastReceiver receiver, 
                IntentFilter filter, 
                String broadcastPermission, 
                Handler scheduler, 
                int flags)
```

Register to receive intent broadcasts, to run in the context of
<var translate="no">scheduler</var>. See
`https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20int)` and
`https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler)`
for more information.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

As of `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE`, the system can [place
context-registered broadcasts in a queue while the app is in the](https://developer.android.com/develop/background-work/background-tasks/broadcasts#android-14)[cached state](https://developer.android.com/guide/components/activities/process-lifecycle).
When the app leaves the cached state, such as returning to the
foreground, the system delivers any queued broadcasts. Multiple instances
of certain broadcasts might be merged into one broadcast.

As of `https://developer.android.com/reference/android/os/Build.VERSION_CODES#ICE_CREAM_SANDWICH`, receivers
registered with this method will correctly respect the
`https://developer.android.com/reference/android/content/Intent#setPackage(java.lang.String)` specified for an Intent being broadcast.
Prior to that, it would be ignored and delivered to all matching registered
receivers. Be careful if using this for security.

<br />

<br />

| Parameters ||
|---|---|
| `receiver` | `BroadcastReceiver`: This value may be `null`. <br /> |
| `filter` | `IntentFilter`: Selects the Intent broadcasts to be received. <br /> |
| `broadcastPermission` | `String`: This value may be `null`. <br /> |
| `scheduler` | `Handler`: This value may be `null`. <br /> |
| `flags` | `int`: Additional options for the receiver. For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` either `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED` or `https://developer.android.com/reference/android/content/Context#RECEIVER_NOT_EXPORTED` must be specified if the receiver isn't being registered for [system broadcasts](https://developer.android.com/guide/components/broadcasts#system-broadcasts) or a `https://developer.android.com/reference/java/lang/SecurityException` will be thrown. If `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED` is specified, a receiver may additionally specify `https://developer.android.com/reference/android/content/Context#RECEIVER_VISIBLE_TO_INSTANT_APPS`. For a complete list of system broadcast actions, see the BROADCAST_ACTIONS.TXT file in the Android SDK. If both `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED` and `https://developer.android.com/reference/android/content/Context#RECEIVER_NOT_EXPORTED` are specified, an `https://developer.android.com/reference/java/lang/IllegalArgumentException` will be thrown. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Context#RECEIVER_VISIBLE_TO_INSTANT_APPS` - `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED` - `https://developer.android.com/reference/android/content/Context#RECEIVER_NOT_EXPORTED` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Intent` | The first sticky intent found that matches <var translate="no">filter</var>, or null if there are none. <br /> |

### registerReceiver

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Intent registerReceiver (BroadcastReceiver receiver, 
                IntentFilter filter, 
                String broadcastPermission, 
                Handler scheduler)
```

Register to receive intent broadcasts, to run in the context of
<var translate="no">scheduler</var>. See
`https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)` for more
information. This allows you to enforce permissions on who can
broadcast intents to your receiver, or have the receiver run in
a different thread than the main application thread.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

As of `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE`, the system can [place
context-registered broadcasts in a queue while the app is in the](https://developer.android.com/develop/background-work/background-tasks/broadcasts#android-14)[cached state](https://developer.android.com/guide/components/activities/process-lifecycle).
When the app leaves the cached state, such as returning to the
foreground, the system delivers any queued broadcasts. Multiple instances
of certain broadcasts might be merged into one broadcast.

As of `https://developer.android.com/reference/android/os/Build.VERSION_CODES#ICE_CREAM_SANDWICH`, receivers
registered with this method will correctly respect the
`https://developer.android.com/reference/android/content/Intent#setPackage(java.lang.String)` specified for an Intent being broadcast.
Prior to that, it would be ignored and delivered to all matching registered
receivers. Be careful if using this for security.

For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE`,
either `https://developer.android.com/reference/android/content/Context#RECEIVER_EXPORTED` or `https://developer.android.com/reference/android/content/Context#RECEIVER_NOT_EXPORTED` must be
specified if the receiver is not being registered for [system broadcasts](https://developer.android.com/guide/components/broadcasts#system-broadcasts)
or a `https://developer.android.com/reference/java/lang/SecurityException` will be thrown. See `https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter,%20java.lang.String,%20android.os.Handler,%20int)` to register a
receiver with flags.

<br />

| Parameters ||
|---|---|
| `receiver` | `BroadcastReceiver`: This value may be `null`. <br /> |
| `filter` | `IntentFilter`: Selects the Intent broadcasts to be received. <br /> |
| `broadcastPermission` | `String`: This value may be `null`. <br /> |
| `scheduler` | `Handler`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Intent` | The first sticky intent found that matches <var translate="no">filter</var>, or null if there are none. <br /> |

### removeStickyBroadcast

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void removeStickyBroadcast (Intent intent)
```


**This method is deprecated.**   

Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.

<br />

Remove the data previously sent with `https://developer.android.com/reference/android/content/Context#sendStickyBroadcast(android.content.Intent)`,
so that it is as if the sticky broadcast had never happened.


Requires `https://developer.android.com/reference/android/Manifest.permission#BROADCAST_STICKY`

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent that was previously broadcast. <br /> |

### removeStickyBroadcastAsUser

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void removeStickyBroadcastAsUser (Intent intent, 
                UserHandle user)
```


**This method is deprecated.**   

Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.

<br />

Version of `https://developer.android.com/reference/android/content/Context#removeStickyBroadcast(android.content.Intent)` that allows you to specify the
user the broadcast will be sent to. This is not available to applications
that are not pre-installed on the system image.

You must hold the `https://developer.android.com/reference/android/Manifest.permission#BROADCAST_STICKY`
permission in order to use this API. If you do not hold that
permission, `https://developer.android.com/reference/java/lang/SecurityException` will be thrown.


Requires android.Manifest.permission.INTERACT_ACROSS_USERS and `https://developer.android.com/reference/android/Manifest.permission#BROADCAST_STICKY`

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent that was previously broadcast. <br /> |
| `user` | `UserHandle`: UserHandle to remove the sticky broadcast from. <br /> |

### revokeSelfPermissionsOnKill

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void revokeSelfPermissionsOnKill (Collection<String> permissions)
```

Triggers the revocation of one or more permissions for the calling package. A package is only
able to revoke runtime permissions. If a permission is not currently granted, it is ignored
and will not get revoked (even if later granted by the user). Ultimately, you should never
make assumptions about a permission status as users may grant or revoke them at any time.


Background permissions which have no corresponding foreground permission still granted once
the revocation is effective will also be revoked.


The revocation happens asynchronously and kills all processes running in the calling UID. It
will be triggered once it is safe to do so. In particular, it will not be triggered as long
as the package remains in the foreground, or has any active manifest components (e.g. when
another app is accessing a content provider in the package).


If you want to revoke the permissions right away, you could call `System.exit()` in
`Handler.postDelayed` with a delay to allow completion of async IPC, But
`System.exit()` could affect other apps that are accessing your app at the moment.
For example, apps accessing a content provider in your app will all crash.


Note that the settings UI shows a permission group as granted as long as at least one
permission in the group is granted. If you want the user to observe the revocation in the
settings, you should revoke every permission in the target group. To learn the current list
of permissions in a group, you may use
`https://developer.android.com/reference/android/content/pm/PackageManager#getGroupOfPlatformPermission(java.lang.String,%20java.util.concurrent.Executor,%20java.util.function.Consumer<java.lang.String>)` and
`https://developer.android.com/reference/android/content/pm/PackageManager#getPlatformPermissionsForGroup(java.lang.String,%20java.util.concurrent.Executor,%20java.util.function.Consumer<java.util.List<java.lang.String>>)`. This list
of permissions may evolve over time, so it is recommended to check whether it contains any
permission you wish to retain before trying to revoke an entire group.

<br />

| Parameters ||
|---|---|
| `permissions` | `Collection`: This value cannot be `null`. <br /> |

### revokeUriPermission

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void revokeUriPermission (Uri uri, 
                int modeFlags)
```

Remove all permissions to access a particular content provider Uri
that were previously added with `https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)` or *any other* mechanism.
The given Uri will match all previously granted Uris that are the same or a
sub-path of the given Uri. That is, revoking "content://foo/target" will
revoke both "content://foo/target" and "content://foo/target/sub", but not
"content://foo". It will not remove any prefix grants that exist at a
higher level.

Prior to `https://developer.android.com/reference/android/os/Build.VERSION_CODES#LOLLIPOP`, if you did not have
regular permission access to a Uri, but had received access to it through
a specific Uri permission grant, you could not revoke that grant with this
function and a `https://developer.android.com/reference/java/lang/SecurityException` would be thrown. As of
`https://developer.android.com/reference/android/os/Build.VERSION_CODES#LOLLIPOP`, this function will not throw a security
exception, but will remove whatever permission grants to the Uri had been given to the app
(or none).

Unlike `https://developer.android.com/reference/android/content/Context#revokeUriPermission(java.lang.String,%20android.net.Uri,%20int)`, this method impacts all permission
grants matching the given Uri, for any package they had been granted to, through any
mechanism this had happened (such as indirectly through the clipboard, activity launch,
service start, etc). That means this can be potentially dangerous to use, as it can
revoke grants that another app could be strongly expecting to stick around.

<br />

<br />

| Parameters ||
|---|---|
| `uri` | `Uri`: The Uri you would like to revoke access to. <br /> |
| `modeFlags` | `int`: The access modes to revoke. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |

### revokeUriPermission

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void revokeUriPermission (String targetPackage, 
                Uri uri, 
                int modeFlags)
```

Remove permissions to access a particular content provider Uri
that were previously added with `https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)` for a specific target
package. The given Uri will match all previously granted Uris that are the same or a
sub-path of the given Uri. That is, revoking "content://foo/target" will
revoke both "content://foo/target" and "content://foo/target/sub", but not
"content://foo". It will not remove any prefix grants that exist at a
higher level.

Unlike `https://developer.android.com/reference/android/content/Context#revokeUriPermission(android.net.Uri,%20int)`, this method will *only*
revoke permissions that had been explicitly granted through `https://developer.android.com/reference/android/content/Context#grantUriPermission(java.lang.String,%20android.net.Uri,%20int)`
and only for the package specified. Any matching grants that have happened through
other mechanisms (clipboard, activity launching, service starting, etc) will not be
removed.

<br />

<br />

| Parameters ||
|---|---|
| `targetPackage` | `String`: The package you had previously granted access to. <br /> |
| `uri` | `Uri`: The Uri you would like to revoke access to. <br /> |
| `modeFlags` | `int`: The access modes to revoke. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` - `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_WRITE_URI_PERMISSION` |

### sendBroadcast

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendBroadcast (Intent intent, 
                String receiverPermission, 
                Bundle options)
```

Broadcast the given intent to all interested BroadcastReceivers, allowing
an optional required permission to be enforced. This
call is asynchronous; it returns immediately, and you will continue
executing while the receivers are run. No results are propagated from
receivers and receivers can not abort the broadcast. If you want
to allow receivers to propagate results or abort the broadcast, you must
send an ordered broadcast using
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)`.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: This value cannot be `null`. <br /> |
| `receiverPermission` | `String`: This value may be `null`. <br /> |
| `options` | `Bundle`: This value may be `null`. <br /> |

### sendBroadcast

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendBroadcast (Intent intent, 
                String receiverPermission)
```

Broadcast the given intent to all interested BroadcastReceivers, allowing
an optional required permission to be enforced. This
call is asynchronous; it returns immediately, and you will continue
executing while the receivers are run. No results are propagated from
receivers and receivers can not abort the broadcast. If you want
to allow receivers to propagate results or abort the broadcast, you must
send an ordered broadcast using
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)`.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent to broadcast; all receivers matching this Intent will receive the broadcast. <br /> |
| `receiverPermission` | `String`: This value may be `null`. <br /> |

### sendBroadcast

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendBroadcast (Intent intent)
```

Broadcast the given intent to all interested BroadcastReceivers. This
call is asynchronous; it returns immediately, and you will continue
executing while the receivers are run. No results are propagated from
receivers and receivers can not abort the broadcast. If you want
to allow receivers to propagate results or abort the broadcast, you must
send an ordered broadcast using
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)`.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent to broadcast; all receivers matching this Intent will receive the broadcast. <br /> |

### sendBroadcastAsUser

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendBroadcastAsUser (Intent intent, 
                UserHandle user)
```

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to specify the
user the broadcast will be sent to. This is not available to applications
that are not pre-installed on the system image.


Requires android.Manifest.permission.INTERACT_ACROSS_USERS

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The intent to broadcast <br /> |
| `user` | `UserHandle`: UserHandle to send the intent to. <br /> |

### sendBroadcastAsUser

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendBroadcastAsUser (Intent intent, 
                UserHandle user, 
                String receiverPermission)
```

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent,%20java.lang.String)` that allows you to specify the
user the broadcast will be sent to. This is not available to applications
that are not pre-installed on the system image.


Requires android.Manifest.permission.INTERACT_ACROSS_USERS

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent to broadcast; all receivers matching this Intent will receive the broadcast. <br /> |
| `user` | `UserHandle`: UserHandle to send the intent to. <br /> |
| `receiverPermission` | `String`: (optional) String naming a permission that a receiver must hold in order to receive your broadcast. If null, no permission is required. <br /> |

### sendOrderedBroadcast

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendOrderedBroadcast (Intent intent, 
                String receiverPermission, 
                String receiverAppOp, 
                BroadcastReceiver resultReceiver, 
                Handler scheduler, 
                int initialCode, 
                String initialData, 
                Bundle initialExtras)
```

Version of
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)` that allows you to specify the App Op to enforce restrictions on which receivers
the broadcast will be sent to.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: This value cannot be `null`. <br /> |
| `receiverPermission` | `String`: This value may be `null`. <br /> |
| `receiverAppOp` | `String`: This value may be `null`. <br /> |
| `resultReceiver` | `BroadcastReceiver`: This value may be `null`. <br /> |
| `scheduler` | `Handler`: This value may be `null`. <br /> |
| `initialCode` | `int`: An initial value for the result code. Often Activity.RESULT_OK. <br /> |
| `initialData` | `String`: This value may be `null`. <br /> |
| `initialExtras` | `Bundle`: This value may be `null`. <br /> |

### sendOrderedBroadcast

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendOrderedBroadcast (Intent intent, 
                int initialCode, 
                String receiverPermission, 
                String receiverAppOp, 
                BroadcastReceiver resultReceiver, 
                Handler scheduler, 
                String initialData, 
                Bundle initialExtras, 
                Bundle options)
```

<br />

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: This value cannot be `null`. <br /> |
| `initialCode` | `int` <br /> |
| `receiverPermission` | `String`: This value may be `null`. <br /> |
| `receiverAppOp` | `String`: This value may be `null`. <br /> |
| `resultReceiver` | `BroadcastReceiver`: This value may be `null`. <br /> |
| `scheduler` | `Handler`: This value may be `null`. <br /> |
| `initialData` | `String`: This value may be `null`. <br /> |
| `initialExtras` | `Bundle`: This value may be `null`. <br /> |
| `options` | `Bundle`: This value may be `null`. <br /> |

### sendOrderedBroadcast

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendOrderedBroadcast (Intent intent, 
                String receiverPermission, 
                BroadcastReceiver resultReceiver, 
                Handler scheduler, 
                int initialCode, 
                String initialData, 
                Bundle initialExtras)
```

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to
receive data back from the broadcast. This is accomplished by
supplying your own BroadcastReceiver when calling, which will be
treated as a final receiver at the end of the broadcast -- its
`https://developer.android.com/reference/android/content/BroadcastReceiver#onReceive(android.content.Context,%20android.content.Intent)` method will be called with
the result values collected from the other receivers. The broadcast will
be serialized in the same way as calling
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)`.

Like `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)`, this method is
asynchronous; it will return before
resultReceiver.onReceive() is called.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent to broadcast; all receivers matching this Intent will receive the broadcast. This value cannot be `null`. <br /> |
| `receiverPermission` | `String`: This value may be `null`. <br /> |
| `resultReceiver` | `BroadcastReceiver`: This value may be `null`. <br /> |
| `scheduler` | `Handler`: This value may be `null`. <br /> |
| `initialCode` | `int`: An initial value for the result code. Often Activity.RESULT_OK. <br /> |
| `initialData` | `String`: This value may be `null`. <br /> |
| `initialExtras` | `Bundle`: This value may be `null`. <br /> |

### sendOrderedBroadcast

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendOrderedBroadcast (Intent intent, 
                String receiverPermission, 
                Bundle options)
```

Broadcast the given intent to all interested BroadcastReceivers, delivering
them one at a time to allow more preferred receivers to consume the
broadcast before it is delivered to less preferred receivers. This
call is asynchronous; it returns immediately, and you will continue
executing while the receivers are run.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: This value cannot be `null`. <br /> |
| `receiverPermission` | `String`: This value may be `null`. <br /> |
| `options` | `Bundle`: This value may be `null`. <br /> |

### sendOrderedBroadcast

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendOrderedBroadcast (Intent intent, 
                String receiverPermission, 
                Bundle options, 
                BroadcastReceiver resultReceiver, 
                Handler scheduler, 
                int initialCode, 
                String initialData, 
                Bundle initialExtras)
```

Version of `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that allows you to
receive data back from the broadcast. This is accomplished by
supplying your own BroadcastReceiver when calling, which will be
treated as a final receiver at the end of the broadcast -- its
`https://developer.android.com/reference/android/content/BroadcastReceiver#onReceive(android.content.Context,%20android.content.Intent)` method will be called with
the result values collected from the other receivers. The broadcast will
be serialized in the same way as calling
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)`.

Like `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)`, this method is
asynchronous; it will return before
resultReceiver.onReceive() is called.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: This value cannot be `null`. <br /> |
| `receiverPermission` | `String`: This value may be `null`. <br /> |
| `options` | `Bundle`: This value may be `null`. <br /> |
| `resultReceiver` | `BroadcastReceiver`: This value may be `null`. <br /> |
| `scheduler` | `Handler`: This value may be `null`. <br /> |
| `initialCode` | `int`: An initial value for the result code. Often Activity.RESULT_OK. <br /> |
| `initialData` | `String`: This value may be `null`. <br /> |
| `initialExtras` | `Bundle`: This value may be `null`. <br /> |

### sendOrderedBroadcast

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendOrderedBroadcast (Intent intent, 
                String receiverPermission)
```

Broadcast the given intent to all interested BroadcastReceivers, delivering
them one at a time to allow more preferred receivers to consume the
broadcast before it is delivered to less preferred receivers. This
call is asynchronous; it returns immediately, and you will continue
executing while the receivers are run.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent to broadcast; all receivers matching this Intent will receive the broadcast. <br /> |
| `receiverPermission` | `String`: This value may be `null`. <br /> |

### sendOrderedBroadcastAsUser

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendOrderedBroadcastAsUser (Intent intent, 
                UserHandle user, 
                String receiverPermission, 
                BroadcastReceiver resultReceiver, 
                Handler scheduler, 
                int initialCode, 
                String initialData, 
                Bundle initialExtras)
```

Version of
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)`
that allows you to specify the
user the broadcast will be sent to. This is not available to applications
that are not pre-installed on the system image.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.


Requires android.Manifest.permission.INTERACT_ACROSS_USERS

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent to broadcast; all receivers matching this Intent will receive the broadcast. <br /> |
| `user` | `UserHandle`: UserHandle to send the intent to. <br /> |
| `receiverPermission` | `String`: This value may be `null`. <br /> |
| `resultReceiver` | `BroadcastReceiver`: This value may be `null`. <br /> |
| `scheduler` | `Handler`: This value may be `null`. <br /> |
| `initialCode` | `int`: An initial value for the result code. Often Activity.RESULT_OK. <br /> |
| `initialData` | `String`: This value may be `null`. <br /> |
| `initialExtras` | `Bundle`: This value may be `null`. <br /> |

### sendStickyBroadcast

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendStickyBroadcast (Intent intent)
```


**This method is deprecated.**   

Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.

<br />

Perform a `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)` that is "sticky," meaning the
Intent you are sending stays around after the broadcast is complete,
so that others can quickly retrieve that data through the return
value of `https://developer.android.com/reference/android/content/Context#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)`. In
all other ways, this behaves the same as
`https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BROADCAST_STICKY`

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent to broadcast; all receivers matching this Intent will receive the broadcast, and the Intent will be held to be re-broadcast to future receivers. <br /> |

### sendStickyBroadcast

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendStickyBroadcast (Intent intent, 
                Bundle options)
```


**This method is deprecated.**   

Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.

<br />

Perform a `https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent)` that is "sticky," meaning the
Intent you are sending stays around after the broadcast is complete,
so that others can quickly retrieve that data through the return
value of `https://developer.android.com/reference/android/content/ContextWrapper#registerReceiver(android.content.BroadcastReceiver,%20android.content.IntentFilter)`. In
all other ways, this behaves the same as
`https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent)`.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent to broadcast; all receivers matching this Intent will receive the broadcast, and the Intent will be held to be re-broadcast to future receivers. This value cannot be `null`. <br /> |
| `options` | `Bundle`: (optional) Additional sending options, generated from a `https://developer.android.com/reference/android/app/BroadcastOptions`. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/content/ContextWrapper#sendBroadcast(android.content.Intent)`
- `https://developer.android.com/reference/android/content/ContextWrapper#sendStickyOrderedBroadcast(android.content.Intent,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)`

### sendStickyBroadcastAsUser

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendStickyBroadcastAsUser (Intent intent, 
                UserHandle user)
```


**This method is deprecated.**   

Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.

<br />

Version of `https://developer.android.com/reference/android/content/Context#sendStickyBroadcast(android.content.Intent)` that allows you to specify the
user the broadcast will be sent to. This is not available to applications
that are not pre-installed on the system image.


Requires android.Manifest.permission.INTERACT_ACROSS_USERS and `https://developer.android.com/reference/android/Manifest.permission#BROADCAST_STICKY`

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent to broadcast; all receivers matching this Intent will receive the broadcast, and the Intent will be held to be re-broadcast to future receivers. <br /> |
| `user` | `UserHandle`: UserHandle to send the intent to. <br /> |

### sendStickyOrderedBroadcast

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendStickyOrderedBroadcast (Intent intent, 
                BroadcastReceiver resultReceiver, 
                Handler scheduler, 
                int initialCode, 
                String initialData, 
                Bundle initialExtras)
```


**This method is deprecated.**   

Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.

<br />

Version of `https://developer.android.com/reference/android/content/Context#sendStickyBroadcast(android.content.Intent)` that allows you to
receive data back from the broadcast. This is accomplished by
supplying your own BroadcastReceiver when calling, which will be
treated as a final receiver at the end of the broadcast -- its
`https://developer.android.com/reference/android/content/BroadcastReceiver#onReceive(android.content.Context,%20android.content.Intent)` method will be called with
the result values collected from the other receivers. The broadcast will
be serialized in the same way as calling
`https://developer.android.com/reference/android/content/Context#sendOrderedBroadcast(android.content.Intent,%20java.lang.String)`.

Like `https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)`, this method is
asynchronous; it will return before
resultReceiver.onReceive() is called. Note that the sticky data
stored is only the data you initially supply to the broadcast, not
the result of any changes made by the receivers.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.


Requires `https://developer.android.com/reference/android/Manifest.permission#BROADCAST_STICKY`

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent to broadcast; all receivers matching this Intent will receive the broadcast. <br /> |
| `resultReceiver` | `BroadcastReceiver`: This value may be `null`. <br /> |
| `scheduler` | `Handler`: This value may be `null`. <br /> |
| `initialCode` | `int`: An initial value for the result code. Often Activity.RESULT_OK. <br /> |
| `initialData` | `String`: This value may be `null`. <br /> |
| `initialExtras` | `Bundle`: This value may be `null`. <br /> |

### sendStickyOrderedBroadcastAsUser

Added in [API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void sendStickyOrderedBroadcastAsUser (Intent intent, 
                UserHandle user, 
                BroadcastReceiver resultReceiver, 
                Handler scheduler, 
                int initialCode, 
                String initialData, 
                Bundle initialExtras)
```


**This method is deprecated.**   

Sticky broadcasts should not be used. They provide no security (anyone
can access them), no protection (anyone can modify them), and many other problems.
The recommended pattern is to use a non-sticky broadcast to report that *something*
has changed, with another mechanism for apps to retrieve the current value whenever
desired.

<br />

Version of
`https://developer.android.com/reference/android/content/Context#sendStickyOrderedBroadcast(android.content.Intent,%20android.content.BroadcastReceiver,%20android.os.Handler,%20int,%20java.lang.String,%20android.os.Bundle)`
that allows you to specify the
user the broadcast will be sent to. This is not available to applications
that are not pre-installed on the system image.

See `https://developer.android.com/reference/android/content/BroadcastReceiver` for more information on Intent broadcasts.


Requires android.Manifest.permission.INTERACT_ACROSS_USERS and `https://developer.android.com/reference/android/Manifest.permission#BROADCAST_STICKY`

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The Intent to broadcast; all receivers matching this Intent will receive the broadcast. <br /> |
| `user` | `UserHandle`: UserHandle to send the intent to. <br /> |
| `resultReceiver` | `BroadcastReceiver`: This value may be `null`. <br /> |
| `scheduler` | `Handler`: This value may be `null`. <br /> |
| `initialCode` | `int`: An initial value for the result code. Often Activity.RESULT_OK. <br /> |
| `initialData` | `String`: This value may be `null`. <br /> |
| `initialExtras` | `Bundle`: This value may be `null`. <br /> |

### setTheme

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTheme (int resid)
```

Set the base theme for this context. Note that this should be called
before any views are instantiated in the Context (for example before
calling `https://developer.android.com/reference/android/app/Activity#setContentView(android.view.View)` or
`https://developer.android.com/reference/android/view/LayoutInflater#inflate(int,%20android.view.ViewGroup)`).

<br />

| Parameters ||
|---|---|
| `resid` | `int`: The style resource describing the theme. <br /> |

### setWallpaper

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setWallpaper (Bitmap bitmap)
```


**This method is deprecated.**   

Use `https://developer.android.com/reference/android/app/WallpaperManager#setBitmap(android.graphics.Bitmap)` instead.

This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.

<br />

<br />

| Parameters ||
|---|---|
| `bitmap` | `Bitmap` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` |   |

### setWallpaper

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setWallpaper (InputStream data)
```


**This method is deprecated.**   

Use `https://developer.android.com/reference/android/app/WallpaperManager#setStream(java.io.InputStream)` instead.

This method requires the caller to hold the permission
`https://developer.android.com/reference/android/Manifest.permission#SET_WALLPAPER`.

<br />

<br />

| Parameters ||
|---|---|
| `data` | `InputStream` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` |   |

### shouldShowRequestPermissionRationale

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public boolean shouldShowRequestPermissionRationale (String permission)
```

Gets whether you should show UI with rationale before requesting a permission. If the
permission does not exist on this SDK level or is not visible to this app, the method will
return `false`.

<br />

| Parameters ||
|---|---|
| `permission` | `String`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | Whether you should show permission rationale UI. <br /> |

### startActivities

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void startActivities (Intent[] intents, 
                Bundle options)
```

Launch multiple new activities. This is generally the same as calling
`https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent)` for the first Intent in the array,
that activity during its creation calling `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent)`
for the second entry, etc. Note that unlike that approach, generally
none of the activities except the last in the array will be created
at this point, but rather will be created when the user first visits
them (due to pressing back from the activity on top).

This method throws `https://developer.android.com/reference/android/content/ActivityNotFoundException`
if there was no Activity found for *any* given Intent. In this
case the state of the activity stack is undefined (some Intents in the
list may be on it, some not), so you probably want to avoid such situations.

<br />

| Parameters ||
|---|---|
| `intents` | `Intent`: An array of Intents to be started. <br /> |
| `options` | `Bundle`: This value may be `null`. <br /> |

### startActivities

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void startActivities (Intent[] intents)
```

Same as `https://developer.android.com/reference/android/content/Context#startActivities(android.content.Intent[],%20android.os.Bundle)` with no options
specified.

<br />

| Parameters ||
|---|---|
| `intents` | `Intent`: An array of Intents to be started. <br /> |

### startActivity

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void startActivity (Intent intent)
```

Same as `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)` with no options
specified.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The description of the activity to start. <br /> |

### startActivity

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void startActivity (Intent intent, 
                Bundle options)
```

Launch a new activity. You will not receive any information about when
the activity exits.

Note that if this method is being called from outside of an
`https://developer.android.com/reference/android/app/Activity` Context, then the Intent must include
the `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK` launch flag. This is because,
without being started from an existing Activity, there is no existing
task in which to place the new activity and thus it needs to be placed
in its own separate task.

This method throws `https://developer.android.com/reference/android/content/ActivityNotFoundException`
if there was no Activity found to run the given Intent.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent`: The description of the activity to start. <br /> |
| `options` | `Bundle`: This value may be `null`. <br /> |

### startForegroundService

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ComponentName startForegroundService (Intent service)
```

Similar to `https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)`, but with an implicit promise that the
Service will call `https://developer.android.com/reference/android/app/Service#startForeground(int,%20android.app.Notification)` once it begins running. The service is given
an amount of time comparable to the ANR interval to do this, otherwise the system
will automatically crash the process, in which case an internal exception
`ForegroundServiceDidNotStartInTimeException` is logged on logcat on devices
running SDK Version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or later. On older Android
versions, an internal exception `RemoteServiceException` is logged instead, with
a corresponding message.

Unlike the ordinary `https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)`, this method can be used
at any time, regardless of whether the app hosting the service is in a foreground
state.

**Note:**
Beginning with SDK Version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S`,
apps targeting SDK Version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S`
or higher are not allowed to start foreground services from the background.
See
[Behavior changes: Apps targeting Android 12](https://developer.android.com/about/versions/12/behavior-changes-12)
for more details.

<br />

<br />

| Parameters ||
|---|---|
| `service` | `Intent`: Identifies the service to be started. The Intent must be fully explicit (supplying a component name). Additional values may be included in the Intent extras to supply arguments along with this specific start call. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/ComponentName` | This value may be `null`. <br /> |

### startInstrumentation

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean startInstrumentation (ComponentName className, 
                String profileFile, 
                Bundle arguments)
```

Start executing an `https://developer.android.com/reference/android/app/Instrumentation` class. The given
Instrumentation component will be run by killing its target application
(if currently running), starting the target process, instantiating the
instrumentation component, and then letting it drive the application.

This function is not synchronous -- it returns as soon as the
instrumentation has started and while it is running.

Instrumentation is normally only allowed to run against a package
that is either unsigned or signed with a signature that the
the instrumentation package is also signed with (ensuring the target
trusts the instrumentation).

<br />

| Parameters ||
|---|---|
| `className` | `ComponentName`: Name of the Instrumentation component to be run. This value cannot be `null`. <br /> |
| `profileFile` | `String`: This value may be `null`. <br /> |
| `arguments` | `Bundle`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the instrumentation was successfully started, else `false` if it could not be found. <br /> |

### startIntentSender

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void startIntentSender (IntentSender intent, 
                Intent fillInIntent, 
                int flagsMask, 
                int flagsValues, 
                int extraFlags)
```

Same as `https://developer.android.com/reference/android/content/Context#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int,%20android.os.Bundle)`
with no options specified.

<br />

| Parameters ||
|---|---|
| `intent` | `IntentSender`: The IntentSender to launch. <br /> |
| `fillInIntent` | `Intent`: This value may be `null`. <br /> |
| `flagsMask` | `int`: Intent flags in the original IntentSender that you would like to change. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_FROM_BACKGROUND` - `https://developer.android.com/reference/android/content/Intent#FLAG_DEBUG_LOG_RESOLUTION` - `https://developer.android.com/reference/android/content/Intent#FLAG_EXCLUDE_STOPPED_PACKAGES` - `https://developer.android.com/reference/android/content/Intent#FLAG_INCLUDE_STOPPED_PACKAGES` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MATCH_EXTERNAL` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_HISTORY` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_SINGLE_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MULTIPLE_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_FORWARD_RESULT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_PREVIOUS_IS_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_BROUGHT_TO_FRONT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_DOCUMENT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_USER_ACTION` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_REORDER_TO_FRONT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_ANIMATION` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_TASK_ON_HOME` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RETAIN_IN_RECENTS` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_LAUNCH_ADJACENT` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_REGISTERED_ONLY` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_REPLACE_PENDING` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_FOREGROUND` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_NO_ABORT` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS` |
| `flagsValues` | `int`: Desired values for any bits set in <var translate="no">flagsMask</var>. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_FROM_BACKGROUND` - `https://developer.android.com/reference/android/content/Intent#FLAG_DEBUG_LOG_RESOLUTION` - `https://developer.android.com/reference/android/content/Intent#FLAG_EXCLUDE_STOPPED_PACKAGES` - `https://developer.android.com/reference/android/content/Intent#FLAG_INCLUDE_STOPPED_PACKAGES` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MATCH_EXTERNAL` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_HISTORY` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_SINGLE_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MULTIPLE_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_FORWARD_RESULT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_PREVIOUS_IS_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_BROUGHT_TO_FRONT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_DOCUMENT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_USER_ACTION` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_REORDER_TO_FRONT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_ANIMATION` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_TASK_ON_HOME` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RETAIN_IN_RECENTS` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_LAUNCH_ADJACENT` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_REGISTERED_ONLY` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_REPLACE_PENDING` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_FOREGROUND` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_NO_ABORT` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS` |
| `extraFlags` | `int`: Always set to 0. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/IntentSender.SendIntentException` |   |

### startIntentSender

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void startIntentSender (IntentSender intent, 
                Intent fillInIntent, 
                int flagsMask, 
                int flagsValues, 
                int extraFlags, 
                Bundle options)
```

Like `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)`, but taking a IntentSender
to start. If the IntentSender is for an activity, that activity will be started
as if you had called the regular `https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent)`
here; otherwise, its associated action will be executed (such as
sending a broadcast) as if you had called
`https://developer.android.com/reference/android/content/IntentSender#sendIntent(android.content.Context,%20int,%20android.content.Intent,%20android.content.IntentSender.OnFinished,%20android.os.Handler)` on it.

<br />

| Parameters ||
|---|---|
| `intent` | `IntentSender`: The IntentSender to launch. <br /> |
| `fillInIntent` | `Intent`: This value may be `null`. <br /> |
| `flagsMask` | `int`: Intent flags in the original IntentSender that you would like to change. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_FROM_BACKGROUND` - `https://developer.android.com/reference/android/content/Intent#FLAG_DEBUG_LOG_RESOLUTION` - `https://developer.android.com/reference/android/content/Intent#FLAG_EXCLUDE_STOPPED_PACKAGES` - `https://developer.android.com/reference/android/content/Intent#FLAG_INCLUDE_STOPPED_PACKAGES` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MATCH_EXTERNAL` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_HISTORY` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_SINGLE_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MULTIPLE_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_FORWARD_RESULT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_PREVIOUS_IS_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_BROUGHT_TO_FRONT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_DOCUMENT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_USER_ACTION` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_REORDER_TO_FRONT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_ANIMATION` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_TASK_ON_HOME` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RETAIN_IN_RECENTS` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_LAUNCH_ADJACENT` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_REGISTERED_ONLY` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_REPLACE_PENDING` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_FOREGROUND` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_NO_ABORT` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS` |
| `flagsValues` | `int`: Desired values for any bits set in <var translate="no">flagsMask</var>. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/Intent#FLAG_FROM_BACKGROUND` - `https://developer.android.com/reference/android/content/Intent#FLAG_DEBUG_LOG_RESOLUTION` - `https://developer.android.com/reference/android/content/Intent#FLAG_EXCLUDE_STOPPED_PACKAGES` - `https://developer.android.com/reference/android/content/Intent#FLAG_INCLUDE_STOPPED_PACKAGES` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MATCH_EXTERNAL` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_HISTORY` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_SINGLE_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_MULTIPLE_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_FORWARD_RESULT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_PREVIOUS_IS_TOP` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_BROUGHT_TO_FRONT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_DOCUMENT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_USER_ACTION` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_REORDER_TO_FRONT` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NO_ANIMATION` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_CLEAR_TASK` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_TASK_ON_HOME` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RETAIN_IN_RECENTS` - `https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_LAUNCH_ADJACENT` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_REGISTERED_ONLY` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_REPLACE_PENDING` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_FOREGROUND` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_NO_ABORT` - `https://developer.android.com/reference/android/content/Intent#FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS` |
| `extraFlags` | `int`: Always set to 0. <br /> |
| `options` | `Bundle`: This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/content/IntentSender.SendIntentException` |   |

### startService

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ComponentName startService (Intent service)
```

Request that a given application service be started. The Intent
should either contain the complete class name of a specific service
implementation to start, or a specific package name to target. If the
Intent is less specified, it logs a warning about this. In this case any of the
multiple matching services may be used. If this service
is not already running, it will be instantiated and started (creating a
process for it if needed); if it is running then it remains running.

Every call to this method will result in a corresponding call to
the target service's `https://developer.android.com/reference/android/app/Service#onStartCommand(android.content.Intent,%20int,%20int)` method,
with the <var translate="no">intent</var> given here. This provides a convenient way
to submit jobs to a service without having to bind and call on to its
interface.

Using startService() overrides the default service lifetime that is
managed by `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`: it requires the service to remain
running until `https://developer.android.com/reference/android/content/Context#stopService(android.content.Intent)` is called, regardless of whether
any clients are connected to it. Note that calls to startService()
do not nest: no matter how many times you call startService(),
a single call to `https://developer.android.com/reference/android/content/Context#stopService(android.content.Intent)` will stop it.

The system attempts to keep running services around as much as
possible. The only time they should be stopped is if the current
foreground application is using so many resources that the service needs
to be killed. If any errors happen in the service's process, it will
automatically be restarted.

This function will throw `https://developer.android.com/reference/java/lang/SecurityException` if you do not
have permission to start the given service.

**Note:** Each call to startService()
results in significant work done by the system to manage service
lifecycle surrounding the processing of the intent, which can take
multiple milliseconds of CPU time. Due to this cost, startService()
should not be used for frequent intent delivery to a service, and only
for scheduling significant work. Use `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)`
for high frequency calls.
Beginning with SDK Version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#O`, apps targeting SDK Version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#O` or higher are not allowed to start background services from the background. See [Background Execution Limits](https://developer.android.com/about/versions/oreo/background) for more details.

**Note:**
Beginning with SDK Version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S`,
apps targeting SDK Version `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S`
or higher are not allowed to start foreground services from the background.
See
[Behavior changes: Apps targeting Android 12](https://developer.android.com/about/versions/12/behavior-changes-12)
for more details.

<br />

<br />

| Parameters ||
|---|---|
| `service` | `Intent`: Identifies the service to be started. The Intent must be fully explicit (supplying a component name). Additional values may be included in the Intent extras to supply arguments along with this specific start call. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/ComponentName` | This value may be `null`. <br /> |

### stopService

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean stopService (Intent name)
```

Request that a given application service be stopped. If the service is
not running, nothing happens. Otherwise it is stopped. Note that calls
to startService() are not counted -- this stops the service no matter
how many times it was started.

If the service is running as a foreground service when it is
stopped, its associated notification will be removed. To avoid this,
apps can use `https://developer.android.com/reference/android/app/Service#stopForeground(int)` to decouple the notification
from the service's lifecycle before stopping it.

Note that if a stopped service still has `https://developer.android.com/reference/android/content/ServiceConnection`
objects bound to it with the `https://developer.android.com/reference/android/content/Context#BIND_AUTO_CREATE` set, it will
not be destroyed until all of these bindings are removed. See
the `https://developer.android.com/reference/android/app/Service` documentation for more details on a
service's lifecycle.

This function will throw `https://developer.android.com/reference/java/lang/SecurityException` if you do not
have permission to stop the given service.

<br />

| Parameters ||
|---|---|
| `name` | `Intent`: Description of the service to be stopped. The Intent must be either fully explicit (supplying a component name) or specify a specific package name it is targeted to. <br /> |

| Returns ||
|---|---|
| `boolean` | If there is a service matching the given Intent that is already running, then it is stopped and `true` is returned; else `false` is returned. <br /> |

### unbindService

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unbindService (ServiceConnection conn)
```

Disconnect from an application service. You will no longer receive
calls as the service is restarted, and the service is now allowed to
stop at any time.

<br />

| Parameters ||
|---|---|
| `conn` | `ServiceConnection`: The connection interface previously supplied to bindService(). This parameter must not be null. <br /> |

### unregisterComponentCallbacks

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterComponentCallbacks (ComponentCallbacks callback)
```

Remove a `https://developer.android.com/reference/android/content/ComponentCallbacks` object that was previously registered
with `https://developer.android.com/reference/android/content/ContextWrapper#registerComponentCallbacks(android.content.ComponentCallbacks)`.


After `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`, the `https://developer.android.com/reference/android/content/ComponentCallbacks` will be
unregistered to `https://developer.android.com/reference/android/content/ContextWrapper#getBaseContext()`, and can be only used after
`https://developer.android.com/reference/android/content/ContextWrapper#attachBaseContext(android.content.Context)`

<br />

<br />

| Parameters ||
|---|---|
| `callback` | `ComponentCallbacks`: The interface to call. This can be either a `https://developer.android.com/reference/android/content/ComponentCallbacks` or `https://developer.android.com/reference/android/content/ComponentCallbacks2` interface. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if this method calls before `https://developer.android.com/reference/android/content/ContextWrapper#attachBaseContext(android.content.Context)` |

### unregisterDeviceIdChangeListener

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterDeviceIdChangeListener (IntConsumer listener)
```

Removes a device ID changed listener from the Context. It's a no-op if
the listener is not already registered.

<br />

| Parameters ||
|---|---|
| `listener` | `IntConsumer`: This value cannot be `null`. <br /> |

### unregisterReceiver

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void unregisterReceiver (BroadcastReceiver receiver)
```

Unregister a previously registered BroadcastReceiver. *All*
filters that have been registered for this BroadcastReceiver will be
removed.

<br />

| Parameters ||
|---|---|
| `receiver` | `BroadcastReceiver`: The BroadcastReceiver to unregister. <br /> |

### updateServiceBindings

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void updateServiceBindings (Collection<Context.UpdateBindingParams> params)
```

Perform a batch update of existing bindings. Existing bindings can
be rebound with an updated set of flags, or unbound.
Only flags returned from `https://developer.android.com/reference/android/content/Context#getUpdateableFlags()` may be added
or removed.

This API behaves as if the `https://developer.android.com/reference/android/content/Context#rebindService(android.content.ServiceConnection,%20android.content.Context.BindServiceFlags)` and
`https://developer.android.com/reference/android/content/Context#unbindService(android.content.ServiceConnection)` API are called in the same order as the params are
iterated.

<br />

| Parameters ||
|---|---|
| `params` | `Collection`: This value cannot be `null`. <br /> |

### updateServiceGroup

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void updateServiceGroup (ServiceConnection conn, 
                int group, 
                int importance)
```

For a service previously bound with `https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` or a related method, change
how the system manages that service's process in relation to other processes. This
doesn't modify the original bind flags that were passed in when binding, but adjusts
how the process will be managed in some cases based on those flags. Currently only
works on isolated processes (will be ignored for non-isolated processes).

Note that this call does not take immediate effect, but will be applied the next
time the impacted process is adjusted for some other reason. Typically you would
call this before then calling a new `https://developer.android.com/reference/android/content/Context#bindIsolatedService(android.content.Intent,%20android.content.Context.BindServiceFlags,%20java.lang.String,%20java.util.concurrent.Executor,%20android.content.ServiceConnection)` on the service
of interest, with that binding causing the process to be shuffled accordingly.

<br />

<br />

| Parameters ||
|---|---|
| `conn` | `ServiceConnection`: The connection interface previously supplied to bindService(). This parameter must not be null. <br /> |
| `group` | `int`: A group to put this connection's process in. Upon calling here, this will override any previous group that was set for that process. The group tells the system about processes that are logically grouped together, so should be managed as one unit of importance (such as when being considered a recently used app). All processes in the same app with the same group are considered to be related. Supplying 0 reverts to the default behavior of not grouping. <br /> |
| `importance` | `int`: Additional importance of the processes within a group. Upon calling here, this will override any previous importance that was set for that process. The most important process is 0, and higher values are successively less important. You can view this as describing how to order the processes in an array, with the processes at the end of the array being the least important. This value has no meaning besides indicating how processes should be ordered in that array one after the other. This provides a way to fine-tune the system's process killing, guiding it to kill processes at the end of the array first. <br /> |

## Protected methods

### attachBaseContext

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void attachBaseContext (Context base)
```

Set the base context for this ContextWrapper. All calls will then be
delegated to the base context. Throws
IllegalStateException if a base context has already been set.

<br />

| Parameters ||
|---|---|
| `base` | `Context`: The new base context for this wrapper. <br /> |