Merge "Fix a bug where cache was double-counted." into oc-dev am: 7035a41715

am: 0a8b12a30a

Change-Id: I3f17e10a9aaf011aee587dbe0e36d18a3a27c42f
This commit is contained in:
Daniel Nishi
2017-06-01 17:48:41 +00:00
committed by android-build-merger
3 changed files with 10 additions and 11 deletions

View File

@@ -543,8 +543,8 @@ public class AppStorageSettings extends AppInfoWithHeader
mClearCacheButton.setEnabled(false);
} else {
long codeSize = result.getCodeBytes();
long dataSize = result.getDataBytes();
long cacheSize = result.getCacheBytes();
long dataSize = result.getDataBytes() - cacheSize;
if (dataSize <= 0 || !mCanClearData || mDataCleared) {
mClearDataButton.setEnabled(false);

View File

@@ -70,7 +70,8 @@ public class AppStorageSizesController {
mTotalSize.setSummary(errorRes);
} else {
long codeSize = mLastResult.getCodeBytes();
long dataSize = mDataCleared ? 0 : mLastResult.getDataBytes();
long dataSize =
mDataCleared ? 0 : mLastResult.getDataBytes() - mLastResult.getCacheBytes();
if (mLastCodeSize != codeSize) {
mLastCodeSize = codeSize;
mAppSize.setSummary(getSizeStr(context, codeSize));