Search in sources :

Example 1 with EndPoint

use of com.android.server.content.SyncStorageEngine.EndPoint in project platform_frameworks_base by android.

the class SyncManager method rescheduleSyncs.

/**
     * Reschedule all scheduled syncs for this EndPoint. The syncs will be scheduled according
     * to current backoff and delayUntil values of this EndPoint.
     */
private void rescheduleSyncs(EndPoint target) {
    List<SyncOperation> ops = getAllPendingSyncs();
    int count = 0;
    for (SyncOperation op : ops) {
        if (!op.isPeriodic && op.target.matchesSpec(target)) {
            count++;
            getJobScheduler().cancel(op.jobId);
            postScheduleSyncMessage(op, 0);
        }
    }
    if (Log.isLoggable(TAG, Log.VERBOSE)) {
        Slog.v(TAG, "Rescheduled " + count + " syncs for " + target);
    }
}
Also used : EndPoint(com.android.server.content.SyncStorageEngine.EndPoint)

Example 2 with EndPoint

use of com.android.server.content.SyncStorageEngine.EndPoint in project android_frameworks_base by crdroidandroid.

the class SyncManager method onUserUnlocked.

private void onUserUnlocked(int userId) {
    // Make sure that accounts we're about to use are valid.
    AccountManagerService.getSingleton().validateAccounts(userId);
    mSyncAdapters.invalidateCache(userId);
    EndPoint target = new EndPoint(null, null, userId);
    updateRunningAccounts(target);
    // Schedule sync for any accounts under started user.
    final Account[] accounts = AccountManagerService.getSingleton().getAccounts(userId, mContext.getOpPackageName());
    for (Account account : accounts) {
        scheduleSync(account, userId, SyncOperation.REASON_USER_START, null, null, AuthorityInfo.NOT_INITIALIZED);
    }
}
Also used : Account(android.accounts.Account) EndPoint(com.android.server.content.SyncStorageEngine.EndPoint)

Example 3 with EndPoint

use of com.android.server.content.SyncStorageEngine.EndPoint in project android_frameworks_base by AOSPA.

the class SyncManager method onUserUnlocked.

private void onUserUnlocked(int userId) {
    // Make sure that accounts we're about to use are valid.
    AccountManagerService.getSingleton().validateAccounts(userId);
    mSyncAdapters.invalidateCache(userId);
    EndPoint target = new EndPoint(null, null, userId);
    updateRunningAccounts(target);
    // Schedule sync for any accounts under started user.
    final Account[] accounts = AccountManagerService.getSingleton().getAccounts(userId, mContext.getOpPackageName());
    for (Account account : accounts) {
        scheduleSync(account, userId, SyncOperation.REASON_USER_START, null, null, AuthorityInfo.NOT_INITIALIZED);
    }
}
Also used : Account(android.accounts.Account) EndPoint(com.android.server.content.SyncStorageEngine.EndPoint)

Example 4 with EndPoint

use of com.android.server.content.SyncStorageEngine.EndPoint in project platform_frameworks_base by android.

the class SyncManager method onUserUnlocked.

private void onUserUnlocked(int userId) {
    // Make sure that accounts we're about to use are valid.
    AccountManagerService.getSingleton().validateAccounts(userId);
    mSyncAdapters.invalidateCache(userId);
    EndPoint target = new EndPoint(null, null, userId);
    updateRunningAccounts(target);
    // Schedule sync for any accounts under started user.
    final Account[] accounts = AccountManagerService.getSingleton().getAccounts(userId, mContext.getOpPackageName());
    for (Account account : accounts) {
        scheduleSync(account, userId, SyncOperation.REASON_USER_START, null, null, AuthorityInfo.NOT_INITIALIZED);
    }
}
Also used : Account(android.accounts.Account) EndPoint(com.android.server.content.SyncStorageEngine.EndPoint)

Example 5 with EndPoint

use of com.android.server.content.SyncStorageEngine.EndPoint in project android_frameworks_base by DirtyUnicorns.

the class SyncManager method onUserUnlocked.

private void onUserUnlocked(int userId) {
    // Make sure that accounts we're about to use are valid.
    AccountManagerService.getSingleton().validateAccounts(userId);
    mSyncAdapters.invalidateCache(userId);
    EndPoint target = new EndPoint(null, null, userId);
    updateRunningAccounts(target);
    // Schedule sync for any accounts under started user.
    final Account[] accounts = AccountManagerService.getSingleton().getAccounts(userId, mContext.getOpPackageName());
    for (Account account : accounts) {
        scheduleSync(account, userId, SyncOperation.REASON_USER_START, null, null, AuthorityInfo.NOT_INITIALIZED);
    }
}
Also used : Account(android.accounts.Account) EndPoint(com.android.server.content.SyncStorageEngine.EndPoint)

Aggregations

EndPoint (com.android.server.content.SyncStorageEngine.EndPoint)10 Account (android.accounts.Account)5