diff options
author | Jeff Brown <jeffbrown@google.com> | 2015-04-09 18:28:24 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2015-04-09 19:48:11 -0700 |
commit | 4e0951ef7a2bb492fd1255b83eba00b1b0556290 (patch) | |
tree | 3638f2a096e0a3368f831eb9df58487d516521a8 | |
parent | 8faab36fdd2d7dd038885a5073eeb8354d8996d4 (diff) | |
download | frameworks_base-4e0951ef7a2bb492fd1255b83eba00b1b0556290.zip frameworks_base-4e0951ef7a2bb492fd1255b83eba00b1b0556290.tar.gz frameworks_base-4e0951ef7a2bb492fd1255b83eba00b1b0556290.tar.bz2 |
Expose Cursor.setExtras().
Bug: 19369537
Change-Id: I78e319667cbfaeb51f471d18c4fefeac01d49d80
-rw-r--r-- | api/current.txt | 7 | ||||
-rw-r--r-- | api/system-current.txt | 7 | ||||
-rw-r--r-- | core/java/android/database/AbstractCursor.java | 12 | ||||
-rw-r--r-- | core/java/android/database/Cursor.java | 7 | ||||
-rw-r--r-- | core/java/android/database/CursorWrapper.java | 55 | ||||
-rw-r--r-- | test-runner/src/android/test/mock/MockCursor.java | 47 |
6 files changed, 120 insertions, 15 deletions
diff --git a/api/current.txt b/api/current.txt index 46e3be1..ec8b5d0 100644 --- a/api/current.txt +++ b/api/current.txt @@ -9740,6 +9740,7 @@ package android.database { method public void registerDataSetObserver(android.database.DataSetObserver); method public boolean requery(); method public android.os.Bundle respond(android.os.Bundle); + method public void setExtras(android.os.Bundle); method public void setNotificationUri(android.content.ContentResolver, android.net.Uri); method public void unregisterContentObserver(android.database.ContentObserver); method public void unregisterDataSetObserver(android.database.DataSetObserver); @@ -9845,6 +9846,7 @@ package android.database { method public abstract void registerDataSetObserver(android.database.DataSetObserver); method public abstract deprecated boolean requery(); method public abstract android.os.Bundle respond(android.os.Bundle); + method public abstract void setExtras(android.os.Bundle); method public abstract void setNotificationUri(android.content.ContentResolver, android.net.Uri); method public abstract void unregisterContentObserver(android.database.ContentObserver); method public abstract void unregisterDataSetObserver(android.database.DataSetObserver); @@ -9916,7 +9918,7 @@ package android.database { ctor public CursorWrapper(android.database.Cursor); method public void close(); method public void copyStringToBuffer(int, android.database.CharArrayBuffer); - method public void deactivate(); + method public deprecated void deactivate(); method public byte[] getBlob(int); method public int getColumnCount(); method public int getColumnIndex(java.lang.String); @@ -9950,8 +9952,9 @@ package android.database { method public boolean moveToPrevious(); method public void registerContentObserver(android.database.ContentObserver); method public void registerDataSetObserver(android.database.DataSetObserver); - method public boolean requery(); + method public deprecated boolean requery(); method public android.os.Bundle respond(android.os.Bundle); + method public void setExtras(android.os.Bundle); method public void setNotificationUri(android.content.ContentResolver, android.net.Uri); method public void unregisterContentObserver(android.database.ContentObserver); method public void unregisterDataSetObserver(android.database.DataSetObserver); diff --git a/api/system-current.txt b/api/system-current.txt index 80c00ca..3de90a7 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -10030,6 +10030,7 @@ package android.database { method public void registerDataSetObserver(android.database.DataSetObserver); method public boolean requery(); method public android.os.Bundle respond(android.os.Bundle); + method public void setExtras(android.os.Bundle); method public void setNotificationUri(android.content.ContentResolver, android.net.Uri); method public void unregisterContentObserver(android.database.ContentObserver); method public void unregisterDataSetObserver(android.database.DataSetObserver); @@ -10135,6 +10136,7 @@ package android.database { method public abstract void registerDataSetObserver(android.database.DataSetObserver); method public abstract deprecated boolean requery(); method public abstract android.os.Bundle respond(android.os.Bundle); + method public abstract void setExtras(android.os.Bundle); method public abstract void setNotificationUri(android.content.ContentResolver, android.net.Uri); method public abstract void unregisterContentObserver(android.database.ContentObserver); method public abstract void unregisterDataSetObserver(android.database.DataSetObserver); @@ -10206,7 +10208,7 @@ package android.database { ctor public CursorWrapper(android.database.Cursor); method public void close(); method public void copyStringToBuffer(int, android.database.CharArrayBuffer); - method public void deactivate(); + method public deprecated void deactivate(); method public byte[] getBlob(int); method public int getColumnCount(); method public int getColumnIndex(java.lang.String); @@ -10240,8 +10242,9 @@ package android.database { method public boolean moveToPrevious(); method public void registerContentObserver(android.database.ContentObserver); method public void registerDataSetObserver(android.database.DataSetObserver); - method public boolean requery(); + method public deprecated boolean requery(); method public android.os.Bundle respond(android.os.Bundle); + method public void setExtras(android.os.Bundle); method public void setNotificationUri(android.content.ContentResolver, android.net.Uri); method public void unregisterContentObserver(android.database.ContentObserver); method public void unregisterDataSetObserver(android.database.DataSetObserver); diff --git a/core/java/android/database/AbstractCursor.java b/core/java/android/database/AbstractCursor.java index 5762c1d..581fe7f 100644 --- a/core/java/android/database/AbstractCursor.java +++ b/core/java/android/database/AbstractCursor.java @@ -404,31 +404,29 @@ public abstract class AbstractCursor implements CrossProcessCursor { } } + @Override public Uri getNotificationUri() { synchronized (mSelfObserverLock) { return mNotifyUri; } } + @Override public boolean getWantsAllOnMoveCalls() { return false; } - /** - * Sets a {@link Bundle} that will be returned by {@link #getExtras()}. <code>null</code> will - * be converted into {@link Bundle#EMPTY}. - * - * @param extras {@link Bundle} to set. - * @hide - */ + @Override public void setExtras(Bundle extras) { mExtras = (extras == null) ? Bundle.EMPTY : extras; } + @Override public Bundle getExtras() { return mExtras; } + @Override public Bundle respond(Bundle extras) { return Bundle.EMPTY; } diff --git a/core/java/android/database/Cursor.java b/core/java/android/database/Cursor.java index fc2a885..d10c9b8 100644 --- a/core/java/android/database/Cursor.java +++ b/core/java/android/database/Cursor.java @@ -444,6 +444,13 @@ public interface Cursor extends Closeable { boolean getWantsAllOnMoveCalls(); /** + * Sets a {@link Bundle} that will be returned by {@link #getExtras()}. + * + * @param extras {@link Bundle} to set, or null to set an empty bundle. + */ + void setExtras(Bundle extras); + + /** * Returns a bundle of extra values. This is an optional way for cursors to provide out-of-band * metadata to their users. One use of this is for reporting on the progress of network requests * that are required to fetch data for the cursor. diff --git a/core/java/android/database/CursorWrapper.java b/core/java/android/database/CursorWrapper.java index d8fcb17..63a2792 100644 --- a/core/java/android/database/CursorWrapper.java +++ b/core/java/android/database/CursorWrapper.java @@ -45,163 +45,210 @@ public class CursorWrapper implements Cursor { return mCursor; } + @Override public void close() { mCursor.close(); } + @Override public boolean isClosed() { return mCursor.isClosed(); } + @Override public int getCount() { return mCursor.getCount(); } + @Override + @Deprecated public void deactivate() { mCursor.deactivate(); } + @Override public boolean moveToFirst() { return mCursor.moveToFirst(); } + @Override public int getColumnCount() { return mCursor.getColumnCount(); } + @Override public int getColumnIndex(String columnName) { return mCursor.getColumnIndex(columnName); } + @Override public int getColumnIndexOrThrow(String columnName) throws IllegalArgumentException { return mCursor.getColumnIndexOrThrow(columnName); } + @Override public String getColumnName(int columnIndex) { return mCursor.getColumnName(columnIndex); } + @Override public String[] getColumnNames() { return mCursor.getColumnNames(); } + @Override public double getDouble(int columnIndex) { return mCursor.getDouble(columnIndex); } + @Override + public void setExtras(Bundle extras) { + mCursor.setExtras(extras); + } + + @Override public Bundle getExtras() { return mCursor.getExtras(); } + @Override public float getFloat(int columnIndex) { return mCursor.getFloat(columnIndex); } + @Override public int getInt(int columnIndex) { return mCursor.getInt(columnIndex); } + @Override public long getLong(int columnIndex) { return mCursor.getLong(columnIndex); } + @Override public short getShort(int columnIndex) { return mCursor.getShort(columnIndex); } + @Override public String getString(int columnIndex) { return mCursor.getString(columnIndex); } + @Override public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) { mCursor.copyStringToBuffer(columnIndex, buffer); } + @Override public byte[] getBlob(int columnIndex) { return mCursor.getBlob(columnIndex); } + @Override public boolean getWantsAllOnMoveCalls() { return mCursor.getWantsAllOnMoveCalls(); } + @Override public boolean isAfterLast() { return mCursor.isAfterLast(); } + @Override public boolean isBeforeFirst() { return mCursor.isBeforeFirst(); } + @Override public boolean isFirst() { return mCursor.isFirst(); } + @Override public boolean isLast() { return mCursor.isLast(); } + @Override public int getType(int columnIndex) { return mCursor.getType(columnIndex); } + @Override public boolean isNull(int columnIndex) { return mCursor.isNull(columnIndex); } + @Override public boolean moveToLast() { return mCursor.moveToLast(); } + @Override public boolean move(int offset) { return mCursor.move(offset); } + @Override public boolean moveToPosition(int position) { return mCursor.moveToPosition(position); } + @Override public boolean moveToNext() { return mCursor.moveToNext(); } + @Override public int getPosition() { return mCursor.getPosition(); } + @Override public boolean moveToPrevious() { return mCursor.moveToPrevious(); } + @Override public void registerContentObserver(ContentObserver observer) { - mCursor.registerContentObserver(observer); + mCursor.registerContentObserver(observer); } + @Override public void registerDataSetObserver(DataSetObserver observer) { - mCursor.registerDataSetObserver(observer); + mCursor.registerDataSetObserver(observer); } + @Override + @Deprecated public boolean requery() { return mCursor.requery(); } + @Override public Bundle respond(Bundle extras) { return mCursor.respond(extras); } + @Override public void setNotificationUri(ContentResolver cr, Uri uri) { - mCursor.setNotificationUri(cr, uri); + mCursor.setNotificationUri(cr, uri); } + @Override public Uri getNotificationUri() { return mCursor.getNotificationUri(); } + @Override public void unregisterContentObserver(ContentObserver observer) { - mCursor.unregisterContentObserver(observer); + mCursor.unregisterContentObserver(observer); } + @Override public void unregisterDataSetObserver(DataSetObserver observer) { mCursor.unregisterDataSetObserver(observer); } diff --git a/test-runner/src/android/test/mock/MockCursor.java b/test-runner/src/android/test/mock/MockCursor.java index a37c6eb..28fa0f8 100644 --- a/test-runner/src/android/test/mock/MockCursor.java +++ b/test-runner/src/android/test/mock/MockCursor.java @@ -35,162 +35,209 @@ import android.os.Bundle; * </P> */ public class MockCursor implements Cursor { + @Override public int getColumnCount() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public int getColumnIndex(String columnName) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public int getColumnIndexOrThrow(String columnName) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public String getColumnName(int columnIndex) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public String[] getColumnNames() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public int getCount() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean isNull(int columnIndex) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public int getInt(int columnIndex) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public long getLong(int columnIndex) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public short getShort(int columnIndex) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public float getFloat(int columnIndex) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public double getDouble(int columnIndex) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public byte[] getBlob(int columnIndex) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public String getString(int columnIndex) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override + public void setExtras(Bundle extras) { + throw new UnsupportedOperationException("unimplemented mock method"); + } + + @Override public Bundle getExtras() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public int getPosition() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean isAfterLast() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean isBeforeFirst() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean isFirst() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean isLast() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean move(int offset) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean moveToFirst() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean moveToLast() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean moveToNext() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean moveToPrevious() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean moveToPosition(int position) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override + @Deprecated public void deactivate() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public void close() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean isClosed() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override + @Deprecated public boolean requery() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public void registerContentObserver(ContentObserver observer) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public void registerDataSetObserver(DataSetObserver observer) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public Bundle respond(Bundle extras) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public boolean getWantsAllOnMoveCalls() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public void setNotificationUri(ContentResolver cr, Uri uri) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public Uri getNotificationUri() { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public void unregisterContentObserver(ContentObserver observer) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public void unregisterDataSetObserver(DataSetObserver observer) { throw new UnsupportedOperationException("unimplemented mock method"); } + @Override public int getType(int columnIndex) { throw new UnsupportedOperationException("unimplemented mock method"); } |