diff options
| author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2011-12-25 17:37:53 +0700 |
|---|---|---|
| committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2013-01-10 17:01:17 +0700 |
| commit | 0e7f769089a7208b0d719c8e5f48fa22a338737c (patch) | |
| tree | 957ba80d565b1aa7f22145e1d4692896419ce0a0 /cmds/installd/utils.c | |
| parent | 6bbe7b78b9cd97d83dd4fb9726e3c6e4bc0207eb (diff) | |
| download | frameworks_base-0e7f769089a7208b0d719c8e5f48fa22a338737c.zip frameworks_base-0e7f769089a7208b0d719c8e5f48fa22a338737c.tar.gz frameworks_base-0e7f769089a7208b0d719c8e5f48fa22a338737c.tar.bz2 | |
installd: Delete cache properly for devices using datadata partition
The java side already checks /data/data for free space but installd
still checks /data causing it to never reap the cache (because it
thinks that enough free space is available.)
Change-Id: I736af6ff7ea0c8ae07900168f6b8ac2f7a4dbe0b
Diffstat (limited to 'cmds/installd/utils.c')
| -rw-r--r-- | cmds/installd/utils.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmds/installd/utils.c b/cmds/installd/utils.c index 625a35e..154a2f8 100644 --- a/cmds/installd/utils.c +++ b/cmds/installd/utils.c @@ -362,7 +362,11 @@ int lookup_media_dir(char basepath[PATH_MAX], const char *dir) int64_t data_disk_free() { struct statfs sfs; - if (statfs(android_data_dir.path, &sfs) == 0) { + /* Scanning /data/data because on some devices, it's on a different partition + * and scanning /data will yield the incorrect result. (This function is only + * used for freeing space on /data/data so it is okay to be more specific.) + */ + if (statfs(android_datadata_dir.path, &sfs) == 0) { return sfs.f_bavail * sfs.f_bsize; } else { ALOGE("Couldn't statfs %s: %s\n", android_data_dir.path, strerror(errno)); |
