diff options
Diffstat (limited to 'core/java/android/database')
| -rw-r--r-- | core/java/android/database/AbstractCursor.java | 4 | ||||
| -rw-r--r-- | core/java/android/database/Cursor.java | 10 | ||||
| -rw-r--r-- | core/java/android/database/CursorWrapper.java | 4 |
3 files changed, 17 insertions, 1 deletions
diff --git a/core/java/android/database/AbstractCursor.java b/core/java/android/database/AbstractCursor.java index 300b4d1982df..b5b89dd17a5d 100644 --- a/core/java/android/database/AbstractCursor.java +++ b/core/java/android/database/AbstractCursor.java @@ -369,7 +369,9 @@ public abstract class AbstractCursor implements CrossProcessCursor { } public Uri getNotificationUri() { - return mNotifyUri; + synchronized (mSelfObserverLock) { + return mNotifyUri; + } } public boolean getWantsAllOnMoveCalls() { diff --git a/core/java/android/database/Cursor.java b/core/java/android/database/Cursor.java index 907833d9d49d..7381e2c403df 100644 --- a/core/java/android/database/Cursor.java +++ b/core/java/android/database/Cursor.java @@ -425,6 +425,16 @@ public interface Cursor extends Closeable { void setNotificationUri(ContentResolver cr, Uri uri); /** + * Return the URI at which notifications of changes in this Cursor's data + * will be delivered, as previously set by {@link #setNotificationUri}. + * @return Returns a URI that can be used with + * {@link ContentResolver#registerContentObserver(android.net.Uri, boolean, ContentObserver) + * ContentResolver.registerContentObserver} to find out about changes to this Cursor's + * data. May be null if no notification URI has been set. + */ + Uri getNotificationUri(); + + /** * onMove() will only be called across processes if this method returns true. * @return whether all cursor movement should result in a call to onMove(). */ diff --git a/core/java/android/database/CursorWrapper.java b/core/java/android/database/CursorWrapper.java index 7baeb8c2ed68..d8fcb17a1923 100644 --- a/core/java/android/database/CursorWrapper.java +++ b/core/java/android/database/CursorWrapper.java @@ -194,6 +194,10 @@ public class CursorWrapper implements Cursor { mCursor.setNotificationUri(cr, uri); } + public Uri getNotificationUri() { + return mCursor.getNotificationUri(); + } + public void unregisterContentObserver(ContentObserver observer) { mCursor.unregisterContentObserver(observer); } |
