#include <widget_install/widget_install_errors.h>
#include <widget_install/widget_install_context.h>
#include <dpl/wrt-dao-rw/widget_dao.h>
+#include <dpl/wrt-dao-ro/vconf_config.h>
#include <dpl/foreach.h>
#include <dpl/utils/wrt_utility.h>
#include <dpl/log/log.h>
namespace Jobs {
namespace WidgetInstall {
-namespace {
-const char * const VCONF_KEY_PREFIX = "file/private/";
-const char * const VCONF_KEY_GROUP = "/security";
-const char * const VCONF_KEY_POPUP_USAGE = "/popup_usage";
-const char * const VCONF_KEY_GEOLOCATION_USAGE = "/geolocation_usage";
-const char * const VCONF_KEY_WEB_NOTIFICATION_USAGE = "/web_notification_usage";
-const char * const VCONF_KEY_WEB_DATABASE_USAGE = "/web_database_usage";
-const char * const VCONF_KEY_FILESYSTEM_USAGE = "/filesystem_usage";
-}
TaskDatabase::TaskDatabase(InstallerContext& context) :
DPL::TaskDecl<TaskDatabase>(this),
m_context(context),
void TaskDatabase::StepCreateVconf()
{
LogDebug("StepCreateVconf");
- std::string keyPrefix =
- VCONF_KEY_PREFIX
- + DPL::ToUTF8String(m_context.locations->getPkgname())
- + VCONF_KEY_GROUP;
- std::string securityPopupUsageKey = keyPrefix + VCONF_KEY_POPUP_USAGE;
- std::string geolocationUsageKey = keyPrefix + VCONF_KEY_GEOLOCATION_USAGE;
- std::string webNotificationUsageKey = keyPrefix + VCONF_KEY_WEB_NOTIFICATION_USAGE;
- std::string webDatabaseUsageKey = keyPrefix + VCONF_KEY_WEB_DATABASE_USAGE;
- std::string filesystemUsageKey = keyPrefix + VCONF_KEY_FILESYSTEM_USAGE;
-
- vconf_set_int(securityPopupUsageKey.c_str(),
+ std::string popupUsageKey =
+ WrtDB::VconfConfig::GetVconfKeyPopupUsage(
+ m_context.locations->getPkgname());
+ std::string geolocationUsageKey =
+ WrtDB::VconfConfig::GetVconfKeyGeolocationUsage(
+ m_context.locations->getPkgname());
+ std::string webNotificationUsageKey =
+ WrtDB::VconfConfig::GetVconfKeyWebNotificationUsage(
+ m_context.locations->getPkgname());
+ std::string webDatabaseUsageKey =
+ WrtDB::VconfConfig::GetVconfKeyWebDatabaseUsage(
+ m_context.locations->getPkgname());
+ std::string filesystemUsageKey =
+ WrtDB::VconfConfig::GetVconfKeyFilesystemUsage(
+ m_context.locations->getPkgname());
+
+ vconf_set_int(popupUsageKey.c_str(),
static_cast<int>(WrtDB::SETTINGS_TYPE_ON));
// prevent permission error
- vconf_unset(securityPopupUsageKey.c_str());
- vconf_set_int(securityPopupUsageKey.c_str(),
+ vconf_unset(popupUsageKey.c_str());
+ vconf_set_int(popupUsageKey.c_str(),
static_cast<int>(WrtDB::SETTINGS_TYPE_ON));
vconf_set_int(geolocationUsageKey.c_str(),
static_cast<int>(WrtDB::SETTINGS_TYPE_ON));
ErrorDeferred, ///< Widget installation was deferred and will be continued when possible
ErrorDatabaseFailure, ///< Failure in database
ErrorRemovingFolderFailure, ///< Failure in removing existing widget folder
- ErrorCreateVconfFailure, ///< Failure in creating vconf
+ ErrorCreateVconfFailure, ///< Failure in creating vconf
ErrorInstallOspServcie, ///< Failure in installing osp service
ErrorUpdateWidget, ///< Failure in widget update.
ErrorInstallToExt, ///< Failure in install to sdcard
#include <widget_uninstall/uninstaller_context.h>
#include <dpl/wrt-dao-rw/widget_dao.h>
#include <dpl/wrt-dao-ro/widget_config.h>
+#include <dpl/wrt-dao-ro/vconf_config.h>
#include <dpl/assert.h>
#include <dpl/utils/wrt_utility.h>
#include <ail.h>
void TaskRemoveFiles::StepRemoveVconf()
{
std::string key =
- VCONF_KEY_PREFIX
- + DPL::ToUTF8String(m_context.locations->getPkgname()) ;
+ WrtDB::VconfConfig::GetVconfKeyRootPath(
+ m_context.locations->getPkgname());
if(vconf_unset_recursive(key.c_str())) {
LogError("Fail to unset vconf file");
} else {