}
}
-void GlobalDAO::setComplianceMode(bool mode)
-{
- LogDebug("Updating compliance mode to:" << mode);
- Try {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- GlobalProperties::Row row;
- row.Set_compliance_mode(mode);
-
- WRT_DB_UPDATE(update, GlobalProperties, &WrtDatabase::interface())
- update->Values(row);
- update->Execute();
- }
- Catch(DPL::DB::SqlConnection::Exception::Base){
- ReThrowMsg(GlobalDAO::Exception::DatabaseError,
- "Failed to update compliance mode");
- }
-}
-
-void GlobalDAO::setComplianceFakeImei(const std::string &imei)
-{
- LogDebug("Setting compliance fake IMEI: " << imei);
- Try {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- GlobalProperties::Row row;
- row.Set_compliance_fake_imei(DPL::FromASCIIString(imei));
-
- WRT_DB_UPDATE(update, GlobalProperties, &WrtDatabase::interface())
- update->Values(row);
- update->Execute();
- }
- Catch(DPL::DB::SqlConnection::Exception::Base){
- ReThrowMsg(GlobalDAO::Exception::DatabaseError,
- "Failed to update compliance fake IMEI");
- }
-}
-
-void GlobalDAO::setComplianceFakeMeid(const std::string &meid)
-{
- LogDebug("Setting compliance fake MEID: " << meid);
- Try {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- GlobalProperties::Row row;
- row.Set_compliance_fake_meid(DPL::FromASCIIString(meid));
-
- WRT_DB_UPDATE(update, GlobalProperties, &WrtDatabase::interface())
- update->Values(row);
- update->Execute();
- }
- Catch(DPL::DB::SqlConnection::Exception::Base){
- ReThrowMsg(GlobalDAO::Exception::DatabaseError,
- "Failed to update compliance fake MEID");
- }
-}
-
void GlobalDAO::SetHomeNetworkDataUsage(GlobalDAO::NetworkAccessMode newMode)
{
LogDebug("updating home network data usage to:" << newMode);
return select->GetSingleValue<GlobalProperties::secure_by_default>();
}
-bool GlobalDAOReadOnly::getComplianceMode()
-{
- LogDebug("Getting compliance mode");
- Try {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- WRT_DB_SELECT(select, GlobalProperties, &WrtDatabase::interface())
- return select->GetSingleValue<GlobalProperties::compliance_mode>();
- }
- Catch(DPL::DB::SqlConnection::Exception::Base){
- ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError,
- "Failed to get compliance mode");
- }
-}
-
-std::string GlobalDAOReadOnly::getComplianceFakeImei()
-{
- LogDebug("Getting compliance fake IMEI");
- Try {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- WRT_DB_SELECT(select, GlobalProperties, &WrtDatabase::interface())
- DPL::Optional<DPL::String> result =
- select->GetSingleValue<GlobalProperties::compliance_fake_imei>();
- if (!result) {
- return std::string();
- }
- return DPL::ToUTF8String(*result);
- }
- Catch(DPL::DB::SqlConnection::Exception::Base){
- ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError,
- "Failed to get compliance fake IMEI");
- }
-}
-
-std::string GlobalDAOReadOnly::getComplianceFakeMeid()
-{
- LogDebug("Getting compliance fake MEID");
- Try {
- using namespace DPL::DB::ORM;
- using namespace DPL::DB::ORM::wrt;
- WRT_DB_SELECT(select, GlobalProperties, &WrtDatabase::interface())
- DPL::Optional<DPL::String> result =
- select->GetSingleValue<GlobalProperties::compliance_fake_meid>();
- if (!result) {
- return std::string();
- }
- return DPL::ToUTF8String(*result);
- }
- Catch(DPL::DB::SqlConnection::Exception::Base){
- ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError,
- "Failed to get compliance fake MEID");
- }
-}
-
bool GlobalDAOReadOnly::IsValidSubTag(const DPL::String& tag, int type)
{
using namespace DPL::DB::ORM;
enum AppType
{
APP_TYPE_UNKNOWN = 0, // unknown
- APP_TYPE_WAC20, // WAC 2.0
APP_TYPE_TIZENWEBAPP // Tizen webapp
};
switch (appType) {
#define X(x) case x: return #x;
X(APP_TYPE_UNKNOWN)
- X(APP_TYPE_WAC20)
X(APP_TYPE_TIZENWEBAPP)
#undef X
default:
return "/usr/share/wrt-engine/schema.xsd";
}
-inline const char* GetWAC20TestRootCAFilePath()
-{
- return "/usr/share/wrt-engine/WAC2.0TestRootCA.cert";
-}
-
/**
* Name of the w3c geolocation feature
*/
return "/tmp";
}
-inline const char* GetWACVersion()
-{
- return "2.0";
-}
-
inline const char* GetTizenVersion()
{
return "2.2";
static bool GetSecureByDefault();
- static bool getComplianceMode();
-
- static std::string getComplianceFakeImei();
-
- static std::string getComplianceFakeMeid();
-
static WidgetAccessInfoList GetWhiteURIList();
static bool GetCookieSharingMode();
public:
static void SetSecureByDefault(bool secureByDefault);
- static void setComplianceMode(bool mode);
-
- static void setComplianceFakeImei(const std::string &imei);
-
- static void setComplianceFakeMeid(const std::string &meid);
-
static void AddWhiteURI(const std::string &value, bool subDomain);
static void RemoveWhiteURI(const std::string &uri);
COLUMN_NOT_NULL(secure_by_default, INT, DEFAULT 1)
COLUMN_NOT_NULL(home_network_data_usage, TINYINT, DEFAULT 1)
COLUMN_NOT_NULL(roaming_data_usage, TINYINT, DEFAULT 1)
- COLUMN_NOT_NULL(compliance_mode, TINYINT, DEFAULT 0)
- COLUMN_NOT_NULL(compliance_fake_imei, VARCHAR(256), DEFAULT '')
- COLUMN_NOT_NULL(compliance_fake_meid, VARCHAR(256), DEFAULT '')
COLUMN_NOT_NULL(cookie_sharing_mode, INT, DEFAULT 0)
CREATE_TABLE_END()