Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 118ebd79 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix to obtain current updated value of available bytes"

parents cc04d7d3 2f882be3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
                    }