Clean-up GlobalDAO (SecureByDefault)
authorJihoon Chung <jihoon.chung@samsaung.com>
Thu, 17 Oct 2013 03:00:05 +0000 (12:00 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 21 Oct 2013 11:51:10 +0000 (11:51 +0000)
[Issue#]   LINUXWRT-1028
[Problem]  GlobalDAO has unnecessary API.
[Cause]    N/A
[Solution] Remove "SecureByDefault" API
           - "SecureByDefault" setting uses for WAC(SP-2067).
             As current Tizen WRT haven't consider supporting WAC, remove code regarding "SecureByDefault".
           - SP-2067 The WRT MUST provide a user-configurable 'secure-by-default' preference to enable installation of widgets
                     that are not distributor-signed, with the default value set to "No".
                     If the user selects "Yes",
                     they MUST be shown a warning explaining the potential dangers of installing unsigned widgets.
[Verification] Checking API usage
               - No usage
[SCMRequest] N/A

Change-Id: Ic444ef99d7c09b7d2d5159c7e95b4465dad00012

modules/widget_dao/dao/global_dao.cpp
modules/widget_dao/dao/global_dao_read_only.cpp
modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h
modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h
modules/widget_dao/orm/wrt_db

index d32ca71..ff82212 100644 (file)
 #include <dpl/wrt-dao-ro/WrtDatabase.h>
 
 namespace WrtDB {
-void GlobalDAO::SetSecureByDefault(bool secure)
-{
-    //If secure == true -> widget does not need to be signed
-    Try {
-        using namespace DPL::DB::ORM;
-        using namespace DPL::DB::ORM::wrt;
-        GlobalProperties::Row row;
-        row.Set_secure_by_default(secure);
-        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 secureByDefault");
-    }
-}
-
 void GlobalDAO::SetRoamingDataUsage(GlobalDAO::NetworkAccessMode newMode)
 {
     LogDebug("updating roaming network data usage to:" << newMode);
index 786e749..cb6c9fb 100644 (file)
 #include <dpl/wrt-dao-ro/common_dao_types.h>
 
 namespace WrtDB {
-
-bool GlobalDAOReadOnly::GetSecureByDefault()
-{
-    using namespace DPL::DB::ORM;
-    using namespace DPL::DB::ORM::wrt;
-    WRT_DB_SELECT(select, GlobalProperties, &WrtDatabase::interface())
-    return select->GetSingleValue<GlobalProperties::secure_by_default>();
-}
-
 GlobalDAOReadOnly::NetworkAccessMode GlobalDAOReadOnly::GetRoamingDataUsage()
 {
     LogDebug("Getting roaming network data usage");
index 246ee96..eee3870 100644 (file)
@@ -52,7 +52,6 @@ class GlobalDAOReadOnly
 
   public:
 
-    static bool GetSecureByDefault() DPL_DEPRECATED;
 
     static bool GetCookieSharingMode() DPL_DEPRECATED;
 
index ba5e0a1..fb0923e 100644 (file)
@@ -30,8 +30,6 @@ namespace WrtDB {
 class GlobalDAO : public GlobalDAOReadOnly
 {
   public:
-    static void SetSecureByDefault(bool secureByDefault) DPL_DEPRECATED;
-
     /**
      * This method changes network access mode while roaming is enabled.
      *
index 53a74d0..e76a48a 100644 (file)
@@ -2,9 +2,7 @@ SQL(
     PRAGMA foreign_keys = ON;
     BEGIN TRANSACTION;
 )
-/*TODO: secure_by_default should be 0 by default*/
 CREATE_TABLE(GlobalProperties)
-    COLUMN_NOT_NULL(secure_by_default,       INT,          DEFAULT 1)
     COLUMN_NOT_NULL(roaming_data_usage,      TINYINT,      DEFAULT 1)
     COLUMN_NOT_NULL(cookie_sharing_mode,          INT,          DEFAULT 0)
 CREATE_TABLE_END()