1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Handle case with quota 0

This commit is contained in:
David González 2018-05-15 13:07:44 +02:00 committed by davigonz
parent a21614fd5a
commit f3566d667e

View File

@ -160,8 +160,10 @@ public class GetRemoteUserQuotaOperation extends RemoteOperation {
WebdavEntry we = new WebdavEntry(remoteData.getResponses()[0], client.getWebdavUri().getPath());
// If there's a special case, available bytes will contain a negative code
if (we.quotaAvailableBytes().compareTo(new BigDecimal(0)) == -1) {
// -1, PENDING: Not computed yet, e.g. external storage mounted but folder sizes need scanning
// -2, UNKNOWN: Storage not accessible, e.g. external storage with no API to ask for the free space
// -3, UNLIMITED: Quota using all the storage
if (we.quotaAvailableBytes().compareTo(new BigDecimal(1)) == -1) {
return new Quota(
we.quotaAvailableBytes().longValue(),
we.quotaUsedBytes().longValue(),