diff options
| author | Jeff Brown <jeffbrown@google.com> | 2012-01-23 13:01:18 -0800 |
|---|---|---|
| committer | Jeff Brown <jeffbrown@google.com> | 2012-01-23 13:01:18 -0800 |
| commit | 86de0590b94bcce27e3038c27464bed510bb564a (patch) | |
| tree | 0f192948c6ed5b80d4efd0219bd6c6b74b12ced9 /core/java/android/content/ContentResolver.java | |
| parent | bd4c9f13022e875c8b420248214482a5f5b46618 (diff) | |
Clean up content observer code.
Improved the documentation a little bit.
Fixed a bug in ContentService wherein if a ContentObserver was
passed as an argument and its deliverSelfNotifications() method
returned true, then notifyChange would tell all observers that
the change was a self-change even though it was only a self-change
from the perspective of the provided observer.
Deprecated ContentObservable.notifyChange since it is never
used and in general it shouldn't be because we want the notification
to be posted to the handler.
Change-Id: Idde49eb40777e011a068f2adae8a32f779dfb923
Diffstat (limited to 'core/java/android/content/ContentResolver.java')
| -rw-r--r-- | core/java/android/content/ContentResolver.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java index cc3219b33f11..0debb848b23c 100644 --- a/core/java/android/content/ContentResolver.java +++ b/core/java/android/content/ContentResolver.java @@ -1034,8 +1034,11 @@ public abstract class ContentResolver { * To register, call {@link #registerContentObserver(android.net.Uri , boolean, android.database.ContentObserver) registerContentObserver()}. * By default, CursorAdapter objects will get this notification. * - * @param uri - * @param observer The observer that originated the change, may be <code>null</null> + * @param uri The uri of the content that was changed. + * @param observer The observer that originated the change, may be <code>null</null>. + * The observer that originated the change will only receive the notification if it + * has requested to receive self-change notifications by implementing + * {@link ContentObserver#deliverSelfNotifications()} to return true. */ public void notifyChange(Uri uri, ContentObserver observer) { notifyChange(uri, observer, true /* sync to network */); @@ -1046,8 +1049,11 @@ public abstract class ContentResolver { * To register, call {@link #registerContentObserver(android.net.Uri , boolean, android.database.ContentObserver) registerContentObserver()}. * By default, CursorAdapter objects will get this notification. * - * @param uri - * @param observer The observer that originated the change, may be <code>null</null> + * @param uri The uri of the content that was changed. + * @param observer The observer that originated the change, may be <code>null</null>. + * The observer that originated the change will only receive the notification if it + * has requested to receive self-change notifications by implementing + * {@link ContentObserver#deliverSelfNotifications()} to return true. * @param syncToNetwork If true, attempt to sync the change to the network. */ public void notifyChange(Uri uri, ContentObserver observer, boolean syncToNetwork) { |
