views:

31

answers:

0

I’m creating ContentProvider which is a proxy of another ContentProvider (for security issues and to give access to part of functionality of full app).

public class GFContactsProvider extends ContactsProvider implements
      DatabaseConstants {
    private Context mContext;
    private ContentResolver mContentResolver;
    @Override
     public boolean onCreate() {
      mContext = getContext();
      mContentResolver = mContext.getContentResolver();


     }
    @Override
     public Cursor query(Uri uri, String[] projection, String selection,
       String[] selectionArgs, String sortOrder) {

     Cursor result = mContentResolver.query(ContactsContract.getContactsURI(Long.parseLong(address.get(1))), null, null, null, ContactsContract.ContactColumns.SHOW_NAME);  
return result;
     }
    }

After calling inner CP from my CP I recive unexpected exception:

java.lang.UnsupportedOperationException: Only CrossProcessCursor cursors are supported across process for now

The exception concerns the wrapping of the Cursor by the CP and transfer it wrapped, Outer CP can't wrap it again so I have a problem here. When I checked class of returned cursor I received CursorWrapperInner. Is there any way to unwrap cursor (from this CWI to regular Cursor) in my outer CP (but not by transfering all data to MatrixCursor in loop – it’s too time-consuming).