From 8a9ab24a5c9b595ac0268fcade4b5bbfe7c45c2d Mon Sep 17 00:00:00 2001 From: Suchi Amalapurapu Date: Thu, 11 Mar 2010 16:49:16 -0800 Subject: Do storage checks before initiating a move. Add new remote method to check for insufficient error conditions. Some fixes in MountService when updating media status on PackageManagerService Fix size calculation condition in installd. Add new error code if media is unavailable. New tests for testing error codes. Some additional debugging statements in MountService. Change-Id: Ibfe90d5ed6c71d57f9c1c67806f38b5ae9ecdfbf --- cmds/installd/commands.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'cmds') diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 654ee68..b8ba3f6 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -389,9 +389,10 @@ int get_size(const char *pkgname, const char *apkpath, int cachesize = 0; /* count the source apk as code -- but only if it's not - * on the /system partition + * on the /system partition and its not on the sdcard. */ - if (strncmp(apkpath, "/system", 7) != 0) { + if (strncmp(apkpath, "/system", 7) != 0 && + strncmp(apkpath, SDCARD_DIR_PREFIX, 7) != 0) { if (stat(apkpath, &s) == 0) { codesize += stat_size(&s); } @@ -403,17 +404,6 @@ int get_size(const char *pkgname, const char *apkpath, codesize += stat_size(&s); } } - - /* count the source apk as code -- but only if it's not - * installed on the sdcard - */ - if (strncmp(apkpath, SDCARD_DIR_PREFIX, 7) != 0) { - if (stat(apkpath, &s) == 0) { - codesize += stat_size(&s); - } - } - - /* count the cached dexfile as code */ if (!create_cache_path(path, apkpath)) { if (stat(path, &s) == 0) { -- cgit v1.1