mirror of
https://github.com/etesync/android
synced 2025-01-11 08:10:58 +00:00
Don't fail to detect resources if principal is not available for CalDAV/CardDAV
This commit is contained in:
parent
b8e6ff4627
commit
07ec3c1a0a
@ -135,15 +135,21 @@ public class DavResourceFinder {
|
|||||||
if (wellKnown.getCurrentUserPrincipal() != null)
|
if (wellKnown.getCurrentUserPrincipal() != null)
|
||||||
return new WebDavResource(wellKnown, wellKnown.getCurrentUserPrincipal());
|
return new WebDavResource(wellKnown, wellKnown.getCurrentUserPrincipal());
|
||||||
} catch (HttpException e) {
|
} 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) {
|
} 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
|
// fall back to user-given initial context path
|
||||||
|
try {
|
||||||
resource.propfind(Mode.CURRENT_USER_PRINCIPAL);
|
resource.propfind(Mode.CURRENT_USER_PRINCIPAL);
|
||||||
if (resource.getCurrentUserPrincipal() != null)
|
if (resource.getCurrentUserPrincipal() != null)
|
||||||
return new WebDavResource(resource, resource.getCurrentUserPrincipal());
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user