MockContentResolver Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An extension of android.content.ContentResolver
that is designed for
testing.
[Android.Runtime.Register("android/test/mock/MockContentResolver", DoNotGenerateAcw=true)]
public class MockContentResolver : Android.Content.ContentResolver
[<Android.Runtime.Register("android/test/mock/MockContentResolver", DoNotGenerateAcw=true)>]
type MockContentResolver = class
inherit ContentResolver
- Inheritance
- Attributes
Remarks
An extension of android.content.ContentResolver
that is designed for testing.
MockContentResolver overrides Android's normal way of resolving providers by authority. To have access to a provider based on its authority, users of MockContentResolver first instantiate the provider and use MockContentResolver#addProvider(String, ContentProvider)
. Resolution of an authority occurs entirely within MockContentResolver.
Users can also set an authority's entry in the map to null, so that a provider is completely mocked out.
<div class="special reference"> <h3>Developer Guides</h3>
For more information about application testing, read the Testing developer guide.
</div>
Java documentation for android.test.mock.MockContentResolver
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Constructors
MockContentResolver() |
Creates a local map of providers. |
MockContentResolver(Context) |
Creates a local map of providers. |
MockContentResolver(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
Fields
AnyCursorItemType |
This is the Android platform's generic MIME type to match any MIME
type of the form " |
CursorDirBaseType |
This is the Android platform's base MIME type for a content: URI containing a Cursor of zero or more items. (Inherited from ContentResolver) |
CursorItemBaseType |
This is the Android platform's base MIME type for a content: URI containing a Cursor of a single item. (Inherited from ContentResolver) |
ExtraHonoredArgs |
Allows provider to report back to client which query keys are honored in a Cursor. (Inherited from ContentResolver) |
ExtraRefreshSupported |
An extra boolean describing whether a particular provider supports refresh or not. (Inherited from ContentResolver) |
ExtraSize |
An extra |
ExtraTotalCount |
Added to |
NotifyDelete |
Obsolete.
Flag for |
NotifyInsert |
Obsolete.
Flag for |
NotifySkipNotifyForDescendants |
Obsolete.
Flag for |
NotifySyncToNetwork |
Obsolete.
Flag for |
NotifyUpdate |
Obsolete.
Flag for |
QueryArgGroupColumns |
Specifies the list of columns (stored as a |
QueryArgLimit |
Specifies the max number of rows to include in a Cursor. (Inherited from ContentResolver) |
QueryArgOffset |
Specifies the offset row index within a Cursor. (Inherited from ContentResolver) |
QueryArgSortCollation |
Allows client to specify a hint to the provider declaring which collation to use when sorting values. (Inherited from ContentResolver) |
QueryArgSortColumns |
Specifies the list of columns (stored as a |
QueryArgSortDirection |
Specifies desired sort order. (Inherited from ContentResolver) |
QueryArgSortLocale |
Allows client to specify a hint to the provider declaring which locale to use when sorting values. (Inherited from ContentResolver) |
QueryArgSqlGroupBy |
Key for an SQL style |
QueryArgSqlHaving |
Key for an SQL style |
QueryArgSqlLimit |
Key for an SQL style |
QueryArgSqlSelection |
Key for an SQL style selection string that may be present in the query Bundle argument
passed to |
QueryArgSqlSelectionArgs |
Key for SQL selection string arguments list. (Inherited from ContentResolver) |
QueryArgSqlSortOrder |
Key for an SQL style sort string that may be present in the query Bundle argument
passed to |
QuerySortDirectionAscending |
Obsolete.
(Inherited from ContentResolver)
|
QuerySortDirectionDescending |
Obsolete.
(Inherited from ContentResolver)
|
SchemeAndroidResource | (Inherited from ContentResolver) |
SchemeContent | (Inherited from ContentResolver) |
SchemeFile | (Inherited from ContentResolver) |
SyncExtrasAccount |
Obsolete.
This member is deprecated. (Inherited from ContentResolver) |
SyncExtrasDiscardLocalDeletions |
Indicates that the sync adapter should not proceed with the delete operations, if it determines that there are too many. (Inherited from ContentResolver) |
SyncExtrasDoNotRetry |
If this extra is set to true then the request will not be retried if it fails. (Inherited from ContentResolver) |
SyncExtrasExpedited |
If this extra is set to true, the sync request will be scheduled at the front of the sync request queue, but it is still subject to JobScheduler quota and throttling due to App Standby buckets. (Inherited from ContentResolver) |
SyncExtrasForce |
Obsolete.
This member is deprecated. (Inherited from ContentResolver) |
SyncExtrasIgnoreBackoff |
If this extra is set to true then any backoffs for the initial attempt (e. (Inherited from ContentResolver) |
SyncExtrasIgnoreSettings |
If this extra is set to true then the sync settings (like getSyncAutomatically()) are ignored by the sync scheduler. (Inherited from ContentResolver) |
SyncExtrasInitialize |
Set by the SyncManager to request that the SyncAdapter initialize itself for the given account/authority pair. (Inherited from ContentResolver) |
SyncExtrasManual |
Setting this extra is the equivalent of setting both |
SyncExtrasOverrideTooManyDeletions |
Indicates that the sync adapter should proceed with the delete operations, even if it determines that there are too many. (Inherited from ContentResolver) |
SyncExtrasRequireCharging |
If this extra is set to true, the sync request will be scheduled only when the device is plugged in. (Inherited from ContentResolver) |
SyncExtrasScheduleAsExpeditedJob |
Run this sync operation as an "expedited job"
(see |
SyncExtrasUpload |
Indicates that this sync is intended to only upload local changes to the server. (Inherited from ContentResolver) |
SyncObserverTypeActive |
Obsolete.
(Inherited from ContentResolver)
|
SyncObserverTypePending |
Obsolete.
(Inherited from ContentResolver)
|
SyncObserverTypeSettings |
Obsolete.
(Inherited from ContentResolver)
|
Properties
Class |
Returns the runtime class of this |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
JniIdentityHashCode | (Inherited from Object) |
JniPeerMembers | |
OutgoingPersistedUriPermissions |
Return list of all persisted URI permission grants that are hosted by the calling app. (Inherited from ContentResolver) |
PeerReference | (Inherited from Object) |
PersistedUriPermissions |
Return list of all URI permission grants that have been persisted by the calling app. (Inherited from ContentResolver) |
ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
Methods
AcquireContentProviderClient(String) |
Returns a |
AcquireContentProviderClient(Uri) |
Returns a |
AcquireUnstableContentProviderClient(String) |
Like |
AcquireUnstableContentProviderClient(Uri) |
Like |
AddProvider(String, ContentProvider) |
Adds access to a provider based on its authority |
ApplyBatch(String, IList<ContentProviderOperation>) |
Applies each of the |
BulkInsert(Uri, ContentValues[]) |
Inserts multiple rows into a table at the given URL. (Inherited from ContentResolver) |
Call(String, String, String, Bundle) |
Call a provider-defined method. (Inherited from ContentResolver) |
Call(Uri, String, String, Bundle) |
Call a provider-defined method. (Inherited from ContentResolver) |
CancelSync(Uri) |
Obsolete.
Cancel any active or pending syncs that match the Uri. (Inherited from ContentResolver) |
Canonicalize(Uri) |
Transform the given <var>url</var> to a canonical representation of its referenced resource, which can be used across devices, persisted, backed up and restored, etc. (Inherited from ContentResolver) |
Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
Delete(Uri, Bundle) |
Deletes row(s) specified by a content URI. (Inherited from ContentResolver) |
Delete(Uri, String, String[]) |
Deletes row(s) specified by a content URI. (Inherited from ContentResolver) |
Dispose() | (Inherited from Object) |
Dispose(Boolean) | (Inherited from Object) |
Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
GetStreamTypes(Uri, String) |
Query for the possible MIME types for the representations the given
content URL can be returned when opened as as stream with
|
GetType(Uri) |
Return the MIME type of the given content URL. (Inherited from ContentResolver) |
GetTypeInfo(String) |
Return a detailed description of the given MIME type, including an icon and label that describe the type. (Inherited from ContentResolver) |
Insert(Uri, ContentValues, Bundle) |
Inserts a row into a table at the given URL. (Inherited from ContentResolver) |
Insert(Uri, ContentValues) |
Inserts a row into a table at the given URL. (Inherited from ContentResolver) |
JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
LoadThumbnail(Uri, Size, CancellationSignal) |
Convenience method that efficiently loads a visual thumbnail for the
given |
Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
NotifyChange(ICollection<Uri>, ContentObserver, NotifyChangeFlags) |
Notify registered observers that several rows have been updated. (Inherited from ContentResolver) |
NotifyChange(Uri, ContentObserver, Boolean) |
Notify registered observers that a row was updated. (Inherited from ContentResolver) |
NotifyChange(Uri, ContentObserver, NotifyChangeFlags) |
Notify registered observers that a row was updated. (Inherited from ContentResolver) |
NotifyChange(Uri, ContentObserver) |
Notify registered observers that a row was updated and attempt to sync changes to the network. (Inherited from ContentResolver) |
OpenAssetFile(Uri, String, CancellationSignal) | (Inherited from ContentResolver) |
OpenAssetFileDescriptor(Uri, String, CancellationSignal) |
Open a raw file descriptor to access data under a URI. (Inherited from ContentResolver) |
OpenAssetFileDescriptor(Uri, String) |
Open a raw file descriptor to access data under a URI. (Inherited from ContentResolver) |
OpenFile(Uri, String, CancellationSignal) | (Inherited from ContentResolver) |
OpenFileDescriptor(Uri, String, CancellationSignal) |
Open a raw file descriptor to access data under a URI. (Inherited from ContentResolver) |
OpenFileDescriptor(Uri, String) |
Open a raw file descriptor to access data under a URI. (Inherited from ContentResolver) |
OpenInputStream(Uri) |
Open a stream on to the content associated with a content URI. (Inherited from ContentResolver) |
OpenOutputStream(Uri, String) |
Open a stream on to the content associated with a content URI. (Inherited from ContentResolver) |
OpenOutputStream(Uri) |
Synonym for |
OpenTypedAssetFile(Uri, String, Bundle, CancellationSignal) | (Inherited from ContentResolver) |
OpenTypedAssetFileDescriptor(Uri, String, Bundle, CancellationSignal) |
Open a raw file descriptor to access (potentially type transformed) data from a "content:" URI. (Inherited from ContentResolver) |
OpenTypedAssetFileDescriptor(Uri, String, Bundle) |
Open a raw file descriptor to access (potentially type transformed) data from a "content:" URI. (Inherited from ContentResolver) |
Query(Uri, String[], Bundle, CancellationSignal) |
Query the given URI, returning a |
Query(Uri, String[], String, String[], String, CancellationSignal) |
Query the given URI, returning a |
Query(Uri, String[], String, String[], String) |
Query the given URI, returning a |
Refresh(Uri, Bundle, CancellationSignal) |
This allows clients to request an explicit refresh of content identified
by |
RegisterContentObserver(Uri, Boolean, ContentObserver) |
Register an observer class that gets callbacks when data identified by a given content URI changes. (Inherited from ContentResolver) |
ReleasePersistableUriPermission(Uri, ActivityFlags) |
Relinquish a persisted URI permission grant. (Inherited from ContentResolver) |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
StartSync(Uri, Bundle) |
Obsolete.
Start an asynchronous sync operation. (Inherited from ContentResolver) |
TakePersistableUriPermission(Uri, ActivityFlags) |
Take a persistable URI permission grant that has been offered. (Inherited from ContentResolver) |
ToArray<T>() | (Inherited from Object) |
ToString() |
Returns a string representation of the object. (Inherited from Object) |
Uncanonicalize(Uri) |
Given a canonical Uri previously generated by |
UnregisterContentObserver(ContentObserver) |
Unregisters a change observer. (Inherited from ContentResolver) |
UnregisterFromRuntime() | (Inherited from Object) |
Update(Uri, ContentValues, Bundle) |
Update row(s) in a content URI. (Inherited from ContentResolver) |
Update(Uri, ContentValues, String, String[]) |
Update row(s) in a content URI. (Inherited from ContentResolver) |
Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Explicit Interface Implementations
IJavaPeerable.Disposed() | (Inherited from Object) |
IJavaPeerable.DisposeUnlessReferenced() | (Inherited from Object) |
IJavaPeerable.Finalized() | (Inherited from Object) |
IJavaPeerable.JniManagedPeerState | (Inherited from Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from Object) |
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |