1
0
mirror of https://github.com/etesync/android synced 2025-01-11 00:01:12 +00:00

Don't fail to detect resources if principal is not available for CalDAV/CardDAV

This commit is contained in:
rfc2822 2014-10-02 12:04:29 +02:00
parent b8e6ff4627
commit 07ec3c1a0a

View File

@ -135,15 +135,21 @@ public class DavResourceFinder {
if (wellKnown.getCurrentUserPrincipal() != null)
return new WebDavResource(wellKnown, wellKnown.getCurrentUserPrincipal());
} catch (HttpException e) {
Log.d(TAG, "Well-known service detection failed with HTTP error", e);
Log.d(TAG, "well-known " + serviceName + " service detection failed with HTTP error", e);
} catch (DavException e) {
Log.d(TAG, "Well-known service detection failed at DAV level", e);
Log.d(TAG, "Well-known " + serviceName + " service detection failed at DAV level", e);
}
// fall back to user-given initial context path
resource.propfind(Mode.CURRENT_USER_PRINCIPAL);
if (resource.getCurrentUserPrincipal() != null)
return new WebDavResource(resource, resource.getCurrentUserPrincipal());
// fall back to user-given initial context path
try {
resource.propfind(Mode.CURRENT_USER_PRINCIPAL);
if (resource.getCurrentUserPrincipal() != null)
return new WebDavResource(resource, resource.getCurrentUserPrincipal());
} catch (HttpException e) {
Log.d(TAG, "HTTP error when querying principal for " + serviceName + " service", e);
} catch (DavException e) {
Log.d(TAG, "DAV error when querying principal for " + serviceName + " service", e);
}
return null;
}