summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/ContentResolver.java
diff options
context:
space:
mode:
authorFred Quintana <fredq@google.com>2009-12-09 16:00:31 -0800
committerJean-Baptiste Queru <jbq@google.com>2009-12-10 10:37:52 -0800
commit2ec6c5699181316e5a5c2cd293c006ac4a8bb101 (patch)
tree5dffd05ec1b6cd3630bef911631ef2150904088a /core/java/android/content/ContentResolver.java
parent8415afdb706c94cc297195a0dd5b5a62726d66e4 (diff)
downloadframeworks_base-2ec6c5699181316e5a5c2cd293c006ac4a8bb101.zip
frameworks_base-2ec6c5699181316e5a5c2cd293c006ac4a8bb101.tar.gz
frameworks_base-2ec6c5699181316e5a5c2cd293c006ac4a8bb101.tar.bz2
am 328c0e79: - removed the concept of Entity from the ContentProvider APIs - removed the parcelling ability from Entity and EntityIterator and made them public - added an EntityIterator abstract implementation that allow easy wrapping of a Cursor - changed the VCard c
Merge commit '328c0e7986aa6bb7752ec6de3da9c999920bb55f' into eclair-mr2-plus-aosp * commit '328c0e7986aa6bb7752ec6de3da9c999920bb55f': - removed the concept of Entity from the ContentProvider APIs
Diffstat (limited to 'core/java/android/content/ContentResolver.java')
-rw-r--r--core/java/android/content/ContentResolver.java90
1 files changed, 0 insertions, 90 deletions
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java
index c4b0807..6e7e6d7 100644
--- a/core/java/android/content/ContentResolver.java
+++ b/core/java/android/content/ContentResolver.java
@@ -216,96 +216,6 @@ public abstract class ContentResolver {
}
/**
- * EntityIterator wrapper that releases the associated ContentProviderClient when the
- * iterator is closed.
- * @hide
- */
- private class EntityIteratorWrapper implements EntityIterator {
- private final EntityIterator mInner;
- private final ContentProviderClient mClient;
- private volatile boolean mClientReleased;
-
- EntityIteratorWrapper(EntityIterator inner, ContentProviderClient client) {
- mInner = inner;
- mClient = client;
- mClientReleased = false;
- }
-
- public boolean hasNext() throws RemoteException {
- if (mClientReleased) {
- throw new IllegalStateException("this iterator is already closed");
- }
- return mInner.hasNext();
- }
-
- public Entity next() throws RemoteException {
- if (mClientReleased) {
- throw new IllegalStateException("this iterator is already closed");
- }
- return mInner.next();
- }
-
- public void reset() throws RemoteException {
- if (mClientReleased) {
- throw new IllegalStateException("this iterator is already closed");
- }
- mInner.reset();
- }
-
- public void close() {
- mClient.release();
- mInner.close();
- mClientReleased = true;
- }
-
- protected void finalize() throws Throwable {
- if (!mClientReleased) {
- mClient.release();
- }
- super.finalize();
- }
- }
-
- /**
- * Query the given URI, returning an {@link EntityIterator} over the result set.
- *
- * @param uri The URI, using the content:// scheme, for the content to
- * retrieve.
- * @param selection A filter declaring which rows to return, formatted as an
- * SQL WHERE clause (excluding the WHERE itself). Passing null will
- * return all rows for the given URI.
- * @param selectionArgs You may include ?s in selection, which will be
- * replaced by the values from selectionArgs, in the order that they
- * appear in the selection. The values will be bound as Strings.
- * @param sortOrder How to order the rows, formatted as an SQL ORDER BY
- * clause (excluding the ORDER BY itself). Passing null will use the
- * default sort order, which may be unordered.
- * @return An EntityIterator object
- * @throws RemoteException thrown if a RemoteException is encountered while attempting
- * to communicate with a remote provider.
- * @throws IllegalArgumentException thrown if there is no provider that matches the uri
- * @hide
- */
- public final EntityIterator queryEntities(Uri uri,
- String selection, String[] selectionArgs, String sortOrder) throws RemoteException {
- ContentProviderClient provider = acquireContentProviderClient(uri);
- if (provider == null) {
- throw new IllegalArgumentException("Unknown URL " + uri);
- }
- try {
- EntityIterator entityIterator =
- provider.queryEntities(uri, selection, selectionArgs, sortOrder);
- return new EntityIteratorWrapper(entityIterator, provider);
- } catch(RuntimeException e) {
- provider.release();
- throw e;
- } catch(RemoteException e) {
- provider.release();
- throw e;
- }
- }
-
- /**
* Open a stream on to the content associated with a content URI. If there
* is no data associated with the URI, FileNotFoundException is thrown.
*