Don't save Policy with Account
Change-Id: Ib3601daee8780640a07db573f623e99279c9f9b1
This commit is contained in:
parent
5789a78af3
commit
fd81e19779
@ -762,7 +762,6 @@ public final class Account extends EmailContent implements AccountColumns, Parce
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
int recvIndex = -1;
|
int recvIndex = -1;
|
||||||
int sendIndex = -1;
|
int sendIndex = -1;
|
||||||
int policyIndex = -1;
|
|
||||||
|
|
||||||
// Create operations for saving the send and recv hostAuths
|
// Create operations for saving the send and recv hostAuths
|
||||||
// Also, remember which operation in the array they represent
|
// Also, remember which operation in the array they represent
|
||||||
@ -779,12 +778,6 @@ public final class Account extends EmailContent implements AccountColumns, Parce
|
|||||||
.withValues(mHostAuthSend.toContentValues())
|
.withValues(mHostAuthSend.toContentValues())
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
if (mPolicy != null) {
|
|
||||||
policyIndex = index++;
|
|
||||||
ops.add(ContentProviderOperation.newInsert(mPolicy.mBaseUri)
|
|
||||||
.withValues(mPolicy.toContentValues())
|
|
||||||
.build());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create operations for making this the only default account
|
// Create operations for making this the only default account
|
||||||
// Note, these are always updates because they change existing accounts
|
// Note, these are always updates because they change existing accounts
|
||||||
@ -797,7 +790,7 @@ public final class Account extends EmailContent implements AccountColumns, Parce
|
|||||||
|
|
||||||
// Now do the Account
|
// Now do the Account
|
||||||
ContentValues cv = null;
|
ContentValues cv = null;
|
||||||
if (recvIndex >= 0 || sendIndex >= 0 || policyIndex >= 0) {
|
if (recvIndex >= 0 || sendIndex >= 0) {
|
||||||
cv = new ContentValues();
|
cv = new ContentValues();
|
||||||
if (recvIndex >= 0) {
|
if (recvIndex >= 0) {
|
||||||
cv.put(Account.HOST_AUTH_KEY_RECV, recvIndex);
|
cv.put(Account.HOST_AUTH_KEY_RECV, recvIndex);
|
||||||
@ -805,9 +798,6 @@ public final class Account extends EmailContent implements AccountColumns, Parce
|
|||||||
if (sendIndex >= 0) {
|
if (sendIndex >= 0) {
|
||||||
cv.put(Account.HOST_AUTH_KEY_SEND, sendIndex);
|
cv.put(Account.HOST_AUTH_KEY_SEND, sendIndex);
|
||||||
}
|
}
|
||||||
if (policyIndex >= 0) {
|
|
||||||
cv.put(Account.POLICY_KEY, policyIndex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentProviderOperation.Builder b = ContentProviderOperation.newInsert(mBaseUri);
|
ContentProviderOperation.Builder b = ContentProviderOperation.newInsert(mBaseUri);
|
||||||
@ -831,11 +821,6 @@ public final class Account extends EmailContent implements AccountColumns, Parce
|
|||||||
mHostAuthKeySend = newId;
|
mHostAuthKeySend = newId;
|
||||||
mHostAuthSend.mId = newId;
|
mHostAuthSend.mId = newId;
|
||||||
}
|
}
|
||||||
if (policyIndex >= 0) {
|
|
||||||
long newId = getId(results[policyIndex].uri);
|
|
||||||
mPolicyKey = newId;
|
|
||||||
mPolicy.mId = newId;
|
|
||||||
}
|
|
||||||
Uri u = results[index].uri;
|
Uri u = results[index].uri;
|
||||||
mId = getId(u);
|
mId = getId(u);
|
||||||
return u;
|
return u;
|
||||||
|
@ -564,7 +564,7 @@ public class SecurityPolicy {
|
|||||||
if (account.mPolicyKey > 0) {
|
if (account.mPolicyKey > 0) {
|
||||||
oldPolicy = Policy.restorePolicyWithId(mContext, account.mPolicyKey);
|
oldPolicy = Policy.restorePolicyWithId(mContext, account.mPolicyKey);
|
||||||
}
|
}
|
||||||
boolean policyChanged = !oldPolicy.equals(policy);
|
boolean policyChanged = (oldPolicy == null) || !oldPolicy.equals(policy);
|
||||||
if (!policyChanged && (TextUtilities.stringOrNullEquals(securityKey,
|
if (!policyChanged && (TextUtilities.stringOrNullEquals(securityKey,
|
||||||
account.mSecuritySyncKey))) {
|
account.mSecuritySyncKey))) {
|
||||||
Log.d(Logging.LOG_TAG, "setAccountPolicy; policy unchanged");
|
Log.d(Logging.LOG_TAG, "setAccountPolicy; policy unchanged");
|
||||||
|
Loading…
Reference in New Issue
Block a user