|
|
@ -232,7 +232,7 @@ public class CloudSync {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<EntityAccount> accounts = db.account().getSynchronizingAccounts(null);
|
|
|
|
List<EntityAccount> accounts = db.account().getAccounts();
|
|
|
|
EntityLog.log(context, EntityLog.Type.Cloud,
|
|
|
|
EntityLog.log(context, EntityLog.Type.Cloud,
|
|
|
|
"Cloud accounts=" + (accounts == null ? null : accounts.size()));
|
|
|
|
"Cloud accounts=" + (accounts == null ? null : accounts.size()));
|
|
|
|
if (accounts == null || accounts.size() == 0)
|
|
|
|
if (accounts == null || accounts.size() == 0)
|
|
|
@ -242,14 +242,14 @@ public class CloudSync {
|
|
|
|
|
|
|
|
|
|
|
|
JSONArray jaccountuuidlist = new JSONArray();
|
|
|
|
JSONArray jaccountuuidlist = new JSONArray();
|
|
|
|
for (EntityAccount account : accounts)
|
|
|
|
for (EntityAccount account : accounts)
|
|
|
|
if (!TextUtils.isEmpty(account.uuid)) {
|
|
|
|
if (account.synchronize && !TextUtils.isEmpty(account.uuid)) {
|
|
|
|
jaccountuuidlist.put(account.uuid);
|
|
|
|
jaccountuuidlist.put(account.uuid);
|
|
|
|
|
|
|
|
|
|
|
|
JSONArray jidentitieuuids = new JSONArray();
|
|
|
|
JSONArray jidentitieuuids = new JSONArray();
|
|
|
|
List<EntityIdentity> identities = db.identity().getIdentities(account.id);
|
|
|
|
List<EntityIdentity> identities = db.identity().getIdentities(account.id);
|
|
|
|
if (identities != null)
|
|
|
|
if (identities != null)
|
|
|
|
for (EntityIdentity identity : identities)
|
|
|
|
for (EntityIdentity identity : identities)
|
|
|
|
if (!TextUtils.isEmpty(identity.uuid)) {
|
|
|
|
if (identity.synchronize && !TextUtils.isEmpty(identity.uuid)) {
|
|
|
|
jidentitieuuids.put(identity.uuid);
|
|
|
|
jidentitieuuids.put(identity.uuid);
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject jidentity = identity.toJSON();
|
|
|
|
JSONObject jidentity = identity.toJSON();
|
|
|
@ -377,7 +377,7 @@ public class CloudSync {
|
|
|
|
"Cloud account " + raccount.uuid + "=" +
|
|
|
|
"Cloud account " + raccount.uuid + "=" +
|
|
|
|
(laccount == null ? "insert" :
|
|
|
|
(laccount == null ? "insert" :
|
|
|
|
(EntityAccount.areEqual(raccount, laccount,
|
|
|
|
(EntityAccount.areEqual(raccount, laccount,
|
|
|
|
laccount.auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD, true)
|
|
|
|
laccount.auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD, false)
|
|
|
|
? "equal" : "update")) +
|
|
|
|
? "equal" : "update")) +
|
|
|
|
" rev=" + revision +
|
|
|
|
" rev=" + revision +
|
|
|
|
" left=" + (left == null ? null : left.name + ":" + left.type) +
|
|
|
|
" left=" + (left == null ? null : left.name + ":" + left.type) +
|
|
|
@ -483,13 +483,12 @@ public class CloudSync {
|
|
|
|
"Cloud identity " + ridentity.uuid + "=" +
|
|
|
|
"Cloud identity " + ridentity.uuid + "=" +
|
|
|
|
(lidentity == null ? "insert" :
|
|
|
|
(lidentity == null ? "insert" :
|
|
|
|
(EntityIdentity.areEqual(ridentity, lidentity,
|
|
|
|
(EntityIdentity.areEqual(ridentity, lidentity,
|
|
|
|
lidentity.auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD, true)
|
|
|
|
lidentity.auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD, false)
|
|
|
|
? "equal" : "update")) +
|
|
|
|
? "equal" : "update")) +
|
|
|
|
" rev=" + revision +
|
|
|
|
" rev=" + revision +
|
|
|
|
" size=" + value.length());
|
|
|
|
" size=" + value.length());
|
|
|
|
|
|
|
|
|
|
|
|
ridentity.id = null;
|
|
|
|
ridentity.id = null;
|
|
|
|
ridentity.primary = false;
|
|
|
|
|
|
|
|
ridentity.last_modified = rrevision;
|
|
|
|
ridentity.last_modified = rrevision;
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -503,6 +502,7 @@ public class CloudSync {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ridentity.id = lidentity.id;
|
|
|
|
ridentity.id = lidentity.id;
|
|
|
|
|
|
|
|
ridentity.account = lidentity.account;
|
|
|
|
db.identity().updateIdentity(ridentity);
|
|
|
|
db.identity().updateIdentity(ridentity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|