summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-09-27 18:48:09 -0700
committerDianne Hackborn <hackbod@google.com>2012-09-27 18:48:09 -0700
commitf41496f1791d983bf8bbbdf95f72528e59284b39 (patch)
tree3bca6a251fbd6fd31431c7f9d4ead4f2cd141005 /libs
parent580ee8b0c6e1aea1e2e1d60499b603b9168b44f0 (diff)
downloadframeworks_base-f41496f1791d983bf8bbbdf95f72528e59284b39.zip
frameworks_base-f41496f1791d983bf8bbbdf95f72528e59284b39.tar.gz
frameworks_base-f41496f1791d983bf8bbbdf95f72528e59284b39.tar.bz2
Fix issue #7202950: After clearing data, clear data button is still enabled.
Count the lib symlink against the app's code size. Also be sure to look at the new separate lib path for apps, and tweak the size counting to also count the size of directory entries. Change-Id: I4b0fd5771f249faa05fd72f08062df885902cc97
Diffstat (limited to 'libs')
-rw-r--r--libs/diskusage/dirsize.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libs/diskusage/dirsize.c b/libs/diskusage/dirsize.c
index 45e7b2a..6703783 100644
--- a/libs/diskusage/dirsize.c
+++ b/libs/diskusage/dirsize.c
@@ -49,6 +49,9 @@ int64_t calculate_dir_size(int dfd)
while ((de = readdir(d))) {
const char *name = de->d_name;
+ if (fstatat(dfd, name, &s, AT_SYMLINK_NOFOLLOW) == 0) {
+ size += stat_size(&s);
+ }
if (de->d_type == DT_DIR) {
int subfd;
@@ -64,10 +67,6 @@ int64_t calculate_dir_size(int dfd)
if (subfd >= 0) {
size += calculate_dir_size(subfd);
}
- } else {
- if (fstatat(dfd, name, &s, AT_SYMLINK_NOFOLLOW) == 0) {
- size += stat_size(&s);
- }
}
}
closedir(d);