Loading api/current.xml +40 −1 Original line number Diff line number Diff line Loading @@ -44007,6 +44007,17 @@ synchronized="false" static="true" final="false" deprecated="deprecated" visibility="public" > </method> <method name="getCurrentSyncs" return="java.util.List<android.content.SyncInfo>" abstract="false" native="false" synchronized="false" static="true" final="false" deprecated="not deprecated" visibility="public" > Loading Loading @@ -54150,6 +54161,34 @@ deprecated="not deprecated" visibility="public" > <implements name="android.os.Parcelable"> </implements> <method name="describeContents" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="writeToParcel" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="parcel" type="android.os.Parcel"> </parameter> <parameter name="flags" type="int"> </parameter> </method> <field name="account" type="android.accounts.Account" transient="false" Loading Loading @@ -242757,7 +242796,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="t" type="T"> <parameter name="arg0" type="T"> </parameter> </method> </interface> core/java/android/content/ContentResolver.java +26 −2 Original line number Diff line number Diff line Loading @@ -1319,12 +1319,36 @@ public abstract class ContentResolver { } /** * If a sync is active returns the information about it, otherwise returns false. * If a sync is active returns the information about it, otherwise returns null. * <p> * @return the SyncInfo for the currently active sync or null if one is not active. * @deprecated * Since multiple concurrent syncs are now supported you should use * {@link #getCurrentSyncs()} to get the accurate list of current syncs. * This method returns the first item from the list of current syncs * or null if there are none. */ @Deprecated public static SyncInfo getCurrentSync() { try { return getContentService().getCurrentSync(); final List<SyncInfo> syncs = getContentService().getCurrentSyncs(); if (syncs.isEmpty()) { return null; } return syncs.get(0); } catch (RemoteException e) { throw new RuntimeException("the ContentService should always be reachable", e); } } /** * Returns a list with information about all the active syncs. This list will be empty * if there are no active syncs. * @return a List of SyncInfo objects for the currently active syncs. */ public static List<SyncInfo> getCurrentSyncs() { try { return getContentService().getCurrentSyncs(); } catch (RemoteException e) { throw new RuntimeException("the ContentService should always be reachable", e); } Loading core/java/android/content/ContentService.java +2 −6 Original line number Diff line number Diff line Loading @@ -386,19 +386,15 @@ public final class ContentService extends IContentService.Stub { return false; } public SyncInfo getCurrentSync() { public List<SyncInfo> getCurrentSyncs() { mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS, "no permission to read the sync stats"); long identityToken = clearCallingIdentity(); try { SyncManager syncManager = getSyncManager(); if (syncManager != null) { return syncManager.getSyncStorageEngine().getCurrentSync(); } return getSyncManager().getSyncStorageEngine().getCurrentSyncs(); } finally { restoreCallingIdentity(identityToken); } return null; } public SyncStatusInfo getSyncStatus(Account account, String authority) { Loading core/java/android/content/IContentService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ interface IContentService { */ boolean isSyncActive(in Account account, String authority); SyncInfo getCurrentSync(); List<SyncInfo> getCurrentSyncs(); /** * Returns the types of the SyncAdapters that are registered with the system. Loading core/java/android/content/SyncInfo.java +2 −1 Original line number Diff line number Diff line Loading @@ -18,12 +18,13 @@ package android.content; import android.accounts.Account; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; /** * Information about the sync operation that is currently underway. */ public class SyncInfo { public class SyncInfo implements Parcelable { /** @hide */ public final int authorityId; Loading Loading
api/current.xml +40 −1 Original line number Diff line number Diff line Loading @@ -44007,6 +44007,17 @@ synchronized="false" static="true" final="false" deprecated="deprecated" visibility="public" > </method> <method name="getCurrentSyncs" return="java.util.List<android.content.SyncInfo>" abstract="false" native="false" synchronized="false" static="true" final="false" deprecated="not deprecated" visibility="public" > Loading Loading @@ -54150,6 +54161,34 @@ deprecated="not deprecated" visibility="public" > <implements name="android.os.Parcelable"> </implements> <method name="describeContents" return="int" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="writeToParcel" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="parcel" type="android.os.Parcel"> </parameter> <parameter name="flags" type="int"> </parameter> </method> <field name="account" type="android.accounts.Account" transient="false" Loading Loading @@ -242757,7 +242796,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="t" type="T"> <parameter name="arg0" type="T"> </parameter> </method> </interface>
core/java/android/content/ContentResolver.java +26 −2 Original line number Diff line number Diff line Loading @@ -1319,12 +1319,36 @@ public abstract class ContentResolver { } /** * If a sync is active returns the information about it, otherwise returns false. * If a sync is active returns the information about it, otherwise returns null. * <p> * @return the SyncInfo for the currently active sync or null if one is not active. * @deprecated * Since multiple concurrent syncs are now supported you should use * {@link #getCurrentSyncs()} to get the accurate list of current syncs. * This method returns the first item from the list of current syncs * or null if there are none. */ @Deprecated public static SyncInfo getCurrentSync() { try { return getContentService().getCurrentSync(); final List<SyncInfo> syncs = getContentService().getCurrentSyncs(); if (syncs.isEmpty()) { return null; } return syncs.get(0); } catch (RemoteException e) { throw new RuntimeException("the ContentService should always be reachable", e); } } /** * Returns a list with information about all the active syncs. This list will be empty * if there are no active syncs. * @return a List of SyncInfo objects for the currently active syncs. */ public static List<SyncInfo> getCurrentSyncs() { try { return getContentService().getCurrentSyncs(); } catch (RemoteException e) { throw new RuntimeException("the ContentService should always be reachable", e); } Loading
core/java/android/content/ContentService.java +2 −6 Original line number Diff line number Diff line Loading @@ -386,19 +386,15 @@ public final class ContentService extends IContentService.Stub { return false; } public SyncInfo getCurrentSync() { public List<SyncInfo> getCurrentSyncs() { mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS, "no permission to read the sync stats"); long identityToken = clearCallingIdentity(); try { SyncManager syncManager = getSyncManager(); if (syncManager != null) { return syncManager.getSyncStorageEngine().getCurrentSync(); } return getSyncManager().getSyncStorageEngine().getCurrentSyncs(); } finally { restoreCallingIdentity(identityToken); } return null; } public SyncStatusInfo getSyncStatus(Account account, String authority) { Loading
core/java/android/content/IContentService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ interface IContentService { */ boolean isSyncActive(in Account account, String authority); SyncInfo getCurrentSync(); List<SyncInfo> getCurrentSyncs(); /** * Returns the types of the SyncAdapters that are registered with the system. Loading
core/java/android/content/SyncInfo.java +2 −1 Original line number Diff line number Diff line Loading @@ -18,12 +18,13 @@ package android.content; import android.accounts.Account; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; /** * Information about the sync operation that is currently underway. */ public class SyncInfo { public class SyncInfo implements Parcelable { /** @hide */ public final int authorityId; Loading