mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 06:38:29 +02:00
Added quota range check
This commit is contained in:
@@ -2196,10 +2196,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
if (quota.resources != null)
|
||||
for (Quota.Resource resource : quota.resources) {
|
||||
EntityLog.log(context, "Quota " + resource.name + " " + resource.usage + "/" + resource.limit);
|
||||
// (STORAGE nnnnn 9999999999999999)
|
||||
if ("STORAGE".equalsIgnoreCase(resource.name)) {
|
||||
if (resource.usage >= 0)
|
||||
if (resource.usage * 1024 >= 0)
|
||||
usage = (usage == null ? 0L : usage) + resource.usage * 1024;
|
||||
if (resource.limit > 0)
|
||||
if (resource.limit * 1024 > 0)
|
||||
limit = Math.max(limit == null ? 0L : limit, resource.limit * 1024);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user