Fix the update of package cross-rules during uninstallation 51/68451/7
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 4 May 2016 09:26:46 +0000 (11:26 +0200)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Fri, 13 May 2016 16:07:24 +0000 (09:07 -0700)
[Problem] During app uninstallation the package rules are updated basing on the
list of apps being a part of the package. However the app being uninstalled is
not removed from this list which may generate unwanted smack rules.
[Solution] Remove uninstalled app from package contents list.

[Verification] Test is not yet implemented.

Change-Id: I867e65a996d0c797dfab9bcaaf15bbaf1a4261c4

src/common/service_impl.cpp

index ce4e32d..9aaafc5 100755 (executable)
@@ -562,6 +562,7 @@ int ServiceImpl::appUninstall(const Credentials &creds, app_inst_req &&req)
             SmackRules::uninstallPackageRules(req.pkgName);
             if (!removePkg) {
                 LogDebug("Recreating Smack rules for pkgName " << req.pkgName);
+                pkgContents.erase(std::remove(pkgContents.begin(), pkgContents.end(),req.appName), pkgContents.end());
                 SmackRules::updatePackageRules(req.pkgName, pkgContents, allTizen2XApps);
             }
         }