Int |
bulkInsert(@NonNull uri: Uri, @NonNull values: Array<ContentValues!>)
|
Uri? |
canonicalize(@NonNull url: Uri)
|
Int |
delete(@NonNull uri: Uri, @Nullable selection: String?, @Nullable selectionArgs: Array<String!>?)
|
MutableList<Uri!> |
getPinnedSlices()
Returns a list of slice URIs that are currently pinned.
|
String? |
getType(uri: Uri)
|
Uri? |
insert(@NonNull uri: Uri, @Nullable values: ContentValues?)
|
Slice! |
onBindSlice(sliceUri: Uri!)
Implemented to create a slice.
onBindSlice should return as quickly as possible so that the UI tied to this slice can be responsive. No network or other IO will be allowed during onBindSlice. Any loading that needs to be done should happen in the background with a call to ContentResolver#notifyChange(Uri, ContentObserver) when the app is ready to provide the complete data in onBindSlice.
|
Boolean |
onCreate()
|
PendingIntent? |
onCreatePermissionRequest(@NonNull sliceUri: Uri, @NonNull callingPackage: String)
Called when an app requests a slice it does not have write permission to the uri for.
The return value will be the action on a slice that prompts the user that the calling app wants to show slices from this app. Returning null will use the default implementation that launches a dialog that allows the user to grant access to this slice. Apps that do not want to allow this user grant, can override this and instead launch their own dialog with different behavior.
|
Boolean |
onCreateSliceProvider()
Implement this to initialize your slice provider on startup. This method is called for all registered slice providers on the application main thread at application launch time. It must not perform lengthy operations, or application startup will be delayed.
You should defer nontrivial initialization (such as opening, upgrading, and scanning databases) until the slice provider is used (via #onBindSlice, etc). Deferred initialization keeps application startup fast, avoids unnecessary work if the provider turns out not to be needed, and stops database errors (such as a full disk) from halting application launch.
|
MutableCollection<Uri!>! |
onGetSliceDescendants(uri: Uri!)
Obtains a list of slices that are descendants of the specified Uri.
Implementing this is optional for a SliceProvider, but does provide a good discovery mechanism for finding slice Uris.
|
Uri |
onMapIntentToUri(intent: Intent!)
This method must be overridden if an IntentFilter is specified on the SliceProvider. In that case, this method can be called and is expected to return a non-null Uri representing a slice. Otherwise this will throw UnsupportedOperationException .
|
Unit |
onSlicePinned(sliceUri: Uri!)
Called to inform an app that a slice has been pinned.
Pinning is a way that slice hosts use to notify apps of which slices they care about updates for. When a slice is pinned the content is expected to be relatively fresh and kept up to date.
Being pinned does not provide any escalated privileges for the slice provider. So apps should do things such as turn on syncing or schedule a job in response to a onSlicePinned.
Pinned state is not persisted through a reboot, and apps can expect a new call to onSlicePinned for any slices that should remain pinned after a reboot occurs.
|
Unit |
onSliceUnpinned(sliceUri: Uri!)
Called to inform an app that a slices is no longer pinned.
This means that no other apps on the device care about updates to this slice anymore and therefore it is not important to be updated. Any syncs or jobs related to this slice should be cancelled.
|
Cursor? |
query(@NonNull uri: Uri, @Nullable projection: Array<String!>?, @Nullable selection: String?, @Nullable selectionArgs: Array<String!>?, @Nullable sortOrder: String?)
|
Cursor? |
query(@NonNull uri: Uri, @Nullable projection: Array<String!>?, @Nullable queryArgs: Bundle?, @Nullable cancellationSignal: CancellationSignal?)
|
Cursor? |
query(@NonNull uri: Uri, @Nullable projection: Array<String!>?, @Nullable selection: String?, @Nullable selectionArgs: Array<String!>?, @Nullable sortOrder: String?, @Nullable cancellationSignal: CancellationSignal?)
|
Int |
update(@NonNull uri: Uri, @Nullable values: ContentValues?, @Nullable selection: String?, @Nullable selectionArgs: Array<String!>?)
|