From 35e46d297255363a20ccde62af3c58c4ce3c13c5 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 9 Jun 2017 10:01:20 -0600 Subject: 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 --- services/usage/java/com/android/server/usage/StorageStatsService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/usage/java') 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; -- cgit v1.2.3-59-g8ed1b