Add install type field to ScopedInstaller 22/121322/12
authorPiotr Sawicki <p.sawicki2@partner.samsung.com>
Mon, 27 Mar 2017 13:00:45 +0000 (15:00 +0200)
committerZofia Abramowska <z.abramowska@samsung.com>
Mon, 10 Apr 2017 11:44:51 +0000 (13:44 +0200)
ScopedInstaller should use the same install type during installation and
removal of an application.

Change-Id: I50f73c50651dccb31427a6eb98a30a5b09d546f5

src/security-manager-tests/common/scoped_installer.h

index a495dfb..10e1ceb 100644 (file)
@@ -38,6 +38,7 @@ public:
     ScopedInstaller(const AppInstallHelper &app, bool requestUid = true)
         : m_appId(app.getAppId()),
           m_uid(app.getUID()),
+          m_installType(app.getInstallType()),
           m_shouldUninstall(true),
           m_requestUid(requestUid),
           m_creatorPid(getpid())
@@ -71,6 +72,7 @@ public:
     ScopedInstaller(ScopedInstaller &&other)
         : m_appId(std::move(other.m_appId)),
           m_uid(other.m_uid),
+          m_installType(other.m_installType),
           m_shouldUninstall(other.m_shouldUninstall),
           m_requestUid(other.m_requestUid),
           m_creatorPid(other.m_creatorPid)
@@ -96,7 +98,8 @@ public:
         uninstReq.setAppId(m_appId);
         if (m_requestUid)
             uninstReq.setUid(m_uid);
-
+        if (m_installType != SM_APP_INSTALL_NONE)
+            uninstReq.setInstallType(m_installType);
         SecurityManagerTest::Api::uninstall(uninstReq);
         m_shouldUninstall = false;
     }
@@ -104,6 +107,7 @@ public:
 protected:
     std::string m_appId;
     uid_t m_uid;
+    app_install_type m_installType;
     bool m_shouldUninstall;
     bool m_requestUid;
     pid_t m_creatorPid;