Fix issue #6761130: Clearing app data in settings does not clear app's USB storage

The installed app details was not correctly distinguishing between cache and
normal data on external storage.  The cache files on external storage are now
correctly shown in the cache section, since those are what get deleted when
you hit the clear cache button.

Change-Id: Id98bdb7fb5202d6a092fe5a772638eeb6aed2b47
This commit is contained in:
Dianne Hackborn
2012-06-29 15:01:23 -07:00
parent beb3d8b1e0
commit 313ab17270
2 changed files with 25 additions and 11 deletions

View File

@@ -73,6 +73,16 @@ public class ApplicationsState {
long dataSize;
long externalCodeSize;
long externalDataSize;
// This is the part of externalDataSize that is in the cache
// section of external storage. Note that we don't just combine
// this with cacheSize because currently the platform can't
// automatically trim this data when needed, so it is something
// the user may need to manage. The externalDataSize also includes
// this value, since what this is here is really the part of
// externalDataSize that we can just consider to be "cache" files
// for purposes of cleaning them up in the app details UI.
long externalCacheSize;
}
public static class AppEntry extends SizeInfo {
@@ -820,13 +830,15 @@ public class ApplicationsState {
entry.codeSize != stats.codeSize ||
entry.dataSize != stats.dataSize ||
entry.externalCodeSize != externalCodeSize ||
entry.externalDataSize != externalDataSize) {
entry.externalDataSize != externalDataSize ||
entry.externalCacheSize != stats.externalCacheSize) {
entry.size = newSize;
entry.cacheSize = stats.cacheSize;
entry.codeSize = stats.codeSize;
entry.dataSize = stats.dataSize;
entry.externalCodeSize = externalCodeSize;
entry.externalDataSize = externalDataSize;
entry.externalCacheSize = stats.externalCacheSize;
entry.sizeStr = getSizeStr(entry.size);
entry.internalSize = getTotalInternalSize(stats);
entry.internalSizeStr = getSizeStr(entry.internalSize);