Loading api/current.txt +5 −2 Original line number Diff line number Diff line Loading @@ -6791,7 +6791,8 @@ package android.database { public class ContentObservable extends android.database.Observable { ctor public ContentObservable(); method public void dispatchChange(boolean); method public deprecated void dispatchChange(boolean); method public void dispatchChange(boolean, android.net.Uri); method public deprecated void notifyChange(boolean); method public void registerObserver(android.database.ContentObserver); } Loading @@ -6799,8 +6800,10 @@ package android.database { public abstract class ContentObserver { ctor public ContentObserver(android.os.Handler); method public boolean deliverSelfNotifications(); method public final void dispatchChange(boolean); method public final deprecated void dispatchChange(boolean); method public final void dispatchChange(boolean, android.net.Uri); method public void onChange(boolean); method public void onChange(boolean, android.net.Uri); } public abstract interface CrossProcessCursor implements android.database.Cursor { core/java/android/content/ContentService.java +1 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ public final class ContentService extends IContentService.Stub { for (int i=0; i<numCalls; i++) { ObserverCall oc = calls.get(i); try { oc.mObserver.onChange(oc.mSelfChange); oc.mObserver.onChange(oc.mSelfChange, uri); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Notified " + oc.mObserver + " of " + "update at " + uri); } Loading core/java/android/database/AbstractCursor.java +1 −1 Original line number Diff line number Diff line Loading @@ -300,7 +300,7 @@ public abstract class AbstractCursor implements CrossProcessCursor { */ protected void onChange(boolean selfChange) { synchronized (mSelfObserverLock) { mContentObservable.dispatchChange(selfChange); mContentObservable.dispatchChange(selfChange, null); if (mNotifyUri != null && selfChange) { mContentResolver.notifyChange(mNotifyUri, mSelfObserver); } Loading core/java/android/database/ContentObservable.java +27 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.database; import android.net.Uri; /** * A specialization of {@link Observable} for {@link ContentObserver} * that provides methods for sending notifications to a list of Loading @@ -31,20 +33,41 @@ public class ContentObservable extends Observable<ContentObserver> { } /** * Invokes {@link ContentObserver#dispatchChange} on each observer. * * Invokes {@link ContentObserver#dispatchChange(boolean)} on each observer. * <p> * If <code>selfChange</code> is true, only delivers the notification * to the observer if it has indicated that it wants to receive self-change * notifications by implementing {@link ContentObserver#deliverSelfNotifications} * to return true. * </p> * * @param selfChange True if this is a self-change notification. * * @deprecated Use {@link #dispatchChange(boolean, Uri)} instead. */ @Deprecated public void dispatchChange(boolean selfChange) { dispatchChange(selfChange, null); } /** * Invokes {@link ContentObserver#dispatchChange(boolean, Uri)} on each observer. * Includes the changed content Uri when available. * <p> * If <code>selfChange</code> is true, only delivers the notification * to the observer if it has indicated that it wants to receive self-change * notifications by implementing {@link ContentObserver#deliverSelfNotifications} * to return true. * </p> * * @param selfChange True if this is a self-change notification. * @param uri The Uri of the changed content, or null if unknown. */ public void dispatchChange(boolean selfChange, Uri uri) { synchronized(mObservers) { for (ContentObserver observer : mObservers) { if (!selfChange || observer.deliverSelfNotifications()) { observer.dispatchChange(selfChange); observer.dispatchChange(selfChange, uri); } } } Loading @@ -61,7 +84,7 @@ public class ContentObservable extends Observable<ContentObserver> { public void notifyChange(boolean selfChange) { synchronized(mObservers) { for (ContentObserver observer : mObservers) { observer.onChange(selfChange); observer.onChange(selfChange, null); } } } Loading core/java/android/database/ContentObserver.java +70 −9 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.database; import android.net.Uri; import android.os.Handler; /** Loading Loading @@ -83,6 +84,9 @@ public abstract class ContentObserver { /** * This method is called when a content change occurs. * <p> * Subclasses should override this method to handle content changes. * </p> * * @param selfChange True if this is a self-change notification. */ Loading @@ -91,32 +95,89 @@ public abstract class ContentObserver { } /** * Dispatches a change notification to the observer. * This method is called when a content change occurs. * Includes the changed content Uri when available. * <p> * Subclasses should override this method to handle content changes. * To ensure correct operation on older versions of the framework that * did not provide a Uri argument, applications should also implement * the {@link #onChange(boolean)} overload of this method whenever they * implement the {@link #onChange(boolean, Uri)} overload. * </p><p> * Example implementation: * <pre><code> * // Implement the onChange(boolean) method to delegate the change notification to * // the onChange(boolean, Uri) method to ensure correct operation on older versions * // of the framework that did not have the onChange(boolean, Uri) method. * {@literal @Override} * public void onChange(boolean selfChange) { * onChange(selfChange, null); * } * * // Implement the onChange(boolean, Uri) method to take advantage of the new Uri argument. * {@literal @Override} * public void onChange(boolean selfChange, Uri uri) { * // Handle change. * } * </code></pre> * </p> * * @param selfChange True if this is a self-change notification. * @param uri The Uri of the changed content, or null if unknown. */ public void onChange(boolean selfChange, Uri uri) { onChange(selfChange); } /** * Dispatches a change notification to the observer. * <p> * If a {@link Handler} was supplied to the {@link ContentObserver} constructor, * then a call to the {@link #onChange} method is posted to the handler's message queue. * Otherwise, the {@link #onChange} method is invoked immediately on this thread. * </p> * * @param selfChange True if this is a self-change notification. * * @deprecated Use {@link #dispatchChange(boolean, Uri)} instead. */ @Deprecated public final void dispatchChange(boolean selfChange) { dispatchChange(selfChange, null); } /** * Dispatches a change notification to the observer. * Includes the changed content Uri when available. * <p> * If a {@link Handler} was supplied to the {@link ContentObserver} constructor, * then a call to the {@link #onChange} method is posted to the handler's message queue. * Otherwise, the {@link #onChange} method is invoked immediately on this thread. * </p> * * @param selfChange True if this is a self-change notification. * @param uri The Uri of the changed content, or null if unknown. */ public final void dispatchChange(boolean selfChange, Uri uri) { if (mHandler == null) { onChange(selfChange); onChange(selfChange, uri); } else { mHandler.post(new NotificationRunnable(selfChange)); mHandler.post(new NotificationRunnable(selfChange, uri)); } } private final class NotificationRunnable implements Runnable { private final boolean mSelf; private final boolean mSelfChange; private final Uri mUri; public NotificationRunnable(boolean self) { mSelf = self; public NotificationRunnable(boolean selfChange, Uri uri) { mSelfChange = selfChange; mUri = uri; } @Override public void run() { ContentObserver.this.onChange(mSelf); ContentObserver.this.onChange(mSelfChange, mUri); } } Loading @@ -128,10 +189,10 @@ public abstract class ContentObserver { } @Override public void onChange(boolean selfChange) { public void onChange(boolean selfChange, Uri uri) { ContentObserver contentObserver = mContentObserver; if (contentObserver != null) { contentObserver.dispatchChange(selfChange); contentObserver.dispatchChange(selfChange, uri); } } Loading Loading
api/current.txt +5 −2 Original line number Diff line number Diff line Loading @@ -6791,7 +6791,8 @@ package android.database { public class ContentObservable extends android.database.Observable { ctor public ContentObservable(); method public void dispatchChange(boolean); method public deprecated void dispatchChange(boolean); method public void dispatchChange(boolean, android.net.Uri); method public deprecated void notifyChange(boolean); method public void registerObserver(android.database.ContentObserver); } Loading @@ -6799,8 +6800,10 @@ package android.database { public abstract class ContentObserver { ctor public ContentObserver(android.os.Handler); method public boolean deliverSelfNotifications(); method public final void dispatchChange(boolean); method public final deprecated void dispatchChange(boolean); method public final void dispatchChange(boolean, android.net.Uri); method public void onChange(boolean); method public void onChange(boolean, android.net.Uri); } public abstract interface CrossProcessCursor implements android.database.Cursor {
core/java/android/content/ContentService.java +1 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ public final class ContentService extends IContentService.Stub { for (int i=0; i<numCalls; i++) { ObserverCall oc = calls.get(i); try { oc.mObserver.onChange(oc.mSelfChange); oc.mObserver.onChange(oc.mSelfChange, uri); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Notified " + oc.mObserver + " of " + "update at " + uri); } Loading
core/java/android/database/AbstractCursor.java +1 −1 Original line number Diff line number Diff line Loading @@ -300,7 +300,7 @@ public abstract class AbstractCursor implements CrossProcessCursor { */ protected void onChange(boolean selfChange) { synchronized (mSelfObserverLock) { mContentObservable.dispatchChange(selfChange); mContentObservable.dispatchChange(selfChange, null); if (mNotifyUri != null && selfChange) { mContentResolver.notifyChange(mNotifyUri, mSelfObserver); } Loading
core/java/android/database/ContentObservable.java +27 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.database; import android.net.Uri; /** * A specialization of {@link Observable} for {@link ContentObserver} * that provides methods for sending notifications to a list of Loading @@ -31,20 +33,41 @@ public class ContentObservable extends Observable<ContentObserver> { } /** * Invokes {@link ContentObserver#dispatchChange} on each observer. * * Invokes {@link ContentObserver#dispatchChange(boolean)} on each observer. * <p> * If <code>selfChange</code> is true, only delivers the notification * to the observer if it has indicated that it wants to receive self-change * notifications by implementing {@link ContentObserver#deliverSelfNotifications} * to return true. * </p> * * @param selfChange True if this is a self-change notification. * * @deprecated Use {@link #dispatchChange(boolean, Uri)} instead. */ @Deprecated public void dispatchChange(boolean selfChange) { dispatchChange(selfChange, null); } /** * Invokes {@link ContentObserver#dispatchChange(boolean, Uri)} on each observer. * Includes the changed content Uri when available. * <p> * If <code>selfChange</code> is true, only delivers the notification * to the observer if it has indicated that it wants to receive self-change * notifications by implementing {@link ContentObserver#deliverSelfNotifications} * to return true. * </p> * * @param selfChange True if this is a self-change notification. * @param uri The Uri of the changed content, or null if unknown. */ public void dispatchChange(boolean selfChange, Uri uri) { synchronized(mObservers) { for (ContentObserver observer : mObservers) { if (!selfChange || observer.deliverSelfNotifications()) { observer.dispatchChange(selfChange); observer.dispatchChange(selfChange, uri); } } } Loading @@ -61,7 +84,7 @@ public class ContentObservable extends Observable<ContentObserver> { public void notifyChange(boolean selfChange) { synchronized(mObservers) { for (ContentObserver observer : mObservers) { observer.onChange(selfChange); observer.onChange(selfChange, null); } } } Loading
core/java/android/database/ContentObserver.java +70 −9 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.database; import android.net.Uri; import android.os.Handler; /** Loading Loading @@ -83,6 +84,9 @@ public abstract class ContentObserver { /** * This method is called when a content change occurs. * <p> * Subclasses should override this method to handle content changes. * </p> * * @param selfChange True if this is a self-change notification. */ Loading @@ -91,32 +95,89 @@ public abstract class ContentObserver { } /** * Dispatches a change notification to the observer. * This method is called when a content change occurs. * Includes the changed content Uri when available. * <p> * Subclasses should override this method to handle content changes. * To ensure correct operation on older versions of the framework that * did not provide a Uri argument, applications should also implement * the {@link #onChange(boolean)} overload of this method whenever they * implement the {@link #onChange(boolean, Uri)} overload. * </p><p> * Example implementation: * <pre><code> * // Implement the onChange(boolean) method to delegate the change notification to * // the onChange(boolean, Uri) method to ensure correct operation on older versions * // of the framework that did not have the onChange(boolean, Uri) method. * {@literal @Override} * public void onChange(boolean selfChange) { * onChange(selfChange, null); * } * * // Implement the onChange(boolean, Uri) method to take advantage of the new Uri argument. * {@literal @Override} * public void onChange(boolean selfChange, Uri uri) { * // Handle change. * } * </code></pre> * </p> * * @param selfChange True if this is a self-change notification. * @param uri The Uri of the changed content, or null if unknown. */ public void onChange(boolean selfChange, Uri uri) { onChange(selfChange); } /** * Dispatches a change notification to the observer. * <p> * If a {@link Handler} was supplied to the {@link ContentObserver} constructor, * then a call to the {@link #onChange} method is posted to the handler's message queue. * Otherwise, the {@link #onChange} method is invoked immediately on this thread. * </p> * * @param selfChange True if this is a self-change notification. * * @deprecated Use {@link #dispatchChange(boolean, Uri)} instead. */ @Deprecated public final void dispatchChange(boolean selfChange) { dispatchChange(selfChange, null); } /** * Dispatches a change notification to the observer. * Includes the changed content Uri when available. * <p> * If a {@link Handler} was supplied to the {@link ContentObserver} constructor, * then a call to the {@link #onChange} method is posted to the handler's message queue. * Otherwise, the {@link #onChange} method is invoked immediately on this thread. * </p> * * @param selfChange True if this is a self-change notification. * @param uri The Uri of the changed content, or null if unknown. */ public final void dispatchChange(boolean selfChange, Uri uri) { if (mHandler == null) { onChange(selfChange); onChange(selfChange, uri); } else { mHandler.post(new NotificationRunnable(selfChange)); mHandler.post(new NotificationRunnable(selfChange, uri)); } } private final class NotificationRunnable implements Runnable { private final boolean mSelf; private final boolean mSelfChange; private final Uri mUri; public NotificationRunnable(boolean self) { mSelf = self; public NotificationRunnable(boolean selfChange, Uri uri) { mSelfChange = selfChange; mUri = uri; } @Override public void run() { ContentObserver.this.onChange(mSelf); ContentObserver.this.onChange(mSelfChange, mUri); } } Loading @@ -128,10 +189,10 @@ public abstract class ContentObserver { } @Override public void onChange(boolean selfChange) { public void onChange(boolean selfChange, Uri uri) { ContentObserver contentObserver = mContentObserver; if (contentObserver != null) { contentObserver.dispatchChange(selfChange); contentObserver.dispatchChange(selfChange, uri); } } Loading