|
@@ -632,34 +632,36 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
|
|
|
final UserInfo userInfo = (UserInfo) result.getData().get(0);
|
|
|
final Quota quota = userInfo.getQuota();
|
|
|
|
|
|
- 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 (quotaValue > 0
|
|
|
- || quotaValue == GetRemoteUserInfoOperation.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);
|
|
|
+ if (quota != null) {
|
|
|
+ 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 (quotaValue > 0
|
|
|
+ || quotaValue == GetRemoteUserInfoOperation.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);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|