Merge "Use appropriate prefix to infer server address" into jb-ub-mail
This commit is contained in:
commit
49e6099840
|
@ -62,5 +62,6 @@
|
|||
<enum name="mins30" value="30"/>
|
||||
<enum name="mins60" value="60"/>
|
||||
</attr>
|
||||
<attr name="inferPrefix" format="string"/>
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
email:offerTls="true"
|
||||
email:usesSmtp="true"
|
||||
email:offerLocalDeletes="true"
|
||||
email:inferPrefix="pop"
|
||||
/>
|
||||
<emailservice
|
||||
email:protocol="imap"
|
||||
|
@ -79,6 +80,7 @@
|
|||
email:offerAttachmentPreload="true"
|
||||
email:offerPrefix="true"
|
||||
email:syncChanges="true"
|
||||
email:inferPrefix="imap"
|
||||
/>
|
||||
<emailservice
|
||||
email:protocol="eas"
|
||||
|
@ -118,5 +120,6 @@
|
|||
email:offerAttachmentPreload="true"
|
||||
email:offerPrefix="true"
|
||||
email:syncChanges="true"
|
||||
email:inferPrefix="imap"
|
||||
/>
|
||||
</emailservices>
|
||||
|
|
|
@ -86,7 +86,13 @@ public class AccountSetupIncoming extends AccountSetupActivity
|
|||
startAutoDiscover();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we've got a default prefix for this protocol, use it
|
||||
String prefix = mServiceInfo.inferPrefix;
|
||||
if (prefix != null && !hostAuth.mAddress.startsWith(prefix + ".")) {
|
||||
hostAuth.mAddress = prefix + "." + hostAuth.mAddress;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements View.OnClickListener
|
||||
|
|
|
@ -153,6 +153,7 @@ public class EmailServiceUtils {
|
|||
public CharSequence[] syncIntervalStrings;
|
||||
public CharSequence[] syncIntervals;
|
||||
public int defaultSyncInterval;
|
||||
public String inferPrefix;
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("Protocol: ");
|
||||
|
@ -255,6 +256,7 @@ public class EmailServiceUtils {
|
|||
ta.getTextArray(R.styleable.EmailServiceInfo_syncIntervals);
|
||||
info.defaultSyncInterval =
|
||||
ta.getInteger(R.styleable.EmailServiceInfo_defaultSyncInterval, 15);
|
||||
info.inferPrefix = ta.getString(R.styleable.EmailServiceInfo_inferPrefix);
|
||||
|
||||
// Must have either "class" (local) or "intent" (remote)
|
||||
if (klass != null) {
|
||||
|
|
Loading…
Reference in New Issue