diff options
author | Jeff Brown <jeffbrown@google.com> | 2012-01-25 19:37:13 -0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2012-01-27 17:33:21 -0800 |
commit | 75ea64fc54f328d37b115cfb1ded1e45c30380ed (patch) | |
tree | 4254a5d2d0662de8b606b38fea6987da17c130e3 /core/java/android/content/IContentProvider.java | |
parent | ebc016c01ea9d5707287cfc19ccc59b21a486c00 (diff) | |
download | frameworks_base-75ea64fc54f328d37b115cfb1ded1e45c30380ed.zip frameworks_base-75ea64fc54f328d37b115cfb1ded1e45c30380ed.tar.gz frameworks_base-75ea64fc54f328d37b115cfb1ded1e45c30380ed.tar.bz2 |
Implement a cancelation mechanism for queries.
Added new API to enable cancelation of SQLite and content provider
queries by means of a CancelationSignal object. The application
creates a CancelationSignal object and passes it as an argument
to the query. The cancelation signal can then be used to cancel
the query while it is executing.
If the cancelation signal is raised before the query is executed,
then it is immediately terminated.
Change-Id: If2c76e9a7e56ea5e98768b6d4f225f0a1ca61c61
Diffstat (limited to 'core/java/android/content/IContentProvider.java')
-rw-r--r-- | core/java/android/content/IContentProvider.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/content/IContentProvider.java b/core/java/android/content/IContentProvider.java index 2a67ff8..f52157f 100644 --- a/core/java/android/content/IContentProvider.java +++ b/core/java/android/content/IContentProvider.java @@ -34,7 +34,8 @@ import java.util.ArrayList; */ public interface IContentProvider extends IInterface { public Cursor query(Uri url, String[] projection, String selection, - String[] selectionArgs, String sortOrder) throws RemoteException; + String[] selectionArgs, String sortOrder, ICancelationSignal cancelationSignal) + throws RemoteException; public String getType(Uri url) throws RemoteException; public Uri insert(Uri url, ContentValues initialValues) throws RemoteException; @@ -50,6 +51,7 @@ public interface IContentProvider extends IInterface { public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations) throws RemoteException, OperationApplicationException; public Bundle call(String method, String arg, Bundle extras) throws RemoteException; + public ICancelationSignal createCancelationSignal() throws RemoteException; // Data interchange. public String[] getStreamTypes(Uri url, String mimeTypeFilter) throws RemoteException; @@ -71,4 +73,5 @@ public interface IContentProvider extends IInterface { static final int CALL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 20; static final int GET_STREAM_TYPES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 21; static final int OPEN_TYPED_ASSET_FILE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 22; + static final int CREATE_CANCELATION_SIGNAL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION + 23; } |