Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6421ae7e authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android Git Automerger
Browse files

am 5251c800: Merge "Fix potential crash in sync." into gingerbread

Merge commit '5251c800' into gingerbread-plus-aosp

* commit '5251c800':
  Fix potential crash in sync.
parents 527c0283 5251c800
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1696,16 +1696,17 @@ public class SyncManager implements OnAccountsUpdateListener {
                Log.v(TAG, "runStateIdle: setting mActiveSyncContext to " + mActiveSyncContext);
            }
            mSyncStorageEngine.setActiveSync(mActiveSyncContext);
            mSyncWakeLock.setWorkSource(new WorkSource(syncAdapterInfo.uid));
            if (!activeSyncContext.bindToSyncAdapter(syncAdapterInfo)) {
                Log.e(TAG, "Bind attempt failed to " + syncAdapterInfo);
                mActiveSyncContext.close();
                mActiveSyncContext = null;
                mSyncStorageEngine.setActiveSync(mActiveSyncContext);
                mSyncWakeLock.setWorkSource(null);
                runStateIdle();
                return;
            }

            mSyncWakeLock.setWorkSource(new WorkSource(syncAdapterInfo.uid));
            mSyncWakeLock.acquire();
            // no need to schedule an alarm, as that will be done by our caller.