Merge "Don't purge *all* sync information when a user is deleted." into qt-dev
am: e74523c9fb
Change-Id: I5aa7e1362d03f845fad90310ef026d5ff24325b4
This commit is contained in:
@@ -1170,7 +1170,7 @@ public class SyncManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void removeSyncsForAuthority(EndPoint info, String why) {
|
private void removeSyncsForAuthority(EndPoint info, String why) {
|
||||||
mLogger.log("removeSyncsForAuthority: ", info);
|
mLogger.log("removeSyncsForAuthority: ", info, why);
|
||||||
verifyJobScheduler();
|
verifyJobScheduler();
|
||||||
List<SyncOperation> ops = getAllPendingSyncs();
|
List<SyncOperation> ops = getAllPendingSyncs();
|
||||||
for (SyncOperation op: ops) {
|
for (SyncOperation op: ops) {
|
||||||
|
|||||||
@@ -1027,7 +1027,7 @@ public class SyncStorageEngine {
|
|||||||
* Called when the set of account has changed, given the new array of
|
* Called when the set of account has changed, given the new array of
|
||||||
* active accounts.
|
* active accounts.
|
||||||
*/
|
*/
|
||||||
public void removeStaleAccounts(@Nullable Account[] accounts, int userId) {
|
public void removeStaleAccounts(@Nullable Account[] currentAccounts, int userId) {
|
||||||
synchronized (mAuthorities) {
|
synchronized (mAuthorities) {
|
||||||
if (Log.isLoggable(TAG, Log.VERBOSE)) {
|
if (Log.isLoggable(TAG, Log.VERBOSE)) {
|
||||||
Slog.v(TAG, "Updating for new accounts...");
|
Slog.v(TAG, "Updating for new accounts...");
|
||||||
@@ -1036,9 +1036,11 @@ public class SyncStorageEngine {
|
|||||||
Iterator<AccountInfo> accIt = mAccounts.values().iterator();
|
Iterator<AccountInfo> accIt = mAccounts.values().iterator();
|
||||||
while (accIt.hasNext()) {
|
while (accIt.hasNext()) {
|
||||||
AccountInfo acc = accIt.next();
|
AccountInfo acc = accIt.next();
|
||||||
if ((accounts == null) || (
|
if (acc.accountAndUser.userId != userId) {
|
||||||
(acc.accountAndUser.userId == userId)
|
continue; // Irrelevant user.
|
||||||
&& !ArrayUtils.contains(accounts, acc.accountAndUser.account))) {
|
}
|
||||||
|
if ((currentAccounts == null)
|
||||||
|
|| !ArrayUtils.contains(currentAccounts, acc.accountAndUser.account)) {
|
||||||
// This account no longer exists...
|
// This account no longer exists...
|
||||||
if (Log.isLoggable(TAG, Log.VERBOSE)) {
|
if (Log.isLoggable(TAG, Log.VERBOSE)) {
|
||||||
Slog.v(TAG, "Account removed: " + acc.accountAndUser);
|
Slog.v(TAG, "Account removed: " + acc.accountAndUser);
|
||||||
|
|||||||
Reference in New Issue
Block a user