diff options
author | Tony Mantler <nicoya@google.com> | 2014-05-14 16:31:04 -0700 |
---|---|---|
committer | Tony Mantler <nicoya@google.com> | 2014-05-14 16:31:04 -0700 |
commit | 34c2e1619d47d8140efd212c7bb037b935eb5d18 (patch) | |
tree | 4778c0f3a259a630abbfa0f235fb27385f3f6976 /emailcommon | |
parent | 82a207132b34377d532f19882f5bfc70bc657da0 (diff) | |
download | android_packages_apps_Email-34c2e1619d47d8140efd212c7bb037b935eb5d18.tar.gz android_packages_apps_Email-34c2e1619d47d8140efd212c7bb037b935eb5d18.tar.bz2 android_packages_apps_Email-34c2e1619d47d8140efd212c7bb037b935eb5d18.zip |
Fix FLAG_OAUTH usage
Also fix some excessive checking of incoming/outgoing settings fragments
b/14969455 b/14971192
Change-Id: I6cf83aa59d381d3bbfc33e0d4a6e133c1814ba69
Diffstat (limited to 'emailcommon')
-rw-r--r-- | emailcommon/src/com/android/emailcommon/provider/HostAuth.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/emailcommon/src/com/android/emailcommon/provider/HostAuth.java b/emailcommon/src/com/android/emailcommon/provider/HostAuth.java index b904c66da..6899a7d59 100644 --- a/emailcommon/src/com/android/emailcommon/provider/HostAuth.java +++ b/emailcommon/src/com/android/emailcommon/provider/HostAuth.java @@ -57,7 +57,7 @@ public class HostAuth extends EmailContent implements Parcelable { public static final int FLAG_OAUTH = 0x10; // Use OAuth for authentication // Mask of settings directly configurable by the user public static final int USER_CONFIG_MASK = 0x1b; - public static final int FLAG_TRANSPORTSECURITY_MASK = FLAG_SSL | FLAG_TLS; + public static final int FLAG_TRANSPORTSECURITY_MASK = FLAG_SSL | FLAG_TLS | FLAG_TRUST_ALL; public String mProtocol; public String mAddress; @@ -127,10 +127,13 @@ public class HostAuth extends EmailContent implements Parcelable { * creating it if it does not yet exist. This should not be called on the * main thread. * + * As a side-effect, it also ensures FLAG_OAUTH is set. Use {@link #removeCredential()} to clear + * * @param context for provider loads * @return the credential object for this HostAuth */ public Credential getOrCreateCredential(Context context) { + mFlags |= FLAG_OAUTH; if (mCredential == null) { if (mCredentialKey >= 0) { mCredential = Credential.restoreCredentialsWithId(context, mCredentialKey); @@ -147,6 +150,7 @@ public class HostAuth extends EmailContent implements Parcelable { public void removeCredential() { mCredential = null; mCredentialKey = -1; + mFlags &= ~FLAG_OAUTH; } /** @@ -225,6 +229,9 @@ public class HostAuth extends EmailContent implements Parcelable { mDomain = cursor.getString(CONTENT_DOMAIN_COLUMN); mClientCertAlias = cursor.getString(CONTENT_CLIENT_CERT_ALIAS_COLUMN); mCredentialKey = cursor.getLong(CONTENT_CREDENTIAL_KEY_COLUMN); + if (mCredentialKey != -1) { + mFlags |= FLAG_OAUTH; + } } @Override |