// TODO: Revisit the cache size after running more storage tests.
// TODO: Figure out how to ensure ExtServices has the permissions to call
//       StorageStatsManager, because this is ignoring the cache...
private long getReservedCacheSize(String uuid) {
        // TODO: Revisit the cache size after running more storage tests.
        // TODO: Figure out how to ensure ExtServices has the permissions to call
        //       StorageStatsManager, because this is ignoring the cache...
        StorageManager storageManager = getSystemService(StorageManager.class);
        long freeBytes = 0;
        if (uuid == StorageManager.UUID_PRIVATE_INTERNAL) { // regular equals because of null
            freeBytes = Environment.getDataDirectory().getUsableSpace();
        } else {
            final VolumeInfo vol = storageManager.findVolumeByUuid(uuid);
            freeBytes = vol.getPath().getUsableSpace();
        }
        return Math.round(freeBytes * CACHE_RESERVE_RATIO);
    }
private long getReservedCacheSize(String uuid) {
// TODO: Revisit the cache size after running more storage tests.
// TODO: Figure out how to ensure ExtServices has the permissions to call
// StorageStatsManager, because this is ignoring the cache...
StorageManager storageManager = getSystemService(StorageManager.class);
long freeBytes = 0;
private long getReservedCacheSize(String uuid) {
// TODO: Revisit the cache size after running more storage tests.
// TODO: Figure out how to ensure ExtServices has the permissions to call
// StorageStatsManager, because this is ignoring the cache...
StorageManager storageManager = getSystemService(StorageManager.class);
long freeBytes = 0;
if (uuid == StorageManager.UUID_PRIVATE_INTERNAL) { // regular equals because of null
freeBytes = Environment.getDataDirectory().getUsableSpace();
} else {
final VolumeInfo vol = storageManager.findVolumeByUuid(uuid);
freeBytes = vol.getPath().getUsableSpace();
}
return Math.round(freeBytes * CACHE_RESERVE_RATIO);
}
private long getReservedCacheSize(String uuid) {
// TODO: Revisit the cache size after running more storage tests.
// TODO: Figure out how to ensure ExtServices has the permissions to call
// StorageStatsManager, because this is ignoring the cache...
StorageManager storageManager = getSystemService(StorageManager.class);
long freeBytes = 0;
if (uuid == StorageManager.UUID_PRIVATE_INTERNAL) { // regular equals because of null
freeBytes = Environment.getDataDirectory().getUsableSpace();
} else {
final VolumeInfo vol = storageManager.findVolumeByUuid(uuid);
freeBytes = vol.getPath().getUsableSpace();
}
return Math.round(freeBytes * CACHE_RESERVE_RATIO);
}