class ScopedInstaller {
public:
- ScopedInstaller(const AppInstallHelper &appInstallHelper)
- : m_appInstallHelper(appInstallHelper)
+ ScopedInstaller(const AppInstallHelper &appInstallHelper, bool requestUid = true)
+ : m_appInstallHelper(appInstallHelper), m_shouldUninstall(true)
{
SecurityManagerTest::InstallRequest instReq;
instReq.setAppId(m_appInstallHelper.getAppId());
instReq.setPkgId(m_appInstallHelper.getPkgId());
- instReq.setUid(m_appInstallHelper.getUID());
if (m_appInstallHelper.getInstallType() != SM_APP_INSTALL_NONE)
instReq.setInstallType(m_appInstallHelper.getInstallType());
+ if (requestUid)
+ instReq.setUid(m_appInstallHelper.getUID());
instReq.setAppTizenVersion(m_appInstallHelper.getVersion());
if (!m_appInstallHelper.getAuthor().empty())
instReq.setAuthorId(m_appInstallHelper.getAuthor());
}
void uninstallApp() {
+ if (!m_shouldUninstall)
+ return;
SecurityManagerTest::InstallRequest uninstReq;
uninstReq.setAppId(m_appInstallHelper.getAppId());
uninstReq.setUid(m_appInstallHelper.getUID());
SecurityManagerTest::Api::uninstall(uninstReq);
+ m_shouldUninstall = false;
}
AppInstallHelper& getAIH() {
protected:
AppInstallHelper m_appInstallHelper;
+ bool m_shouldUninstall;
};