|
@@ -587,19 +587,33 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
|
|
|
AccountUtils.getCurrentOwnCloudAccount(DrawerActivity.this), DrawerActivity.this);
|
|
|
|
|
|
if (result.isSuccess() && result.getData() != null) {
|
|
|
- RemoteGetUserQuotaOperation.Quota quota = (RemoteGetUserQuotaOperation.Quota) result.getData().get
|
|
|
- (0);
|
|
|
+ final RemoteGetUserQuotaOperation.Quota quota =
|
|
|
+ (RemoteGetUserQuotaOperation.Quota) result.getData().get(0);
|
|
|
|
|
|
final long used = quota.getUsed();
|
|
|
final long total = quota.getTotal();
|
|
|
final int relative = (int) Math.ceil(quota.getRelative());
|
|
|
+ final long quotaValue = quota.getQuota();
|
|
|
|
|
|
runOnUiThread(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- if (mQuotaView != null) {
|
|
|
- setQuotaInformation(used,total,relative);
|
|
|
+ if (quotaValue > 0
|
|
|
+ || quotaValue == RemoteGetUserQuotaOperation.QUOTA_LIMIT_INFO_NOT_AVAILABLE) {
|
|
|
+ /**
|
|
|
+ * show quota in case
|
|
|
+ * it is available and calculated (> 0) or
|
|
|
+ * in case of legacy servers (==QUOTA_LIMIT_INFO_NOT_AVAILABLE)
|
|
|
+ */
|
|
|
+ setQuotaInformation(used, total, relative);
|
|
|
} else {
|
|
|
+ /**
|
|
|
+ * quotaValue < 0 means special cases like
|
|
|
+ * {@link RemoteGetUserQuotaOperation.SPACE_NOT_COMPUTED},
|
|
|
+ * {@link RemoteGetUserQuotaOperation.SPACE_UNKNOWN} or
|
|
|
+ * {@link RemoteGetUserQuotaOperation.SPACE_UNLIMITED}
|
|
|
+ * thus don't display any quota information.
|
|
|
+ */
|
|
|
showQuota(false);
|
|
|
}
|
|
|
}
|