Added in API level 1

ContextWrapper


open class ContextWrapper : Context
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper

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
Public constructors

Public methods
open Boolean
bindIsolatedService(service: Intent, flags: Int, instanceName: String, executor: Executor, conn: ServiceConnection)

open Boolean
bindService(service: Intent, flags: Context.BindServiceFlags, executor: Executor, conn: ServiceConnection)

See bindService(android.content.Intent,int,java.util.concurrent.Executor,android.content.ServiceConnection) Call BindServiceFlags.of(long) to obtain a BindServiceFlags object.

open Boolean

See bindService(android.content.Intent,android.content.ServiceConnection,int) Call BindServiceFlags.of(long) to obtain a BindServiceFlags object.

open Boolean
bindService(service: Intent, conn: ServiceConnection, flags: Int)

open Boolean
bindService(service: Intent, flags: Int, executor: Executor, conn: ServiceConnection)

open Int

open Int

open IntArray

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

open Int

open Int
checkCallingUriPermission(uri: Uri!, modeFlags: Int)

open IntArray

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

open Int
checkContentUriPermissionFull(uri: Uri, pid: Int, uid: Int, modeFlags: Int)

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

open Int
checkPermission(permission: String, pid: Int, uid: Int)

open Int

open Int
checkUriPermission(uri: Uri!, pid: Int, uid: Int, modeFlags: Int)

open Int
checkUriPermission(uri: Uri?, readPermission: String?, writePermission: String?, pid: Int, uid: Int, modeFlags: Int)

Check both a Uri and normal permission.

open IntArray
checkUriPermissions(uris: MutableList<Uri!>, pid: Int, uid: Int, modeFlags: Int)

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

open Unit

open Context
createAttributionContext(attributionTag: String?)

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

open Context!
createConfigurationContext(overrideConfiguration: Configuration)

open Context
createContext(contextParams: ContextParams)

Creates a context with specific properties and behaviors.

open Context

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

open Context!

open Context!

open Context!
createPackageContext(packageName: String!, flags: Int)

open Context
createWindowContext(display: Display, type: Int, options: Bundle?)

Creates a Context for a non-activity window on the given Display.

open Context
createWindowContext(type: Int, options: Bundle?)

Creates a Context for a non-activity window.

open Array<String!>!

open Boolean

open Boolean

open Boolean

open Unit
enforceCallingOrSelfPermission(permission: String, message: String?)

If neither you nor the calling process of an IPC you are handling has been granted a particular permission, throw a SecurityException.

open Unit
enforceCallingOrSelfUriPermission(uri: Uri!, modeFlags: Int, message: String!)

open Unit
enforceCallingPermission(permission: String, message: String?)

If the calling process of an IPC you are handling has not been granted a particular permission, throw a SecurityException.

open Unit
enforceCallingUriPermission(uri: Uri!, modeFlags: Int, message: String!)

open Unit
enforcePermission(permission: String, pid: Int, uid: Int, message: String?)

If the given permission is not allowed for a particular process and user ID running in the system, throw a SecurityException.

open Unit
enforceUriPermission(uri: Uri!, pid: Int, uid: Int, modeFlags: Int, message: String!)

open Unit
enforceUriPermission(uri: Uri?, readPermission: String?, writePermission: String?, pid: Int, uid: Int, modeFlags: Int, message: String?)

Enforce both a Uri and normal permission.

open Array<String!>!

open Context!

open ApplicationInfo!

open AssetManager!

open AttributionSource

open Context!

open File!

open ClassLoader!

open File!

open ContentResolver!

open File!

open File!

open Int

open File!
getDir(name: String!, mode: Int)

open Display!

Get the display this context is associated with.

open File?

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

open Array<File!>!

open File?

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

open Array<File!>!

open Array<File!>!

open File!

open File!

open Executor!

open Looper!

open File!

open File!

open Array<File!>!

open String!

open PackageManager!

open String!

open String!

open ContextParams?

Return the set of parameters which this Context was created with, if it was created via createContext(android.content.ContextParams).

open Resources!

open SharedPreferences!

open Any!

open String?
getSystemServiceName(serviceClass: Class<*>)

open Resources.Theme!

open Drawable!

open Int

open Int

open Unit
grantUriPermission(toPackage: String!, uri: Uri!, modeFlags: Int)

open Boolean

open Boolean

open Boolean
moveDatabaseFrom(sourceContext: Context!, name: String!)

open Boolean
moveSharedPreferencesFrom(sourceContext: Context!, name: String!)

open FileInputStream!

open FileOutputStream!
openFileOutput(name: String!, mode: Int)

open SQLiteDatabase!

open SQLiteDatabase!

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

open Drawable!

open Unit

Add a new 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.

open Unit

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

open Intent?

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

open Intent?
registerReceiver(receiver: BroadcastReceiver?, filter: IntentFilter!, flags: Int)

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

open Intent?
registerReceiver(receiver: BroadcastReceiver?, filter: IntentFilter!, broadcastPermission: String?, scheduler: Handler?)

Register to receive intent broadcasts, to run in the context of scheduler.

open Intent?
registerReceiver(receiver: BroadcastReceiver?, filter: IntentFilter!, broadcastPermission: String?, scheduler: Handler?, flags: Int)

Register to receive intent broadcasts, to run in the context of scheduler.

open Unit

open Unit

open Unit

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

open Unit
revokeUriPermission(uri: Uri!, modeFlags: Int)

open Unit
revokeUriPermission(targetPackage: String!, uri: Uri!, modeFlags: Int)

open Unit

open Unit
sendBroadcast(intent: Intent!, receiverPermission: String?)

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

open Unit
sendBroadcast(intent: Intent, receiverPermission: String?, options: Bundle?)

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

open Unit

open Unit
sendBroadcastAsUser(intent: Intent!, user: UserHandle!, receiverPermission: String?)

open Unit
sendOrderedBroadcast(intent: Intent, initialCode: Int, receiverPermission: String?, receiverAppOp: String?, resultReceiver: BroadcastReceiver?, scheduler: Handler?, initialData: String?, initialExtras: Bundle?, options: Bundle?)

open Unit
sendOrderedBroadcast(intent: Intent!, receiverPermission: String?)

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.

open Unit
sendOrderedBroadcast(intent: Intent, receiverPermission: String?, resultReceiver: BroadcastReceiver?, scheduler: Handler?, initialCode: Int, initialData: String?, initialExtras: Bundle?)

Version of sendBroadcast(android.content.Intent) that allows you to receive data back from the broadcast.

open Unit
sendOrderedBroadcast(intent: Intent, receiverPermission: String?, options: Bundle?)

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.

open Unit
sendOrderedBroadcast(intent: Intent, receiverPermission: String?, options: Bundle?, resultReceiver: