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

Commit 2f882be3 authored by Neharika Jali's avatar Neharika Jali
Browse files

Fix to obtain current updated value of available bytes

Bug: 199378831
Test: manual
Change-Id: Ibe9dc762dd1740e4fa1a34b5a7d5b23d73b25282
parent bd2bc33d
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);
                    }