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/database/DataSetObservable.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/database/DataSetObservable.java')
| -rw-r--r-- | core/java/android/database/DataSetObservable.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/core/java/android/database/DataSetObservable.java b/core/java/android/database/DataSetObservable.java index 51c72c1877e8..ca77a13c2352 100644 --- a/core/java/android/database/DataSetObservable.java +++ b/core/java/android/database/DataSetObservable.java @@ -17,13 +17,15 @@ package android.database; /** - * A specialization of Observable for DataSetObserver that provides methods for - * invoking the various callback methods of DataSetObserver. + * A specialization of {@link Observable} for {@link DataSetObserver} + * that provides methods for sending notifications to a list of + * {@link DataSetObserver} objects. */ public class DataSetObservable extends Observable<DataSetObserver> { /** - * Invokes onChanged on each observer. Called when the data set being observed has - * changed, and which when read contains the new state of the data. + * Invokes {@link DataSetObserver#onChanged} on each observer. + * Called when the contents of the data set have changed. The recipient + * will obtain the new contents the next time it queries the data set. */ public void notifyChanged() { synchronized(mObservers) { @@ -38,8 +40,9 @@ public class DataSetObservable extends Observable<DataSetObserver> { } /** - * Invokes onInvalidated on each observer. Called when the data set being monitored - * has changed such that it is no longer valid. + * Invokes {@link DataSetObserver#onInvalidated} on each observer. + * Called when the data set is no longer valid and cannot be queried again, + * such as when the data set has been closed. */ public void notifyInvalidated() { synchronized (mObservers) { |
