add StatFsHelper#isHighSpaceCondition
@@ -51,6 +51,8 @@ public class StatFsHelper {
public static final long DEFAULT_DISK_RED_LEVEL_IN_BYTES =
DEFAULT_DISK_RED_LEVEL_IN_MB * 1024 * 1024;
+ public static final long DEFAULT_DISK_OLIVE_LEVEL_IN_BYTES = 1000 * 1024 * 1024;
+
private static StatFsHelper sStatsFsHelper;
// Time interval for updating disk information
@@ -217,6 +219,11 @@ public class StatFsHelper {
< DEFAULT_DISK_RED_LEVEL_IN_BYTES;
}
+ public boolean isHighSpaceCondition() {
+ return getAvailableStorageSpace(StatFsHelper.StorageType.INTERNAL)
+ > DEFAULT_DISK_OLIVE_LEVEL_IN_BYTES;
+ }
+
/**
* Thread-safe call to update disk stats. Update occurs if the thread is able to acquire the lock
* (i.e., no other thread is updating it at the same time), and it has been at least
