From 748c570e845abf4fa043668683e270fda204de3c Mon Sep 17 00:00:00 2001 From: Shashank Kumar Date: Tue, 27 Feb 2024 17:51:07 +0530 Subject: [PATCH] Updated Javadocs --- .../shadows/ShadowContentResolver.java | 50 +++++++++++++++---- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowContentResolver.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowContentResolver.java index ce1681cf0b..b772ffb766 100644 --- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowContentResolver.java +++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowContentResolver.java @@ -794,7 +794,9 @@ public static Status getStatus(Account account, String authority, boolean create /** * @deprecated This method affects all calls, and does not work with {@link - * android.content.ContentResolver#acquireContentProviderClient} + * android.content.ContentResolver#acquireContentProviderClient}. Instead, use + * {@link org.robolectric.Robolectric#setupContentProvider(Class, String)} to + * install a test-specific ContentProvider that can return any Cursor. */ @Deprecated public void setCursor(BaseCursor cursor) { @@ -802,8 +804,10 @@ public void setCursor(BaseCursor cursor) { } /** - * @deprecated This method does not work with {@link - * android.content.ContentResolver#acquireContentProviderClient} + * @deprecated This method affects all calls, and does not work with {@link + * android.content.ContentResolver#acquireContentProviderClient}. Instead, use + * {@link org.robolectric.Robolectric#setupContentProvider(Class, String)} to + * install a test-specific ContentProvider that can return any Cursor. */ @Deprecated public void setCursor(Uri uri, BaseCursor cursorForUri) { @@ -812,7 +816,9 @@ public void setCursor(Uri uri, BaseCursor cursorForUri) { /** * @deprecated This method affects all calls, and does not work with {@link - * android.content.ContentResolver#acquireContentProviderClient} + * android.content.ContentResolver#acquireContentProviderClient}. Instead, use + * {@link org.robolectric.Robolectric#setupContentProvider(Class, String)} to + * install a test-specific ContentProvider that can return any Cursor. */ @Deprecated @SuppressWarnings({"unused", "WeakerAccess"}) @@ -825,8 +831,10 @@ public void setNextDatabaseIdForInserts(int nextId) { * DeleteStatement}s invoked on this {@link ContentResolver}. * * @return a list of statements - * @deprecated This method does not work with {@link - * android.content.ContentResolver#acquireContentProviderClient} + * @deprecated This method affects all calls, and does not work with {@link + * android.content.ContentResolver#acquireContentProviderClient}. Instead, use + * {@link org.robolectric.Robolectric#setupContentProvider(Class, String)} to + * install a test-specific ContentProvider that has logic to keep a record of statements. */ @Deprecated @SuppressWarnings({"unused", "WeakerAccess"}) @@ -840,8 +848,10 @@ public List getStatements() { * ContentValues[])}. * * @return a list of insert statements - * @deprecated This method does not work with {@link - * android.content.ContentResolver#acquireContentProviderClient} + * @deprecated This method affects all calls, and does not work with {@link + * android.content.ContentResolver#acquireContentProviderClient}. Instead, use + * {@link org.robolectric.Robolectric#setupContentProvider(Class, String)} to + * install a test-specific ContentProvider that can record insert statements. */ @Deprecated @SuppressWarnings({"unused", "WeakerAccess"}) @@ -854,8 +864,10 @@ public List getInsertStatements() { * ContentResolver#update(Uri, ContentValues, String, String[])}. * * @return a list of update statements - * @deprecated This method does not work with {@link - * android.content.ContentResolver#acquireContentProviderClient} + * @deprecated This method affects all calls, and does not work with {@link + * android.content.ContentResolver#acquireContentProviderClient}. Instead, use + * {@link org.robolectric.Robolectric#setupContentProvider(Class, String)} to + * install a test-specific ContentProvider that can record update statements. */ @Deprecated @SuppressWarnings({"unused", "WeakerAccess"}) @@ -885,12 +897,30 @@ public List getDeleteStatements() { return deleteStatements; } + + /** + * Returns the list of {@link NotifiedUri}s for corresponding calls to {@link + * ContentResolver#notifyChange(Uri, ContentObserver)}. + * + * @return a list of notified URIs + * @deprecated This method affects all calls, and does not work with {@link + * android.content.ContentResolver#acquireContentProviderClient}. + */ @Deprecated @SuppressWarnings({"unused", "WeakerAccess"}) public List getNotifiedUris() { return notifiedUris; } + + /** + * Returns the list of {@link ContentProviderOperation}s for corresponding calls to {@link + * ContentResolver#applyBatch(String, ArrayList)}. + * + * @return a list of content provider operations + * @deprecated This method affects all calls, and does not work with {@link + * android.content.ContentResolver#acquireContentProviderClient}. + */ @Deprecated public List getContentProviderOperations(String authority) { List operations = contentProviderOperations.get(authority);