SM : Don't add version by default in app install 87/93087/6
authorZofia Abramowska <z.abramowska@samsung.com>
Wed, 12 Oct 2016 12:47:22 +0000 (14:47 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 28 Nov 2016 16:13:12 +0000 (17:13 +0100)
Change-Id: Id460dbb9b5216ba4472a498c7ea5317084b06bc2

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

index e2436e3..f5a0414 100644 (file)
@@ -67,6 +67,10 @@ std::string AppInstallHelper::getPkgId() const {
     return m_pkgName + "_pkg_id";
 }
 
+void AppInstallHelper::setVersion(const std::string &version) {
+    m_version = version;
+}
+
 std::string AppInstallHelper::getVersion() const {
     return m_version;
 }
index 08d8126..1b6e690 100644 (file)
@@ -25,7 +25,6 @@
 #include <security-manager-types.h>
 
 const uid_t OWNER_UID = 5001;
-const std::string TIZEN_VERSION = "3.0";
 
 struct AppInstallHelper {
 
@@ -34,7 +33,7 @@ struct AppInstallHelper {
                      const std::string &pkgNamePrefix,
                      bool isLocal,
                      uid_t uid,
-                     std::string version,
+                     std::string version = std::string(),
                      bool isHybrid = false)
       : m_appName(appNamePrefix), m_pkgName(pkgNamePrefix), m_isLocal(isLocal), m_uidGid(uid), m_version(version),
         m_installType(SM_APP_INSTALL_NONE), m_isHybrid(isHybrid)
@@ -45,27 +44,28 @@ struct AppInstallHelper {
     AppInstallHelper(const std::string &appNamePrefix,
                      const std::string &pkgNamePrefix,
                      uid_t uid)
-      : AppInstallHelper(appNamePrefix, pkgNamePrefix, false, uid, TIZEN_VERSION)
+      : AppInstallHelper(appNamePrefix, pkgNamePrefix, false, uid)
     {}
 
     AppInstallHelper(const std::string &namePrefix)
-      : AppInstallHelper(namePrefix, namePrefix, false, geteuid(), TIZEN_VERSION)
+      : AppInstallHelper(namePrefix, namePrefix, false, geteuid())
     {}
 
     AppInstallHelper(const std::string &appNamePrefix, const std::string &pkgNamePrefix)
-      : AppInstallHelper(appNamePrefix, pkgNamePrefix, false, geteuid(), TIZEN_VERSION)
+      : AppInstallHelper(appNamePrefix, pkgNamePrefix, false, geteuid())
     {}
 
     AppInstallHelper(const std::string &namePrefix, uid_t uid)
-      : AppInstallHelper(namePrefix, namePrefix, true, uid, TIZEN_VERSION)
+      : AppInstallHelper(namePrefix, namePrefix, true, uid)
     {}
 
     // App info getters and setters
     std::string getAppId() const;
     std::string getPkgId() const;
-    std::string getVersion() const;
     int getUID() const;
     int getGID() const;
+    void setVersion(const std::string &version);
+    std::string getVersion() const;
     void setAuthor(const std::string &author);
     std::string getAuthor() const;
     void setInstallType(app_install_type type);
index 27b96ee..3dcf080 100644 (file)
@@ -48,7 +48,8 @@ public:
             instReq.setInstallType(m_appInstallHelper.getInstallType());
         if (requestUid)
             instReq.setUid(m_appInstallHelper.getUID());
-        instReq.setAppTizenVersion(m_appInstallHelper.getVersion());
+        if (!m_appInstallHelper.getVersion().empty())
+            instReq.setAppTizenVersion(m_appInstallHelper.getVersion());
         if (!m_appInstallHelper.getAuthor().empty())
             instReq.setAuthorId(m_appInstallHelper.getAuthor());
         for (const auto& typePaths : m_appInstallHelper.getDirsMap())