Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c87c92e0 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Add API to retrieve cursor notification URI.

Change-Id: I89f6c4d6ee6ef3675eff62ff6bca691b54c69f75
parent f27796cb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -7634,6 +7634,7 @@ package android.database {
    method public abstract float getFloat(int);
    method public abstract int getInt(int);
    method public abstract long getLong(int);
    method public abstract android.net.Uri getNotificationUri();
    method public abstract int getPosition();
    method public abstract short getShort(int);
    method public abstract java.lang.String getString(int);
@@ -7739,6 +7740,7 @@ package android.database {
    method public float getFloat(int);
    method public int getInt(int);
    method public long getLong(int);
    method public android.net.Uri getNotificationUri();
    method public int getPosition();
    method public short getShort(int);
    method public java.lang.String getString(int);
@@ -22628,6 +22630,7 @@ package android.test.mock {
    method public float getFloat(int);
    method public int getInt(int);
    method public long getLong(int);
    method public android.net.Uri getNotificationUri();
    method public int getPosition();
    method public short getShort(int);
    method public java.lang.String getString(int);
+3 −1
Original line number Diff line number Diff line
@@ -369,8 +369,10 @@ public abstract class AbstractCursor implements CrossProcessCursor {
    }

    public Uri getNotificationUri() {
        synchronized (mSelfObserverLock) {
            return mNotifyUri;
        }
    }

    public boolean getWantsAllOnMoveCalls() {
        return false;
+10 −0
Original line number Diff line number Diff line
@@ -424,6 +424,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().
+4 −0
Original line number Diff line number Diff line
@@ -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);        
    }
+4 −3
Original line number Diff line number Diff line
@@ -177,17 +177,18 @@ public class MockCursor implements Cursor {
        throw new UnsupportedOperationException("unimplemented mock method");
    }

    @SuppressWarnings("deprecation")
    public void setNotificationUri(ContentResolver cr, Uri uri) {
        throw new UnsupportedOperationException("unimplemented mock method");
    }

    @SuppressWarnings("deprecation")
    public Uri getNotificationUri() {
        throw new UnsupportedOperationException("unimplemented mock method");
    }

    public void unregisterContentObserver(ContentObserver observer) {
        throw new UnsupportedOperationException("unimplemented mock method");
    }

    @SuppressWarnings("deprecation")
    public void unregisterDataSetObserver(DataSetObserver observer) {
        throw new UnsupportedOperationException("unimplemented mock method");
    }