diff options
Diffstat (limited to 'core/java/android/content/ContentProviderNative.java')
-rw-r--r-- | core/java/android/content/ContentProviderNative.java | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/core/java/android/content/ContentProviderNative.java b/core/java/android/content/ContentProviderNative.java index eb83dbc..4b31552 100644 --- a/core/java/android/content/ContentProviderNative.java +++ b/core/java/android/content/ContentProviderNative.java @@ -17,6 +17,7 @@ package android.content; import android.content.res.AssetFileDescriptor; +import android.database.BulkCursorDescriptor; import android.database.BulkCursorNative; import android.database.BulkCursorToCursorAdaptor; import android.database.Cursor; @@ -113,20 +114,14 @@ abstract public class ContentProviderNative extends Binder implements IContentPr if (cursor != null) { CursorToBulkCursorAdaptor adaptor = new CursorToBulkCursorAdaptor( cursor, observer, getProviderName()); - final IBinder binder = adaptor.asBinder(); - final int count = adaptor.count(); - final int index = BulkCursorToCursorAdaptor.findRowIdColumnIndex( - adaptor.getColumnNames()); - final boolean wantsAllOnMoveCalls = adaptor.getWantsAllOnMoveCalls(); + BulkCursorDescriptor d = adaptor.getBulkCursorDescriptor(); reply.writeNoException(); - reply.writeStrongBinder(binder); - reply.writeInt(count); - reply.writeInt(index); - reply.writeInt(wantsAllOnMoveCalls ? 1 : 0); + reply.writeInt(1); + d.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); } else { reply.writeNoException(); - reply.writeStrongBinder(null); + reply.writeInt(0); } return true; @@ -369,12 +364,9 @@ final class ContentProviderProxy implements IContentProvider DatabaseUtils.readExceptionFromParcel(reply); - IBulkCursor bulkCursor = BulkCursorNative.asInterface(reply.readStrongBinder()); - if (bulkCursor != null) { - int rowCount = reply.readInt(); - int idColumnPosition = reply.readInt(); - boolean wantsAllOnMoveCalls = reply.readInt() != 0; - adaptor.initialize(bulkCursor, rowCount, idColumnPosition, wantsAllOnMoveCalls); + if (reply.readInt() != 0) { + BulkCursorDescriptor d = BulkCursorDescriptor.CREATOR.createFromParcel(reply); + adaptor.initialize(d); } else { adaptor.close(); adaptor = null; |