Support testmode privilege
authorJihoon Chung <jihoon.chung@samsung.com>
Fri, 10 May 2013 01:19:21 +0000 (10:19 +0900)
committerJihoon Chung <jihoon.chung@samsung.com>
Fri, 10 May 2013 04:50:40 +0000 (13:50 +0900)
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution] Support testmode privilege
For disable privacy checks pop-up, TCS should define test mode privilege
in the config.xml. (http://tizen.org/privilege/testautomation)
This commit convert privilege to device-capability to check ACE
[SCMRequest] N/A

Change-Id: I5d4f14e0aed6c5d065685ec1582c1ce8bf7ea120

src/misc/feature_logic.cpp

index 18b640b..6ae087e 100644 (file)
 
 namespace Jobs {
 namespace WidgetInstall {
+namespace {
+const DPL::String PRIVILEGE_TESTAUTOMATION =
+    L"http://tizen.org/privilege/testautomation";
+const DPL::String DEVICE_CAPABILITY_TESTAUTOMATION = L"testautomation";
+}
 FeatureLogic::FeatureLogic(const WrtDB::TizenAppId & tzAppid) :
     m_rejected(false)
 {
@@ -35,8 +40,16 @@ FeatureLogic::FeatureLogic(const WrtDB::TizenAppId & tzAppid) :
     WidgetFeatureSet featureSet = widgetDao.getFeaturesList();
     FOREACH(it, featureSet) {
         LogInfo("Feature name : " << it->name);
-        WrtDB::DeviceCapabilitySet dcs =
-            WrtDB::GlobalDAOReadOnly::GetDeviceCapability(it->name);
+        WrtDB::DeviceCapabilitySet dcs;
+        if (!DPL::StringCompare(it->name, PRIVILEGE_TESTAUTOMATION)) {
+            // special privilege
+            // This privilege doesn't have plugin in the target
+            // only use to special behavior
+            dcs.insert(DEVICE_CAPABILITY_TESTAUTOMATION);
+        } else {
+            // normal privilege
+            dcs = WrtDB::GlobalDAOReadOnly::GetDeviceCapability(it->name);
+        }
         FOREACH(devCap, dcs) {
             LogInfo("--- dev cap  : " << *devCap);
         }