summaryrefslogtreecommitdiff
path: root/services/usage/java
diff options
context:
space:
mode:
author Jeff Sharkey <jsharkey@android.com> 2017-06-09 10:01:20 -0600
committer Jeff Sharkey <jsharkey@android.com> 2017-06-12 14:27:23 -0600
commit35e46d297255363a20ccde62af3c58c4ce3c13c5 (patch)
tree6a082247418b5cc02d46e4a351a4d3f930ce779c /services/usage/java
parent9620595965bc7ffb74518eee19bbd63702c57121 (diff)
Active camera apps can defy reserved cache space.
We normally prevent apps from allocating into the "reserved" cache space, but this change makes an exception for an active camera app, since the user is probably trying to capture an important memory. This change only lets the active camera app clear up to half of the reserved space, since we don't want to completely destroy the experience of all other apps. Test: manual app before/during/after active camera session Bug: 38267830 Change-Id: Ie9e63884fb2638ca881e10b894629eea84601648
Diffstat (limited to 'services/usage/java')
-rw-r--r--services/usage/java/com/android/server/usage/StorageStatsService.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/usage/java/com/android/server/usage/StorageStatsService.java b/services/usage/java/com/android/server/usage/StorageStatsService.java
index 562443f53546..9f4fb85f64c4 100644
--- a/services/usage/java/com/android/server/usage/StorageStatsService.java
+++ b/services/usage/java/com/android/server/usage/StorageStatsService.java
@@ -197,7 +197,7 @@ public class StorageStatsService extends IStorageStatsManager.Stub {
// logic should be kept in sync with getAllocatableBytes().
if (isQuotaSupported(volumeUuid, callingPackage)) {
final long cacheTotal = getCacheBytes(volumeUuid, callingPackage);
- final long cacheReserved = mStorage.getStorageCacheBytes(path);
+ final long cacheReserved = mStorage.getStorageCacheBytes(path, 0);
final long cacheClearable = Math.max(0, cacheTotal - cacheReserved);
return path.getUsableSpace() + cacheClearable;