use of android.content.SyncInfo in project android_frameworks_base by ResurrectionRemix.
the class SyncStorageEngine method getCurrentSyncsCopy.
/**
* @param userId Id of user to return current sync info.
* @param canAccessAccounts Determines whether to redact Account information from the result.
* @return a copy of the current syncs data structure. Will not return null.
*/
public List<SyncInfo> getCurrentSyncsCopy(int userId, boolean canAccessAccounts) {
synchronized (mAuthorities) {
final List<SyncInfo> syncs = getCurrentSyncsLocked(userId);
final List<SyncInfo> syncsCopy = new ArrayList<SyncInfo>();
for (SyncInfo sync : syncs) {
SyncInfo copy;
if (!canAccessAccounts) {
copy = SyncInfo.createAccountRedacted(sync.authorityId, sync.authority, sync.startTime);
} else {
copy = new SyncInfo(sync);
}
syncsCopy.add(copy);
}
return syncsCopy;
}
}
use of android.content.SyncInfo in project android_frameworks_base by DirtyUnicorns.
the class SyncStorageEngine method getCurrentSyncsCopy.
/**
* @param userId Id of user to return current sync info.
* @param canAccessAccounts Determines whether to redact Account information from the result.
* @return a copy of the current syncs data structure. Will not return null.
*/
public List<SyncInfo> getCurrentSyncsCopy(int userId, boolean canAccessAccounts) {
synchronized (mAuthorities) {
final List<SyncInfo> syncs = getCurrentSyncsLocked(userId);
final List<SyncInfo> syncsCopy = new ArrayList<SyncInfo>();
for (SyncInfo sync : syncs) {
SyncInfo copy;
if (!canAccessAccounts) {
copy = SyncInfo.createAccountRedacted(sync.authorityId, sync.authority, sync.startTime);
} else {
copy = new SyncInfo(sync);
}
syncsCopy.add(copy);
}
return syncsCopy;
}
}
use of android.content.SyncInfo in project android_frameworks_base by DirtyUnicorns.
the class SyncStorageEngine method addActiveSync.
/**
* Called when a sync is starting. Supply a valid ActiveSyncContext with information
* about the sync.
*/
public SyncInfo addActiveSync(SyncManager.ActiveSyncContext activeSyncContext) {
final SyncInfo syncInfo;
synchronized (mAuthorities) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Slog.v(TAG, "setActiveSync: account=" + " auth=" + activeSyncContext.mSyncOperation.target + " src=" + activeSyncContext.mSyncOperation.syncSource + " extras=" + activeSyncContext.mSyncOperation.extras);
}
final EndPoint info = activeSyncContext.mSyncOperation.target;
AuthorityInfo authorityInfo = getOrCreateAuthorityLocked(info, -1, /* assign a new identifier if creating a new target */
true);
syncInfo = new SyncInfo(authorityInfo.ident, authorityInfo.target.account, authorityInfo.target.provider, activeSyncContext.mStartTime);
getCurrentSyncs(authorityInfo.target.userId).add(syncInfo);
}
reportActiveChange();
return syncInfo;
}
use of android.content.SyncInfo in project android_frameworks_base by AOSPA.
the class SyncStorageEngine method getCurrentSyncsCopy.
/**
* @param userId Id of user to return current sync info.
* @param canAccessAccounts Determines whether to redact Account information from the result.
* @return a copy of the current syncs data structure. Will not return null.
*/
public List<SyncInfo> getCurrentSyncsCopy(int userId, boolean canAccessAccounts) {
synchronized (mAuthorities) {
final List<SyncInfo> syncs = getCurrentSyncsLocked(userId);
final List<SyncInfo> syncsCopy = new ArrayList<SyncInfo>();
for (SyncInfo sync : syncs) {
SyncInfo copy;
if (!canAccessAccounts) {
copy = SyncInfo.createAccountRedacted(sync.authorityId, sync.authority, sync.startTime);
} else {
copy = new SyncInfo(sync);
}
syncsCopy.add(copy);
}
return syncsCopy;
}
}
use of android.content.SyncInfo in project platform_frameworks_base by android.
the class SyncStorageEngine method addActiveSync.
/**
* Called when a sync is starting. Supply a valid ActiveSyncContext with information
* about the sync.
*/
public SyncInfo addActiveSync(SyncManager.ActiveSyncContext activeSyncContext) {
final SyncInfo syncInfo;
synchronized (mAuthorities) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Slog.v(TAG, "setActiveSync: account=" + " auth=" + activeSyncContext.mSyncOperation.target + " src=" + activeSyncContext.mSyncOperation.syncSource + " extras=" + activeSyncContext.mSyncOperation.extras);
}
final EndPoint info = activeSyncContext.mSyncOperation.target;
AuthorityInfo authorityInfo = getOrCreateAuthorityLocked(info, -1, /* assign a new identifier if creating a new target */
true);
syncInfo = new SyncInfo(authorityInfo.ident, authorityInfo.target.account, authorityInfo.target.provider, activeSyncContext.mStartTime);
getCurrentSyncs(authorityInfo.target.userId).add(syncInfo);
}
reportActiveChange();
return syncInfo;
}
Aggregations