summaryrefslogtreecommitdiff
path: root/services/usage/java
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-04-03 07:37:44 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-04-03 07:37:49 +0000
commitfd463121c64643557af5324a8f480677facab15b (patch)
tree384675fe9a54b7092e58ef5758f6a64bcd25048c /services/usage/java
parente1df48d3a0922f928c0d3270324663c7b7f2fa2a (diff)
parentdafb17e7eb9a15862ed1314dff2b82d29ad23632 (diff)
Merge "We really want f_frsize and f_bavail." into oc-dev
Diffstat (limited to 'services/usage/java')
-rw-r--r--services/usage/java/com/android/server/usage/StorageStatsService.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/services/usage/java/com/android/server/usage/StorageStatsService.java b/services/usage/java/com/android/server/usage/StorageStatsService.java
index 68c4c563c2f5..3f39e4f3cf4b 100644
--- a/services/usage/java/com/android/server/usage/StorageStatsService.java
+++ b/services/usage/java/com/android/server/usage/StorageStatsService.java
@@ -398,7 +398,7 @@ public class StorageStatsService extends IStorageStatsManager.Stub {
super(looper);
// TODO: Handle all private volumes.
mStats = new StatFs(Environment.getDataDirectory().getAbsolutePath());
- mPreviousBytes = mStats.getFreeBytes();
+ mPreviousBytes = mStats.getAvailableBytes();
mMinimumThresholdBytes = mStats.getTotalBytes() * MINIMUM_CHANGE_DELTA;
}
@@ -413,9 +413,9 @@ public class StorageStatsService extends IStorageStatsManager.Stub {
switch (msg.what) {
case MSG_CHECK_STORAGE_DELTA: {
- long bytesDelta = Math.abs(mPreviousBytes - mStats.getFreeBytes());
+ long bytesDelta = Math.abs(mPreviousBytes - mStats.getAvailableBytes());
if (bytesDelta > mMinimumThresholdBytes) {
- mPreviousBytes = mStats.getFreeBytes();
+ mPreviousBytes = mStats.getAvailableBytes();
recalculateQuotas(getInitializedStrategy());
}
sendEmptyMessageDelayed(MSG_CHECK_STORAGE_DELTA, DELAY_IN_MILLIS);
@@ -434,7 +434,7 @@ public class StorageStatsService extends IStorageStatsManager.Stub {
// If errors occurred getting the quotas from disk, let's re-calc them.
if (mPreviousBytes < 0) {
- mPreviousBytes = mStats.getFreeBytes();
+ mPreviousBytes = mStats.getAvailableBytes();
recalculateQuotas(strategy);
}
sendEmptyMessageDelayed(MSG_CHECK_STORAGE_DELTA, DELAY_IN_MILLIS);