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

Commit a5d32d03 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in SyncManager when updating accounts." into qt-dev

parents 81f5007d 190c7017
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -3256,16 +3256,19 @@ public class SyncManager {
                }
            }

            if (syncTargets != null) {
                // On account add, check if there are any settings to be restored.
                for (AccountAndUser aau : mRunningAccounts) {
                    if (!containsAccountAndUser(oldAccounts, aau.account, aau.userId)) {
                        if (Log.isLoggable(TAG, Log.DEBUG)) {
                        Log.d(TAG, "Account " + aau.account + " added, checking sync restore data");
                            Log.d(TAG, "Account " + aau.account
                                    + " added, checking sync restore data");
                        }
                        AccountSyncSettingsBackupHelper.accountAdded(mContext, syncTargets.userId);
                        break;
                    }
                }
            }

            // Cancel all jobs from non-existent accounts.
            AccountAndUser[] allAccounts = AccountManagerService.getSingleton().getAllAccounts();