diff options
Diffstat (limited to 'test-mock/src/android/test/mock/MockIContentProvider.java')
-rw-r--r-- | test-mock/src/android/test/mock/MockIContentProvider.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test-mock/src/android/test/mock/MockIContentProvider.java b/test-mock/src/android/test/mock/MockIContentProvider.java index 223bcc59039d..82a1cf7d1796 100644 --- a/test-mock/src/android/test/mock/MockIContentProvider.java +++ b/test-mock/src/android/test/mock/MockIContentProvider.java @@ -162,12 +162,23 @@ public class MockIContentProvider implements IContentProvider { } @Override - public Uri uncanonicalize(String callingPkg, @Nullable String featureId, Uri uri) - throws RemoteException { + public Uri uncanonicalize(String callingPkg, @Nullable String featureId, Uri uri) { throw new UnsupportedOperationException("unimplemented mock method"); } @Override + @SuppressWarnings("deprecation") + public void uncanonicalizeAsync(String callingPkg, String featureId, Uri uri, + RemoteCallback remoteCallback) { + AsyncTask.SERIAL_EXECUTOR.execute(() -> { + final Bundle bundle = new Bundle(); + bundle.putParcelable(ContentResolver.REMOTE_CALLBACK_RESULT, + uncanonicalize(callingPkg, featureId, uri)); + remoteCallback.sendResult(bundle); + }); + } + + @Override public boolean refresh(String callingPkg, @Nullable String featureId, Uri url, Bundle args, ICancellationSignal cancellationSignal) throws RemoteException { throw new UnsupportedOperationException("unimplemented mock method"); |