[Issue#] PkgName could have been NULL.
[Bug] N/A
[Cause] N/A
[Solution] Changed Pkgname type, changed api methods.
[Verification] Build commons, plugins, installer, wrt. Run all tests.
Change-Id: Id244ec00bd7da12bf106c009d65e0bc2e732dc71
}
if (!!configInfo.tizenId) {
- if (!pWidgetConfigInfo.pkgname) {
- pWidgetConfigInfo.pkgname = configInfo.tizenId;
- } else {
- if (pWidgetConfigInfo.pkgname != configInfo.tizenId) {
- *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
- LogDebug("Invalid archive - Tizen ID not same error");
- return false;
- }
+ if (pWidgetConfigInfo.pkgName != *configInfo.tizenId) {
+ *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
+ LogDebug("Invalid archive - Tizen ID not same error");
+ return false;
}
}
regfree(®);
return false;
}
- m_installerContext.widgetConfig.pkgname = configInfo.tizenId;
+ m_installerContext.widgetConfig.pkgName = *configInfo.tizenId;
} else {
WidgetPkgName tizenId = WidgetDAOReadOnly::generateTizenId();
break;
}
- m_installerContext.widgetConfig.pkgname = tizenId;
+ m_installerContext.widgetConfig.pkgName = tizenId;
}
LogInfo("tizen_id name was generated by WRT: " << tizenId);
// send start signal of pkgmgr
getInstallerStruct().pkgmgrInterface->setPkgname(DPL::ToUTF8String(
- *m_installerContext.widgetConfig.pkgname));
+ m_installerContext.widgetConfig.pkgName));
getInstallerStruct().pkgmgrInterface->sendSignal(
PKGMGR_START_KEY,
PKGMGR_START_INSTALL);
}
regfree(®);
- LogInfo("Tizen Id : " << m_installerContext.widgetConfig.pkgname);
+ LogInfo("Tizen Id : " << m_installerContext.widgetConfig.pkgName);
LogInfo("W3C Widget GUID : " << m_installerContext.widgetConfig.guid);
return true;
}
const std::string& tempPath)
{
m_installerContext.locations =
- WidgetLocation(DPL::ToUTF8String(*m_installerContext.widgetConfig.pkgname),
+ WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig.pkgName),
widgetPath, tempPath,
m_installerContext.widgetConfig.packagingType,
m_installerContext.locationType);
if (!setTizenId(configData, update, m_jobStruct.m_preload)) {
return ConfigureResult::Failed;
} else {
- LogInfo("Tizen Id: " << m_installerContext.widgetConfig.pkgname);
+ LogInfo("Tizen Id: " << m_installerContext.widgetConfig.pkgName);
configureWidgetLocation(widgetSource, tempPath);
}
LogInfo("Widget info exists. PkgName: " <<
update.existingWidgetInfo.pkgname);
- DPL::OptionalString pkgname = update.existingWidgetInfo.pkgname;
-
- if(pkgname.IsNull()) {
- LogInfo("But package name doesn't exist");
- return ConfigureResult::Failed;
- }
+ WidgetPkgName pkgname = update.existingWidgetInfo.pkgname;
LogInfo("Widget model exists. package name: " << pkgname);
// Check running state
int retval = APP_MANAGER_ERROR_NONE;
bool isRunning = false;
- retval = app_manager_is_running(DPL::ToUTF8String(*pkgname).c_str(), &isRunning);
+ retval = app_manager_is_running(DPL::ToUTF8String(pkgname).c_str(), &isRunning);
if (APP_MANAGER_ERROR_NONE != retval) {
LogError("Fail to get running state");
return ConfigureResult::Failed;
}
}
- m_installerContext.widgetConfig.pkgname = pkgname;
+ m_installerContext.widgetConfig.pkgName = pkgname;
OptionalWidgetVersion existingVersion;
existingVersion = update.existingWidgetInfo.existingVersion;
OptionalWidgetVersion incomingVersion = update.incomingVersion;
widgetGUID,
widgetVersion,
WidgetUpdateInfo::ExistingWidgetInfo(
- *dao.getPkgname(), dao.getVersion()));
+ dao.getPkgName(), dao.getVersion()));
}
Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
{
//inform widget info
JobWidgetInstall::displayWidgetInfo();
- DPL::OptionalString & tizenId = m_installerContext.widgetConfig.pkgname;
+ WidgetPkgName& tizenId = m_installerContext.widgetConfig.pkgName;
// send signal of pkgmgr
getInstallerStruct().pkgmgrInterface->sendSignal(
LogDebug("Call widget install successfinishedCallback");
getInstallerStruct().finishedCallback(getInstallerStruct().userParam,
- tizenId.IsNull() ? "" : DPL::ToUTF8String(*tizenId), Exceptions::Success);
+ DPL::ToUTF8String(tizenId), Exceptions::Success);
}
void JobWidgetInstall::SendFinishedFailure()
LogError("Error in installation step: " << m_exceptionCaught);
LogError("Message: " << m_exceptionMessage);
- DPL::OptionalString & tizenId = m_installerContext.widgetConfig.pkgname;
+ WidgetPkgName & tizenId = m_installerContext.widgetConfig.pkgName;
LogDebug("Call widget install failure finishedCallback");
PKGMGR_END_FAILURE);
getInstallerStruct().finishedCallback(getInstallerStruct().userParam,
- tizenId.IsNull() ? "" : DPL::ToUTF8String(*tizenId), m_exceptionCaught);
+ DPL::ToUTF8String(tizenId), m_exceptionCaught);
}
void JobWidgetInstall::SaveExceptionData(const Jobs::JobExceptionBase &e)
std::ostringstream out;
WidgetLocalizedInfo localizedInfo =
- W3CFileLocalization::getLocalizedInfo(*dao.getPkgname());
+ W3CFileLocalization::getLocalizedInfo(dao.getPkgName());
out << std::endl <<
"===================================== INSTALLED WIDGET INFO ========="\
"============================";
out << std::endl << "Name: " << localizedInfo.name;
- out << std::endl << "PkgName: " << dao.getPkgname();
+ out << std::endl << "PkgName: " << dao.getPkgName();
WidgetSize size = dao.getPreferredSize();
out << std::endl << "Width: " << size.width;
out << std::endl << "Height: " << size.height;
out << std::endl << "Start File: " <<
- W3CFileLocalization::getStartFile(*dao.getPkgname());
+ W3CFileLocalization::getStartFile(dao.getPkgName());
out << std::endl << "Version: " << dao.getVersion();
out << std::endl << "Licence: " <<
localizedInfo.license;
dao.isDistributorSigned();
out << std::endl << "Widget trusted: " << dao.isTrusted();
- OptionalWidgetIcon icon = W3CFileLocalization::getIcon(*dao.getPkgname());
- DPL::OptionalString iconSrc =
- !!icon ? icon->src : DPL::OptionalString::Null;
+ OptionalWidgetIcon icon = W3CFileLocalization::getIcon(dao.getPkgName());
+ DPL::OptionalString iconSrc = !!icon ? icon->src : DPL::OptionalString::Null;
out << std::endl << "Icon: " << iconSrc;
out << std::endl << "Preferences:";
if ((pkgmgr_installer_save_certinfo(
const_cast<char*>(DPL::ToUTF8String(
- *m_context.widgetConfig.pkgname).c_str()),
+ m_context.widgetConfig.pkgName).c_str()),
m_pkgHandle)) < 0) {
LogError("pkgmgrInstallerSaveCertinfo fail");
ThrowMsg(Exceptions::SetCertificateInfoFailed,
{
if ((pkgmgr_installer_delete_certinfo(
const_cast<char*>(DPL::ToUTF8String(
- *m_context.widgetConfig.pkgname).c_str()))) < 0) {
+ m_context.widgetConfig.pkgName).c_str()))) < 0) {
LogError("pkgmgr_installer_delete_certinfo fail");
}
}
{
LogDebug("Step Encrypt resource");
m_resEnc = new ResourceEncryptor;
- m_resEnc->CreateEncryptionKey(DPL::ToUTF8String(*m_context.
- widgetConfig.pkgname));
+ m_resEnc->CreateEncryptionKey(DPL::ToUTF8String(m_context.
+ widgetConfig.pkgName));
EncryptDirectory(m_context.locations->getTemporaryRootDir());
}
void TaskFileManipulation::StepCreateDirs()
{
std::string widgetPath;
- DPL::OptionalString pkgname = m_context.widgetConfig.pkgname;
- if (pkgname.IsNull()) {
- ThrowMsg(Exceptions::InternalError, "No Package name exists.");
- }
widgetPath = m_context.locations->getPackageInstallationDir();
void TaskFileManipulation::StepRenamePath()
{
std::string instDir;
- DPL::OptionalString pkgname = m_context.widgetConfig.pkgname;
- if (pkgname.IsNull()) {
- ThrowMsg(Exceptions::InternalError, "No Package name exists.");
- }
if (m_context.widgetConfig.packagingType == PKG_TYPE_HYBRID_WEB_APP) {
instDir = m_context.locations->getPackageInstallationDir();
const DPL::String& languageTag) const
{
DPL::OStringStream filename;
- DPL::Optional<DPL::String> pkgname = m_context.widgetConfig.pkgname;
- if (pkgname.IsNull()) {
- ThrowMsg(Exceptions::InternalError, "No Package name exists.");
- }
+ WidgetPkgName pkgname = m_context.widgetConfig.pkgName;
- filename << DPL::ToUTF8String(*pkgname).c_str();
+ filename << DPL::ToUTF8String(pkgname).c_str();
if (!languageTag.empty()) {
DPL::OptionalString tag = getLangTag(languageTag); // translate en -> en_US etc
{
// Update ail for desktop
std::string cfgPkgname =
- DPL::ToUTF8String(*m_context.widgetConfig.pkgname);
+ DPL::ToUTF8String(m_context.widgetConfig.pkgName);
const char* pkgname = cfgPkgname.c_str();
LogDebug("Update ail desktop : " << pkgname );
std::list<std::string> fileList;
getFileList(GlobalConfig::GetUserWidgetDesktopIconPath(), fileList);
- std::string pkgname = DPL::ToUTF8String(*m_context.widgetConfig.pkgname);
+ std::string pkgname = DPL::ToUTF8String(m_context.widgetConfig.pkgName);
FOREACH(it, fileList)
{
void TaskManifestFile::stepGenerateManifest()
{
- DPL::String pkgname = *m_context.widgetConfig.pkgname;
+ WidgetPkgName pkgname = m_context.widgetConfig.pkgName;
manifest_name = pkgname + L".xml";
manifest_file += L"/tmp/" + manifest_name;
generateWidgetName(manifest, uiApp, DPL::OptionalString::Null, name, defaultNameSaved);
}
//appid
- DPL::String pkgname;
- if(!!m_context.widgetConfig.pkgname)
- {
- pkgname = *m_context.widgetConfig.pkgname;
- uiApp.setAppid(pkgname);
- }
+ WidgetPkgName pkgname = m_context.widgetConfig.pkgName;
+ uiApp.setAppid(pkgname);
+
//extraid
if(!!m_context.widgetConfig.guid) {
void TaskManifestFile::setWidgetIcons(UiApplication & uiApp)
{
- DPL::OptionalString pkgname = m_context.widgetConfig.pkgname;
- if (pkgname.IsNull()) {
- ThrowMsg(Exceptions::InternalError, "No Package name exists.");
- }
-
//TODO this file will need to be updated when user locale preferences
//changes.
bool defaultIconSaved = false;
void TaskManifestFile::setWidgetManifest(Manifest & manifest)
{
- if(!!m_context.widgetConfig.pkgname)
- {
- manifest.setPackage(*m_context.widgetConfig.pkgname);
- }
+ manifest.setPackage(m_context.widgetConfig.pkgName);
+
if(!!m_context.widgetConfig.version)
{
manifest.setVersion(*m_context.widgetConfig.version);
devcaps << utf8;
}
}
- DPL::OptionalString pkgName = m_context.widgetConfig.Pkgname;
- Assert(!pkgName.IsNull() && "widget doesn't have a pkg name");
+ WidgetPkgName pkgName = m_context.widgetConfig.pkgName;
int result = handle_access_control_conf_forWAC(
- DPL::ToUTF8String(*pkgName).c_str(),
+ DPL::ToUTF8String(pkgName).c_str(),
devcaps.str().c_str(),
OPERATION_INSTALL);
Assert(result==PC_OPERATION_SUCCESS && "access control setup failed");
}
}
if (!!configInfo.tizenId) {
- if (!pWidgetConfigInfo.pkgname) {
- pWidgetConfigInfo.pkgname = configInfo.tizenId;
- } else {
- if (pWidgetConfigInfo.pkgname != configInfo.tizenId) {
- LogError("Invalid archive - Tizen ID not same error");
- return false;
- }
- }
+ if (pWidgetConfigInfo.pkgName != *configInfo.tizenId) {
+ LogError("Invalid archive - Tizen ID not same error");
+ return false;
+ }
}
if (!!configInfo.version) {
if (!pWidgetConfigInfo.version) {
#ifdef WRT_SMACK_ENABLED
try {
WrtDB::WidgetDAOReadOnly dao(m_context.locations->getPkgname());
- DPL::OptionalString pkgName = dao.getPkgname();
- Assert(!pkgName.IsNull() && "widget doesn't have a pkg name");
+ WidgetPkgName pkgName = dao.getPkgName();
const char *devCap = "";
int result = handle_access_control_conf_forWAC(
- DPL::ToUTF8String(*pkgName).c_str(),
+ DPL::ToUTF8String(pkgName).c_str(),
NULL,
OPERATION_UNINSTALL);
Assert(result==PC_OPERATION_SUCCESS && "access control setup failed");
WrtDB::WrtDatabase::attachToThreadRO();
- WidgetPkgNameList pkgnameslList = WidgetDAOReadOnly::getPkgnameList();
+ WidgetPkgNameList_TEMPORARY_API pkgnameslList = WidgetDAOReadOnly::getPkgnameList_TEMPORARY_API();
*count = 0;
FOREACH(iterator, pkgnameslList) {
pkg_last->next = pkg_info;
}
- WidgetPkgName pkgname = **iterator;
+ WidgetPkgName pkgname = *iterator;
WidgetDAOReadOnly widget(pkgname);
strncpy(pkg_info->pkg_type, "wgt", PKG_TYPE_STRING_LEN_MAX);
snprintf(pkg_info->pkg_name, PKG_NAME_STRING_LEN_MAX, "%s",
WidgetGUID widget_guid = DPL::FromUTF8String(guid);
WrtDB::WidgetDAOReadOnly dao(widget_guid);
- pkgname = DPL::ToUTF8String(*dao.getPkgname());
+ pkgname = DPL::ToUTF8String(dao.getPkgName());
return WRT_SUCCESS;
}
catch (WidgetDAOReadOnly::Exception::WidgetNotExist)