ConcurrentModificationException in SyncManager

updateRunningAccounts and dispatchSyncOperation is running in different thread,
and mActiveSyncContexts not synchronization.
If methods occur together,
mActiveSyncContexts change may occur when cycle is running.

Sample:
https://code.google.com/p/android/issues/detail?id=195341

Solution:
Offboard the traversal from the main thread to the handler thread.

Change-Id: Ifb9fbb466a5087186be31f7877c50b8c8b6737e4
Signed-off-by: wangzhengan <wangzglx@gmail.com>
1 file changed