Fix a bug where cache was double-counted.
Cache was being counted as cache and also as data in the app info page. This is due to a faulty assumption I made that getDataBytes() and getCacheBytes() measured distinct areas of storage (in actuality, getCacheBytes() is a subset of getDataBytes()). This improper assumption also led to the unit test being incorrect. Change-Id: I4144d50800f82feaecb7a0a8dff26be3e4f14da8 Fixes: 62182151 Test: Settings robotest & manual
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user