summaryrefslogtreecommitdiff
path: root/test-mock/src/android/test/mock/MockContentResolver.java
diff options
context:
space:
mode:
Diffstat (limited to 'test-mock/src/android/test/mock/MockContentResolver.java')
-rw-r--r--test-mock/src/android/test/mock/MockContentResolver.java48
1 files changed, 40 insertions, 8 deletions
diff --git a/test-mock/src/android/test/mock/MockContentResolver.java b/test-mock/src/android/test/mock/MockContentResolver.java
index a70152c8b732..8283019a10ec 100644
--- a/test-mock/src/android/test/mock/MockContentResolver.java
+++ b/test-mock/src/android/test/mock/MockContentResolver.java
@@ -16,6 +16,8 @@
package android.test.mock;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.content.ContentProvider;
import android.content.ContentResolver;
import android.content.Context;
@@ -130,17 +132,47 @@ public class MockContentResolver extends ContentResolver {
}
/**
- * Overrides {@link android.content.ContentResolver#notifyChange(Uri, ContentObserver, boolean)
- * ContentResolver.notifChange(Uri, ContentObserver, boolean)}. All parameters are ignored.
- * The method hides providers linked to MockContentResolver from other observers in the system.
+ * Overrides the behavior from the parent class to completely ignore any
+ * content notifications sent to this object. This effectively hides clients
+ * from observers elsewhere in the system.
+ */
+ @Override
+ public void notifyChange(@NonNull Uri uri, @Nullable ContentObserver observer) {
+ }
+
+ /**
+ * Overrides the behavior from the parent class to completely ignore any
+ * content notifications sent to this object. This effectively hides clients
+ * from observers elsewhere in the system.
*
- * @param uri (Ignored) The uri of the content provider.
- * @param observer (Ignored) The observer that originated the change.
- * @param syncToNetwork (Ignored) If true, attempt to sync the change to the network.
+ * @deprecated callers should consider migrating to
+ * {@link #notifyChange(Uri, ContentObserver, int)}, as it
+ * offers support for many more options than just
+ * {@link #NOTIFY_SYNC_TO_NETWORK}.
*/
@Override
- public void notifyChange(Uri uri,
- ContentObserver observer,
+ @Deprecated
+ public void notifyChange(@NonNull Uri uri, @Nullable ContentObserver observer,
boolean syncToNetwork) {
}
+
+ /**
+ * Overrides the behavior from the parent class to completely ignore any
+ * content notifications sent to this object. This effectively hides clients
+ * from observers elsewhere in the system.
+ */
+ @Override
+ public void notifyChange(@NonNull Uri uri, @Nullable ContentObserver observer,
+ @NotifyFlags int flags) {
+ }
+
+ /**
+ * Overrides the behavior from the parent class to completely ignore any
+ * content notifications sent to this object. This effectively hides clients
+ * from observers elsewhere in the system.
+ */
+ @Override
+ public void notifyChange(@NonNull Iterable<Uri> uris, @Nullable ContentObserver observer,
+ @NotifyFlags int flags) {
+ }
}