diff options
Diffstat (limited to 'test-runner/src')
-rw-r--r-- | test-runner/src/android/test/mock/MockContentProvider.java | 31 | ||||
-rw-r--r-- | test-runner/src/android/test/mock/MockIContentProvider.java | 27 |
2 files changed, 33 insertions, 25 deletions
diff --git a/test-runner/src/android/test/mock/MockContentProvider.java b/test-runner/src/android/test/mock/MockContentProvider.java index 1e41416..373f24a 100644 --- a/test-runner/src/android/test/mock/MockContentProvider.java +++ b/test-runner/src/android/test/mock/MockContentProvider.java @@ -53,18 +53,20 @@ public class MockContentProvider extends ContentProvider { */ private class InversionIContentProvider implements IContentProvider { @Override - public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations) + public ContentProviderResult[] applyBatch(String callingPackage, + ArrayList<ContentProviderOperation> operations) throws RemoteException, OperationApplicationException { return MockContentProvider.this.applyBatch(operations); } @Override - public int bulkInsert(Uri url, ContentValues[] initialValues) throws RemoteException { + public int bulkInsert(String callingPackage, Uri url, ContentValues[] initialValues) + throws RemoteException { return MockContentProvider.this.bulkInsert(url, initialValues); } @Override - public int delete(Uri url, String selection, String[] selectionArgs) + public int delete(String callingPackage, Uri url, String selection, String[] selectionArgs) throws RemoteException { return MockContentProvider.this.delete(url, selection, selectionArgs); } @@ -75,37 +77,39 @@ public class MockContentProvider extends ContentProvider { } @Override - public Uri insert(Uri url, ContentValues initialValues) throws RemoteException { + public Uri insert(String callingPackage, Uri url, ContentValues initialValues) + throws RemoteException { return MockContentProvider.this.insert(url, initialValues); } @Override - public AssetFileDescriptor openAssetFile(Uri url, String mode) throws RemoteException, - FileNotFoundException { + public AssetFileDescriptor openAssetFile(String callingPackage, Uri url, String mode) + throws RemoteException, FileNotFoundException { return MockContentProvider.this.openAssetFile(url, mode); } @Override - public ParcelFileDescriptor openFile(Uri url, String mode) throws RemoteException, - FileNotFoundException { + public ParcelFileDescriptor openFile(String callingPackage, Uri url, String mode) + throws RemoteException, FileNotFoundException { return MockContentProvider.this.openFile(url, mode); } @Override - public Cursor query(Uri url, String[] projection, String selection, String[] selectionArgs, + public Cursor query(String callingPackage, Uri url, String[] projection, String selection, + String[] selectionArgs, String sortOrder, ICancellationSignal cancellationSignal) throws RemoteException { return MockContentProvider.this.query(url, projection, selection, selectionArgs, sortOrder); } @Override - public int update(Uri url, ContentValues values, String selection, String[] selectionArgs) - throws RemoteException { + public int update(String callingPackage, Uri url, ContentValues values, String selection, + String[] selectionArgs) throws RemoteException { return MockContentProvider.this.update(url, values, selection, selectionArgs); } @Override - public Bundle call(String method, String request, Bundle args) + public Bundle call(String callingPackage, String method, String request, Bundle args) throws RemoteException { return MockContentProvider.this.call(method, request, args); } @@ -121,7 +125,8 @@ public class MockContentProvider extends ContentProvider { } @Override - public AssetFileDescriptor openTypedAssetFile(Uri url, String mimeType, Bundle opts) + public AssetFileDescriptor openTypedAssetFile(String callingPackage, Uri url, + String mimeType, Bundle opts) throws RemoteException, FileNotFoundException { return MockContentProvider.this.openTypedAssetFile(url, mimeType, opts); } diff --git a/test-runner/src/android/test/mock/MockIContentProvider.java b/test-runner/src/android/test/mock/MockIContentProvider.java index 9fcfc22..2b4fce6 100644 --- a/test-runner/src/android/test/mock/MockIContentProvider.java +++ b/test-runner/src/android/test/mock/MockIContentProvider.java @@ -41,12 +41,12 @@ import java.util.ArrayList; * @hide - @hide because this exposes bulkQuery() and call(), which must also be hidden. */ public class MockIContentProvider implements IContentProvider { - public int bulkInsert(Uri url, ContentValues[] initialValues) { + public int bulkInsert(String callingPackage, Uri url, ContentValues[] initialValues) { throw new UnsupportedOperationException("unimplemented mock method"); } @SuppressWarnings("unused") - public int delete(Uri url, String selection, String[] selectionArgs) + public int delete(String callingPackage, Uri url, String selection, String[] selectionArgs) throws RemoteException { throw new UnsupportedOperationException("unimplemented mock method"); } @@ -56,23 +56,26 @@ public class MockIContentProvider implements IContentProvider { } @SuppressWarnings("unused") - public Uri insert(Uri url, ContentValues initialValues) throws RemoteException { + public Uri insert(String callingPackage, Uri url, ContentValues initialValues) + throws RemoteException { throw new UnsupportedOperationException("unimplemented mock method"); } - public ParcelFileDescriptor openFile(Uri url, String mode) { + public ParcelFileDescriptor openFile(String callingPackage, Uri url, String mode) { throw new UnsupportedOperationException("unimplemented mock method"); } - public AssetFileDescriptor openAssetFile(Uri uri, String mode) { + public AssetFileDescriptor openAssetFile(String callingPackage, Uri uri, String mode) { throw new UnsupportedOperationException("unimplemented mock method"); } - public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations) { + public ContentProviderResult[] applyBatch(String callingPackage, + ArrayList<ContentProviderOperation> operations) { throw new UnsupportedOperationException("unimplemented mock method"); } - public Cursor query(Uri url, String[] projection, String selection, String[] selectionArgs, + public Cursor query(String callingPackage, Uri url, String[] projection, String selection, + String[] selectionArgs, String sortOrder, ICancellationSignal cancellationSignal) { throw new UnsupportedOperationException("unimplemented mock method"); } @@ -82,12 +85,12 @@ public class MockIContentProvider implements IContentProvider { throw new UnsupportedOperationException("unimplemented mock method"); } - public int update(Uri url, ContentValues values, String selection, String[] selectionArgs) - throws RemoteException { + public int update(String callingPackage, Uri url, ContentValues values, String selection, + String[] selectionArgs) throws RemoteException { throw new UnsupportedOperationException("unimplemented mock method"); } - public Bundle call(String method, String request, Bundle args) + public Bundle call(String callingPackage, String method, String request, Bundle args) throws RemoteException { throw new UnsupportedOperationException("unimplemented mock method"); } @@ -100,8 +103,8 @@ public class MockIContentProvider implements IContentProvider { throw new UnsupportedOperationException("unimplemented mock method"); } - public AssetFileDescriptor openTypedAssetFile(Uri url, String mimeType, Bundle opts) - throws RemoteException, FileNotFoundException { + public AssetFileDescriptor openTypedAssetFile(String callingPackage, Uri url, String mimeType, + Bundle opts) throws RemoteException, FileNotFoundException { throw new UnsupportedOperationException("unimplemented mock method"); } |