Fix to obtain current updated value of available bytes
Bug: 199378831 Test: manual Change-Id: Ibe9dc762dd1740e4fa1a34b5a7d5b23d73b25282
This commit is contained in:
@@ -561,6 +561,7 @@ public class StorageStatsService extends IStorageStatsManager.Stub {
|
||||
|
||||
switch (msg.what) {
|
||||
case MSG_CHECK_STORAGE_DELTA: {
|
||||
mStats.restat(Environment.getDataDirectory().getAbsolutePath());
|
||||
long bytesDelta = Math.abs(mPreviousBytes - mStats.getAvailableBytes());
|
||||
if (bytesDelta > mMinimumThresholdBytes) {
|
||||
mPreviousBytes = mStats.getAvailableBytes();
|
||||
@@ -583,6 +584,7 @@ public class StorageStatsService extends IStorageStatsManager.Stub {
|
||||
|
||||
// If errors occurred getting the quotas from disk, let's re-calc them.
|
||||
if (mPreviousBytes < 0) {
|
||||
mStats.restat(Environment.getDataDirectory().getAbsolutePath());
|
||||
mPreviousBytes = mStats.getAvailableBytes();
|
||||
recalculateQuotas(strategy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user