|
|
|
@ -177,7 +177,7 @@ public class EmailProvider implements Parcelable {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static List<EmailProvider> loadProfiles(Context context) {
|
|
|
|
|
private static List<EmailProvider> loadProfiles(Context context) {
|
|
|
|
|
List<EmailProvider> result = null;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
@ -297,7 +297,7 @@ public class EmailProvider implements Parcelable {
|
|
|
|
|
} else
|
|
|
|
|
throw new IllegalAccessException(name);
|
|
|
|
|
} else if (eventType == XmlPullParser.END_TAG) {
|
|
|
|
|
if ("provider".equals(xml.getName()) && provider.enabled) {
|
|
|
|
|
if ("provider".equals(xml.getName())) {
|
|
|
|
|
result.add(provider);
|
|
|
|
|
provider = null;
|
|
|
|
|
}
|
|
|
|
@ -312,12 +312,12 @@ public class EmailProvider implements Parcelable {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static boolean getAttributeBooleanValue(XmlPullParser parser, String name, boolean defaultValue) {
|
|
|
|
|
private static boolean getAttributeBooleanValue(XmlPullParser parser, String name, boolean defaultValue) {
|
|
|
|
|
String value = parser.getAttributeValue(null, name);
|
|
|
|
|
return (value == null ? defaultValue : Boolean.parseBoolean(value));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int getAttributeIntValue(XmlPullParser parser, String name, int defaultValue) {
|
|
|
|
|
private static int getAttributeIntValue(XmlPullParser parser, String name, int defaultValue) {
|
|
|
|
|
String value = parser.getAttributeValue(null, name);
|
|
|
|
|
return (value == null ? defaultValue : Integer.parseInt(value));
|
|
|
|
|
}
|
|
|
|
@ -331,6 +331,14 @@ public class EmailProvider implements Parcelable {
|
|
|
|
|
throw new FileNotFoundException("provider id=" + id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static List<EmailProvider> getProviders(Context context) {
|
|
|
|
|
List<EmailProvider> result = new ArrayList<>();
|
|
|
|
|
for (EmailProvider provider : loadProfiles(context))
|
|
|
|
|
if (provider.enabled)
|
|
|
|
|
result.add(provider);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NonNull
|
|
|
|
|
static List<EmailProvider> fromDomain(Context context, String domain, Discover discover) throws IOException {
|
|
|
|
|
return fromEmail(context, domain, discover);
|
|
|
|
|