diff --git a/api/current.xml b/api/current.xml index 016773ed003be..8611d51679ea0 100644 --- a/api/current.xml +++ b/api/current.xml @@ -30012,48 +30012,6 @@ > - - - - - - - - - + + - - - - - - - - - - + + + + + + + + { /** - * Returns whether there are more elements to iterate, i.e. whether the - * iterator is positioned in front of an element. - * - * @return {@code true} if there are more elements, {@code false} otherwise. - * @see #next - * @since Android 1.0 + * Reset the iterator back to the beginning. */ - public boolean hasNext() throws RemoteException; - - /** - * Returns the next object in the iteration, i.e. returns the element in - * front of the iterator and advances the iterator by one position. - * - * @return the next object. - * @throws java.util.NoSuchElementException - * if there are no more elements. - * @see #hasNext - * @since Android 1.0 - */ - public Entity next() throws RemoteException; - - public void reset() throws RemoteException; + public void reset(); /** * Indicates that this iterator is no longer needed and that any associated resources diff --git a/core/java/android/content/IContentService.aidl b/core/java/android/content/IContentService.aidl index 2d906ed0d725d..a6368d53a4a85 100644 --- a/core/java/android/content/IContentService.aidl +++ b/core/java/android/content/IContentService.aidl @@ -17,7 +17,7 @@ package android.content; import android.accounts.Account; -import android.content.ActiveSyncInfo; +import android.content.SyncInfo; import android.content.ISyncStatusObserver; import android.content.SyncAdapterType; import android.content.SyncStatusInfo; @@ -104,7 +104,7 @@ interface IContentService { */ boolean isSyncActive(in Account account, String authority); - ActiveSyncInfo getActiveSync(); + SyncInfo getCurrentSync(); /** * Returns the types of the SyncAdapters that are registered with the system. diff --git a/core/java/android/content/ActiveSyncInfo.aidl b/core/java/android/content/SyncInfo.aidl similarity index 95% rename from core/java/android/content/ActiveSyncInfo.aidl rename to core/java/android/content/SyncInfo.aidl index 1142206d13a82..0737429abfdf9 100644 --- a/core/java/android/content/ActiveSyncInfo.aidl +++ b/core/java/android/content/SyncInfo.aidl @@ -16,4 +16,4 @@ package android.content; -parcelable ActiveSyncInfo; +parcelable SyncInfo; diff --git a/core/java/android/content/ActiveSyncInfo.java b/core/java/android/content/SyncInfo.java similarity index 58% rename from core/java/android/content/ActiveSyncInfo.java rename to core/java/android/content/SyncInfo.java index b0c90a119f14b..616b05fb38eb6 100644 --- a/core/java/android/content/ActiveSyncInfo.java +++ b/core/java/android/content/SyncInfo.java @@ -23,44 +23,29 @@ import android.os.Parcelable.Creator; /** * Information about the sync operation that is currently underway. */ -public class ActiveSyncInfo { - private final int authorityId; - private final Account account; - private final String authority; - private final long startTime; - - /** - * Get the {@link Account} that is currently being synced. - * @return the account - */ - public Account getAccount() { - return new Account(account.name, account.type); - } - +public class SyncInfo { /** @hide */ - public int getAuthorityId() { - return authorityId; - } + public final int authorityId; /** - * Get the authority of the provider that is currently being synced. - * @return the authority + * The {@link Account} that is currently being synced. */ - public String getAuthority() { - return authority; - } + public final Account account; /** - * Get the start time of the current sync operation. This is represented in elapsed real time. + * The authority of the provider that is currently being synced. + */ + public final String authority; + + /** + * The start time of the current sync operation in milliseconds since boot. + * This is represented in elapsed real time. * See {@link android.os.SystemClock#elapsedRealtime()}. - * @return the start time in milliseconds since boot */ - public long getStartTime() { - return startTime; - } + public final long startTime; /** @hide */ - ActiveSyncInfo(int authorityId, Account account, String authority, + SyncInfo(int authorityId, Account account, String authority, long startTime) { this.authorityId = authorityId; this.account = account; @@ -82,7 +67,7 @@ public class ActiveSyncInfo { } /** @hide */ - ActiveSyncInfo(Parcel parcel) { + SyncInfo(Parcel parcel) { authorityId = parcel.readInt(); account = new Account(parcel); authority = parcel.readString(); @@ -90,13 +75,13 @@ public class ActiveSyncInfo { } /** @hide */ - public static final Creator CREATOR = new Creator() { - public ActiveSyncInfo createFromParcel(Parcel in) { - return new ActiveSyncInfo(in); + public static final Creator CREATOR = new Creator() { + public SyncInfo createFromParcel(Parcel in) { + return new SyncInfo(in); } - public ActiveSyncInfo[] newArray(int size) { - return new ActiveSyncInfo[size]; + public SyncInfo[] newArray(int size) { + return new SyncInfo[size]; } }; } diff --git a/core/java/android/content/SyncManager.java b/core/java/android/content/SyncManager.java index 5c8ee187e8d03..13da1ea6e8d4c 100644 --- a/core/java/android/content/SyncManager.java +++ b/core/java/android/content/SyncManager.java @@ -1026,11 +1026,11 @@ public class SyncManager implements OnAccountsUpdateListener { pw.println(sb.toString()); } - ActiveSyncInfo active = mSyncStorageEngine.getActiveSync(); + SyncInfo active = mSyncStorageEngine.getCurrentSync(); if (active != null) { SyncStorageEngine.AuthorityInfo authority - = mSyncStorageEngine.getAuthority(active.getAuthorityId()); - final long durationInSeconds = (now - active.getStartTime()) / 1000; + = mSyncStorageEngine.getAuthority(active.authorityId); + final long durationInSeconds = (now - active.startTime) / 1000; pw.print("Active sync: "); pw.print(authority != null ? authority.account : ""); pw.print(" "); diff --git a/core/java/android/content/SyncStorageEngine.java b/core/java/android/content/SyncStorageEngine.java index 6a959ae32e152..c848a00f1bc20 100644 --- a/core/java/android/content/SyncStorageEngine.java +++ b/core/java/android/content/SyncStorageEngine.java @@ -230,7 +230,7 @@ public class SyncStorageEngine extends Handler { private final ArrayList mPendingOperations = new ArrayList(); - private ActiveSyncInfo mActiveSync; + private SyncInfo mCurrentSync; private final SparseArray mSyncStatus = new SparseArray(); @@ -678,8 +678,8 @@ public class SyncStorageEngine extends Handler { } } - if (mActiveSync != null) { - AuthorityInfo ainfo = getAuthority(mActiveSync.getAuthorityId()); + if (mCurrentSync != null) { + AuthorityInfo ainfo = getAuthority(mCurrentSync.authorityId); if (ainfo != null && ainfo.account.equals(account) && ainfo.authority.equals(authority)) { return true; @@ -864,7 +864,7 @@ public class SyncStorageEngine extends Handler { + " auth=" + activeSyncContext.mSyncOperation.authority + " src=" + activeSyncContext.mSyncOperation.syncSource + " extras=" + activeSyncContext.mSyncOperation.extras); - if (mActiveSync != null) { + if (mCurrentSync != null) { Log.w(TAG, "setActiveSync called with existing active sync!"); } AuthorityInfo authority = getAuthorityLocked( @@ -874,12 +874,12 @@ public class SyncStorageEngine extends Handler { if (authority == null) { return; } - mActiveSync = new ActiveSyncInfo(authority.ident, + mCurrentSync = new SyncInfo(authority.ident, authority.account, authority.authority, activeSyncContext.mStartTime); } else { if (DEBUG) Log.v(TAG, "setActiveSync: null"); - mActiveSync = null; + mCurrentSync = null; } } @@ -1063,9 +1063,9 @@ public class SyncStorageEngine extends Handler { * active sync. Note that the returned object is the real, live active * sync object, so be careful what you do with it. */ - public ActiveSyncInfo getActiveSync() { + public SyncInfo getCurrentSync() { synchronized (mAuthorities) { - return mActiveSync; + return mCurrentSync; } } diff --git a/core/java/android/pim/vcard/VCardComposer.java b/core/java/android/pim/vcard/VCardComposer.java index 194fe339d65a3..dc0d86466ee5f 100644 --- a/core/java/android/pim/vcard/VCardComposer.java +++ b/core/java/android/pim/vcard/VCardComposer.java @@ -24,7 +24,6 @@ import android.content.Entity.NamedContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteException; import android.net.Uri; -import android.os.RemoteException; import android.pim.vcard.exception.VCardException; import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Data; @@ -522,10 +521,6 @@ public class VCardComposer { } } } - } catch (RemoteException e) { - Log.e(LOG_TAG, String.format("RemoteException at id %s (%s)", - contactId, e.getMessage())); - return ""; } finally { if (entityIterator != null) { entityIterator.close(); diff --git a/core/tests/coretests/src/android/pim/vcard/ExportTestResolver.java b/core/tests/coretests/src/android/pim/vcard/ExportTestResolver.java index 1b3cdcc555450..5968e83647d18 100644 --- a/core/tests/coretests/src/android/pim/vcard/ExportTestResolver.java +++ b/core/tests/coretests/src/android/pim/vcard/ExportTestResolver.java @@ -21,7 +21,6 @@ import android.content.Entity; import android.content.EntityIterator; import android.database.Cursor; import android.net.Uri; -import android.pim.vcard.VCardComposer; import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Data; import android.provider.ContactsContract.RawContacts; @@ -69,6 +68,10 @@ import java.util.List; return mIterator.next(); } + public void remove() { + throw new UnsupportedOperationException("remove not supported"); + } + public void reset() { mIterator = mEntityList.iterator(); }