Merge change 22178 into eclair
* changes: - add a reset to EntityIterator to allow it to go back to the beginning - clean up the debug printing of SyncResult
This commit is contained in:
@@ -25311,6 +25311,19 @@
|
|||||||
visibility="public"
|
visibility="public"
|
||||||
>
|
>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="reset"
|
||||||
|
return="void"
|
||||||
|
abstract="false"
|
||||||
|
native="false"
|
||||||
|
synchronized="false"
|
||||||
|
static="false"
|
||||||
|
final="false"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
<exception name="RemoteException" type="android.os.RemoteException">
|
||||||
|
</exception>
|
||||||
|
</method>
|
||||||
</class>
|
</class>
|
||||||
<class name="ActivityNotFoundException"
|
<class name="ActivityNotFoundException"
|
||||||
extends="java.lang.RuntimeException"
|
extends="java.lang.RuntimeException"
|
||||||
@@ -31226,6 +31239,19 @@
|
|||||||
<exception name="RemoteException" type="android.os.RemoteException">
|
<exception name="RemoteException" type="android.os.RemoteException">
|
||||||
</exception>
|
</exception>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="reset"
|
||||||
|
return="void"
|
||||||
|
abstract="true"
|
||||||
|
native="false"
|
||||||
|
synchronized="false"
|
||||||
|
static="false"
|
||||||
|
final="false"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
<exception name="RemoteException" type="android.os.RemoteException">
|
||||||
|
</exception>
|
||||||
|
</method>
|
||||||
</interface>
|
</interface>
|
||||||
<class name="Intent"
|
<class name="Intent"
|
||||||
extends="java.lang.Object"
|
extends="java.lang.Object"
|
||||||
|
|||||||
@@ -87,6 +87,14 @@ public abstract class AbstractCursorEntityIterator implements EntityIterator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reset() throws RemoteException {
|
||||||
|
if (mIsClosed) {
|
||||||
|
throw new IllegalStateException("calling reset() when the iterator is closed");
|
||||||
|
}
|
||||||
|
mEntityCursor.moveToPosition(-1);
|
||||||
|
mNextEntity = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes this iterator making it invalid. If is invalid for the user to call any public
|
* Closes this iterator making it invalid. If is invalid for the user to call any public
|
||||||
* method on the iterator once it has been closed.
|
* method on the iterator once it has been closed.
|
||||||
|
|||||||
@@ -281,6 +281,10 @@ abstract public class ContentProviderNative extends Binder implements IContentPr
|
|||||||
return mEntityIterator.next();
|
return mEntityIterator.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reset() throws RemoteException {
|
||||||
|
mEntityIterator.reset();
|
||||||
|
}
|
||||||
|
|
||||||
public void close() throws RemoteException {
|
public void close() throws RemoteException {
|
||||||
mEntityIterator.close();
|
mEntityIterator.close();
|
||||||
}
|
}
|
||||||
@@ -406,6 +410,10 @@ final class ContentProviderProxy implements IContentProvider
|
|||||||
return mEntityIterator.next();
|
return mEntityIterator.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reset() throws RemoteException {
|
||||||
|
mEntityIterator.reset();
|
||||||
|
}
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
try {
|
try {
|
||||||
mEntityIterator.close();
|
mEntityIterator.close();
|
||||||
|
|||||||
@@ -244,6 +244,13 @@ public abstract class ContentResolver {
|
|||||||
return mInner.next();
|
return mInner.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reset() throws RemoteException {
|
||||||
|
if (mClientReleased) {
|
||||||
|
throw new IllegalStateException("this iterator is already closed");
|
||||||
|
}
|
||||||
|
mInner.reset();
|
||||||
|
}
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
mClient.release();
|
mClient.release();
|
||||||
mInner.close();
|
mInner.close();
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ public interface EntityIterator {
|
|||||||
*/
|
*/
|
||||||
public Entity next() throws RemoteException;
|
public Entity next() throws RemoteException;
|
||||||
|
|
||||||
|
public void reset() throws RemoteException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates that this iterator is no longer needed and that any associated resources
|
* Indicates that this iterator is no longer needed and that any associated resources
|
||||||
* may be released (such as a SQLite cursor).
|
* may be released (such as a SQLite cursor).
|
||||||
|
|||||||
@@ -98,6 +98,20 @@ public interface IEntityIterator extends IInterface {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case TRANSACTION_reset:
|
||||||
|
{
|
||||||
|
data.enforceInterface(DESCRIPTOR);
|
||||||
|
try {
|
||||||
|
this.reset();
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Log.e(TAG, "caught exception in next()", e);
|
||||||
|
reply.writeException(e);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
reply.writeNoException();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
case TRANSACTION_close:
|
case TRANSACTION_close:
|
||||||
{
|
{
|
||||||
data.enforceInterface(DESCRIPTOR);
|
data.enforceInterface(DESCRIPTOR);
|
||||||
@@ -157,6 +171,19 @@ public interface IEntityIterator extends IInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reset() throws RemoteException {
|
||||||
|
Parcel _data = Parcel.obtain();
|
||||||
|
Parcel _reply = Parcel.obtain();
|
||||||
|
try {
|
||||||
|
_data.writeInterfaceToken(DESCRIPTOR);
|
||||||
|
mRemote.transact(Stub.TRANSACTION_reset, _data, _reply, 0);
|
||||||
|
_reply.readException();
|
||||||
|
} finally {
|
||||||
|
_reply.recycle();
|
||||||
|
_data.recycle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void close() throws RemoteException {
|
public void close() throws RemoteException {
|
||||||
Parcel _data = Parcel.obtain();
|
Parcel _data = Parcel.obtain();
|
||||||
Parcel _reply = Parcel.obtain();
|
Parcel _reply = Parcel.obtain();
|
||||||
@@ -174,8 +201,10 @@ public interface IEntityIterator extends IInterface {
|
|||||||
static final int TRANSACTION_hasNext = (IBinder.FIRST_CALL_TRANSACTION + 0);
|
static final int TRANSACTION_hasNext = (IBinder.FIRST_CALL_TRANSACTION + 0);
|
||||||
static final int TRANSACTION_next = (IBinder.FIRST_CALL_TRANSACTION + 1);
|
static final int TRANSACTION_next = (IBinder.FIRST_CALL_TRANSACTION + 1);
|
||||||
static final int TRANSACTION_close = (IBinder.FIRST_CALL_TRANSACTION + 2);
|
static final int TRANSACTION_close = (IBinder.FIRST_CALL_TRANSACTION + 2);
|
||||||
|
static final int TRANSACTION_reset = (IBinder.FIRST_CALL_TRANSACTION + 3);
|
||||||
}
|
}
|
||||||
public boolean hasNext() throws RemoteException;
|
public boolean hasNext() throws RemoteException;
|
||||||
public Entity next() throws RemoteException;
|
public Entity next() throws RemoteException;
|
||||||
|
public void reset() throws RemoteException;
|
||||||
public void close() throws RemoteException;
|
public void close() throws RemoteException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,14 +113,19 @@ public final class SyncResult implements Parcelable {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("SyncResult:");
|
||||||
|
if (syncAlreadyInProgress) {
|
||||||
sb.append(" syncAlreadyInProgress: ").append(syncAlreadyInProgress);
|
sb.append(" syncAlreadyInProgress: ").append(syncAlreadyInProgress);
|
||||||
sb.append(" tooManyDeletions: ").append(tooManyDeletions);
|
}
|
||||||
sb.append(" tooManyRetries: ").append(tooManyRetries);
|
if (tooManyDeletions) sb.append(" tooManyDeletions: ").append(tooManyDeletions);
|
||||||
sb.append(" databaseError: ").append(databaseError);
|
if (tooManyRetries) sb.append(" tooManyRetries: ").append(tooManyRetries);
|
||||||
sb.append(" fullSyncRequested: ").append(fullSyncRequested);
|
if (databaseError) sb.append(" databaseError: ").append(databaseError);
|
||||||
|
if (fullSyncRequested) sb.append(" fullSyncRequested: ").append(fullSyncRequested);
|
||||||
|
if (partialSyncUnavailable) {
|
||||||
sb.append(" partialSyncUnavailable: ").append(partialSyncUnavailable);
|
sb.append(" partialSyncUnavailable: ").append(partialSyncUnavailable);
|
||||||
sb.append(" moreRecordsToGet: ").append(moreRecordsToGet);
|
}
|
||||||
sb.append(" stats: ").append(stats);
|
if (moreRecordsToGet) sb.append(" moreRecordsToGet: ").append(moreRecordsToGet);
|
||||||
|
sb.append(stats);
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,15 +60,18 @@ public class SyncStats implements Parcelable {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("numAuthExceptions: ").append(numAuthExceptions);
|
sb.append(" stats [");
|
||||||
sb.append(" numIoExceptions: ").append(numIoExceptions);
|
if (numAuthExceptions > 0) sb.append(" numAuthExceptions: ").append(numAuthExceptions);
|
||||||
sb.append(" numParseExceptions: ").append(numParseExceptions);
|
if (numIoExceptions > 0) sb.append(" numIoExceptions: ").append(numIoExceptions);
|
||||||
|
if (numParseExceptions > 0) sb.append(" numParseExceptions: ").append(numParseExceptions);
|
||||||
|
if (numConflictDetectedExceptions > 0)
|
||||||
sb.append(" numConflictDetectedExceptions: ").append(numConflictDetectedExceptions);
|
sb.append(" numConflictDetectedExceptions: ").append(numConflictDetectedExceptions);
|
||||||
sb.append(" numInserts: ").append(numInserts);
|
if (numInserts > 0) sb.append(" numInserts: ").append(numInserts);
|
||||||
sb.append(" numUpdates: ").append(numUpdates);
|
if (numUpdates > 0) sb.append(" numUpdates: ").append(numUpdates);
|
||||||
sb.append(" numDeletes: ").append(numDeletes);
|
if (numDeletes > 0) sb.append(" numDeletes: ").append(numDeletes);
|
||||||
sb.append(" numEntries: ").append(numEntries);
|
if (numEntries > 0) sb.append(" numEntries: ").append(numEntries);
|
||||||
sb.append(" numSkippedEntries: ").append(numSkippedEntries);
|
if (numSkippedEntries > 0) sb.append(" numSkippedEntries: ").append(numSkippedEntries);
|
||||||
|
sb.append("]");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user