Methods Summary |
---|
private void | afterRemote()
if (mAnrRunnable != null) {
sAnrHandler.removeCallbacks(mAnrRunnable);
}
|
public ContentProviderResult[] | applyBatch(java.util.ArrayList operations)See {@link ContentProvider#applyBatch ContentProvider.applyBatch}
beforeRemote();
try {
return mContentProvider.applyBatch(mPackageName, operations);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
private void | beforeRemote()
if (mAnrRunnable != null) {
sAnrHandler.postDelayed(mAnrRunnable, mAnrTimeout);
}
|
public int | bulkInsert(android.net.Uri url, ContentValues[] initialValues)See {@link ContentProvider#bulkInsert ContentProvider.bulkInsert}
beforeRemote();
try {
return mContentProvider.bulkInsert(mPackageName, url, initialValues);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
public android.os.Bundle | call(java.lang.String method, java.lang.String arg, android.os.Bundle extras)See {@link ContentProvider#call(String, String, Bundle)}
beforeRemote();
try {
return mContentProvider.call(mPackageName, method, arg, extras);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
public final android.net.Uri | canonicalize(android.net.Uri url)See {@link ContentProvider#canonicalize}
beforeRemote();
try {
return mContentProvider.canonicalize(mPackageName, url);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
public int | delete(android.net.Uri url, java.lang.String selection, java.lang.String[] selectionArgs)See {@link ContentProvider#delete ContentProvider.delete}
beforeRemote();
try {
return mContentProvider.delete(mPackageName, url, selection, selectionArgs);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
protected void | finalize()
if (mGuard != null) {
mGuard.warnIfOpen();
}
|
public ContentProvider | getLocalContentProvider()Get a reference to the {@link ContentProvider} that is associated with this
client. If the {@link ContentProvider} is running in a different process then
null will be returned. This can be used if you know you are running in the same
process as a provider, and want to get direct access to its implementation details.
return ContentProvider.coerceToLocalContentProvider(mContentProvider);
|
public java.lang.String[] | getStreamTypes(android.net.Uri url, java.lang.String mimeTypeFilter)See {@link ContentProvider#getStreamTypes ContentProvider.getStreamTypes}
beforeRemote();
try {
return mContentProvider.getStreamTypes(url, mimeTypeFilter);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
public java.lang.String | getType(android.net.Uri url)See {@link ContentProvider#getType ContentProvider.getType}
beforeRemote();
try {
return mContentProvider.getType(url);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
public android.net.Uri | insert(android.net.Uri url, ContentValues initialValues)See {@link ContentProvider#insert ContentProvider.insert}
beforeRemote();
try {
return mContentProvider.insert(mPackageName, url, initialValues);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
public android.content.res.AssetFileDescriptor | openAssetFile(android.net.Uri url, java.lang.String mode)See {@link ContentProvider#openAssetFile ContentProvider.openAssetFile}.
Note that this does not
take care of non-content: URIs such as file:. It is strongly recommended
you use the {@link ContentResolver#openAssetFileDescriptor
ContentResolver.openAssetFileDescriptor} API instead.
return openAssetFile(url, mode, null);
|
public android.content.res.AssetFileDescriptor | openAssetFile(android.net.Uri url, java.lang.String mode, android.os.CancellationSignal signal)See {@link ContentProvider#openAssetFile ContentProvider.openAssetFile}.
Note that this does not
take care of non-content: URIs such as file:. It is strongly recommended
you use the {@link ContentResolver#openAssetFileDescriptor
ContentResolver.openAssetFileDescriptor} API instead.
beforeRemote();
try {
ICancellationSignal remoteSignal = null;
if (signal != null) {
signal.throwIfCanceled();
remoteSignal = mContentProvider.createCancellationSignal();
signal.setRemote(remoteSignal);
}
return mContentProvider.openAssetFile(mPackageName, url, mode, remoteSignal);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
public android.os.ParcelFileDescriptor | openFile(android.net.Uri url, java.lang.String mode)See {@link ContentProvider#openFile ContentProvider.openFile}. Note that
this does not
take care of non-content: URIs such as file:. It is strongly recommended
you use the {@link ContentResolver#openFileDescriptor
ContentResolver.openFileDescriptor} API instead.
return openFile(url, mode, null);
|
public android.os.ParcelFileDescriptor | openFile(android.net.Uri url, java.lang.String mode, android.os.CancellationSignal signal)See {@link ContentProvider#openFile ContentProvider.openFile}. Note that
this does not
take care of non-content: URIs such as file:. It is strongly recommended
you use the {@link ContentResolver#openFileDescriptor
ContentResolver.openFileDescriptor} API instead.
beforeRemote();
try {
ICancellationSignal remoteSignal = null;
if (signal != null) {
signal.throwIfCanceled();
remoteSignal = mContentProvider.createCancellationSignal();
signal.setRemote(remoteSignal);
}
return mContentProvider.openFile(mPackageName, url, mode, remoteSignal, null);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
public final android.content.res.AssetFileDescriptor | openTypedAssetFileDescriptor(android.net.Uri uri, java.lang.String mimeType, android.os.Bundle opts)See {@link ContentProvider#openTypedAssetFile ContentProvider.openTypedAssetFile}
return openTypedAssetFileDescriptor(uri, mimeType, opts, null);
|
public final android.content.res.AssetFileDescriptor | openTypedAssetFileDescriptor(android.net.Uri uri, java.lang.String mimeType, android.os.Bundle opts, android.os.CancellationSignal signal)See {@link ContentProvider#openTypedAssetFile ContentProvider.openTypedAssetFile}
beforeRemote();
try {
ICancellationSignal remoteSignal = null;
if (signal != null) {
signal.throwIfCanceled();
remoteSignal = mContentProvider.createCancellationSignal();
signal.setRemote(remoteSignal);
}
return mContentProvider.openTypedAssetFile(
mPackageName, uri, mimeType, opts, remoteSignal);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
public android.database.Cursor | query(android.net.Uri url, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder)See {@link ContentProvider#query ContentProvider.query}
return query(url, projection, selection, selectionArgs, sortOrder, null);
|
public android.database.Cursor | query(android.net.Uri url, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder, android.os.CancellationSignal cancellationSignal)See {@link ContentProvider#query ContentProvider.query}
beforeRemote();
try {
ICancellationSignal remoteCancellationSignal = null;
if (cancellationSignal != null) {
cancellationSignal.throwIfCanceled();
remoteCancellationSignal = mContentProvider.createCancellationSignal();
cancellationSignal.setRemote(remoteCancellationSignal);
}
return mContentProvider.query(mPackageName, url, projection, selection, selectionArgs,
sortOrder, remoteCancellationSignal);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
public boolean | release()Call this to indicate to the system that the associated {@link ContentProvider} is no
longer needed by this {@link ContentProviderClient}.
synchronized (this) {
if (mReleased) {
throw new IllegalStateException("Already released");
}
mReleased = true;
mGuard.close();
if (mStable) {
return mContentResolver.releaseProvider(mContentProvider);
} else {
return mContentResolver.releaseUnstableProvider(mContentProvider);
}
}
|
public static void | releaseQuietly(android.content.ContentProviderClient client){@hide}
if (client != null) {
try {
client.release();
} catch (Exception ignored) {
}
}
|
public void | setDetectNotResponding(long timeoutMillis){@hide}
synchronized (ContentProviderClient.class) {
mAnrTimeout = timeoutMillis;
if (timeoutMillis > 0) {
if (mAnrRunnable == null) {
mAnrRunnable = new NotRespondingRunnable();
}
if (sAnrHandler == null) {
sAnrHandler = new Handler(Looper.getMainLooper(), null, true /* async */);
}
} else {
mAnrRunnable = null;
}
}
|
public final android.net.Uri | uncanonicalize(android.net.Uri url)See {@link ContentProvider#uncanonicalize}
beforeRemote();
try {
return mContentProvider.uncanonicalize(mPackageName, url);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|
public int | update(android.net.Uri url, ContentValues values, java.lang.String selection, java.lang.String[] selectionArgs)See {@link ContentProvider#update ContentProvider.update}
beforeRemote();
try {
return mContentProvider.update(mPackageName, url, values, selection, selectionArgs);
} catch (DeadObjectException e) {
if (!mStable) {
mContentResolver.unstableProviderDied(mContentProvider);
}
throw e;
} finally {
afterRemote();
}
|