#include <dpl/noncopyable.h>
#include <dpl/string.h>
#include <dpl/foreach.h>
-
-#include <dpl/wrt-dao-rw/widget_dao.h>
-#include <dpl/wrt-dao-rw/global_dao.h>
+#include <dpl/log/log.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <dpl/wrt-dao-ro/global_dao_read_only.h>
namespace Jobs {
namespace WidgetInstall {
-
-FeatureLogic::FeatureLogic(WidgetHandle handle)
- : m_rejected(false)
+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)
{
- WrtDB::WidgetDAO widgetDao(handle);
+ WrtDB::WidgetDAOReadOnly widgetDao(tzAppid);
WidgetFeatureSet featureSet = widgetDao.getFeaturesList();
FOREACH(it, featureSet) {
- WrtDB::DeviceCapabilitySet dcs =
- WrtDB::GlobalDAO::GetDeviceCapability(it->name);
+ LogInfo("Feature name : " << 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);
+ }
Feature feature(*it, dcs);
m_featureList.push_back(feature);
}
bool FeatureLogic::next()
{
while (!isDone()) {
- if (m_currentFeature->currentCap != m_currentFeature->devCapSet.end()) {
+ if (m_currentFeature->currentCap !=
+ m_currentFeature->devCapSet.end())
+ {
m_currentFeature->currentCap++;
} else {
++m_currentFeature;
return false;
}
-
void FeatureLogic::setAceResponse(bool allowed)
{
Assert(isProcessable() && "Wrong usage");
if (!allowed) {
m_currentFeature->rejected = true;
- if (m_currentFeature->required) {
- m_rejected = true;
- }
+ m_rejected = true;
}
}
return true;
}
-
} // namespace WidgetInstall
} // namespace Jobs