device_policy_manager_h handle = dpm_manager_create();
if (handle) {
res = dpm_application_install_package(handle, package_path_name.c_str());
+ LOG_D(TAG, "dpm_application_install_package returned %d", res);
dpm_manager_destroy(handle);
}
return res;
#include <dpm/application.h>
#include <dpm/security.h>
#include <dpm/firewall.h>
+#include <dpm/tv.h>
#include "logging.h"
#include "samonitor_tag.h"
typedef function<int(dpmh, int, const char*)> ApiIntStr;
const map<const string, ApiNone> m = {
- {"lockout-screen", dpm_security_lockout_screen},
+ {"lockout-screen", dpm_security_lockout_screen},
};
const map<const string, ApiInt> mi = {
- {"sound", dpm_restriction_set_sound_state},
+ {"sound", dpm_tv_set_sound_state},
{"bluetooth", dpm_restriction_set_bluetooth_mode_change_state},
{"wifi", dpm_restriction_set_wifi_state},
{"usb", dpm_restriction_set_usb_client_state},
- {"dtv-tunner", dpm_restriction_set_tuner_state},
+ {"dtv-tunner", dpm_tv_set_tuner_state},
{"camera", dpm_restriction_set_camera_state},
{"microphone", dpm_restriction_set_microphone_state},
};
-#ifdef USE_MIS
-const map<const string, ApiIntStr> mis;
-#endif
-
-
-// {"wipe external data", dpm_security_wipe_data},
-// {"wipe internal data", dpm_security_wipe_data},
-// {"messaging", dpm_restriction_set_messaging_state},
-// {"privil-add", dpm_application_add_privilege_to_blacklist},
-// {"privil-del", dpm_application_remove_privilege_from_blacklist},
-// {"package-set", dpm_application_set_mode_restriction},
-// {"package-unset", dpm_application_unset_mode_restriction},
-
Mapper::Mapper() : handle(nullptr)
{
}
uid_t owner;
try {
-#ifndef __MOCK_THIRDPARTY__
owner = getUidByName("owner");
-#else
- owner = root;
-#endif
} catch (std::runtime_error& e) {
LOG_E(TAG, "getUidByName(): %s", e.what());
return NO_DATA;
return convert_err(res);
}
-#ifdef USE_MIS
- auto itis = mis.find(name);
- if (itis != mis.end()) {
- for (auto& item : items) {
- res = itis->second((dpmh)handle, param, item.c_str());
- if (res != DPM_ERROR_NONE) {
- break;
- }
- }
- return convert_err(res);
- }
-#endif
-
return NAME_NOT_FOUND;
}
url=http://10.103.211.119/220svr/releases/adv-tizen-4.0-product-migration/KantM_ATSC/latest/repos/product/armv7l/packages/
[repo.base_Main2017_KantM_4.0]
url=http://10.103.211.119/220svr/base/adv-tizen-4.0-base-migration/standard/latest/repos/base/armv7l/packages
-[repo.KantM_4.0_srk]
-url = http://52.71.167.178:8803/repo/kantm4.0/packages/
+[repo.KantM_4.0_2018_srk]
+url = http://52.71.167.178:8803/repo/kantm4.0_2018/packages/
[profile.kantm_tizen4]
obs = obs.tizen_org
-repos = repo.base_Main2017_KantM_4.0, repo.KantM_4.0_srk, repo.product_Main2017_KantM_4.0
+repos = repo.base_Main2017_KantM_4.0, repo.KantM_4.0_2018_srk, repo.product_Main2017_KantM_4.0
buildroot = ~/gbs_root_kantm_tizen4
############################################# Profile [profile.kantm2_tizen5]
MOCK_METHOD1(dpm_restriction_set_usb_client_state, int(int allow));
MOCK_METHOD1(dpm_restriction_get_usb_client_state, int(int* is_allowed));
- MOCK_METHOD1(dpm_restriction_set_sound_state, int(int allow));
- MOCK_METHOD1(dpm_restriction_get_sound_state, int(int* is_allowed));
- MOCK_METHOD1(dpm_restriction_set_tuner_state, int(int allow));
- MOCK_METHOD1(dpm_restriction_get_tuner_state, int(int* is_allowed));
+ MOCK_METHOD1(dpm_tv_set_sound_state, int(int allow));
+ MOCK_METHOD1(dpm_tv_get_sound_state, int(int* is_allowed));
+ MOCK_METHOD1(dpm_tv_set_tuner_state, int(int allow));
+ MOCK_METHOD1(dpm_tv_get_tuner_state, int(int* is_allowed));
};
#endif // DEVICEPOLICYMANAGERMOCK_H
#include <dpm/restriction.h>
#include <dpm/security.h>
#include <dpm/wifi.h>
+#include <dpm/tv.h>
#include "device_policy_manager_stub.h"
assert(handle != nullptr);
return reinterpret_cast<DPMInterface*>(handle)->dpm_restriction_get_usb_client_state(is_allowed);
}
-int dpm_restriction_set_sound_state(device_policy_manager_h handle, int allow)
+int dpm_tv_set_sound_state(device_policy_manager_h handle, int allow)
{
assert(handle != nullptr);
- return reinterpret_cast<DPMInterface*>(handle)->dpm_restriction_set_sound_state(allow);
+ return reinterpret_cast<DPMInterface*>(handle)->dpm_tv_set_sound_state(allow);
}
-int dpm_restriction_get_sound_state(device_policy_manager_h handle, int* is_allowed)
+int dpm_tv_get_sound_state(device_policy_manager_h handle, int* is_allowed)
{
assert(handle != nullptr);
- return reinterpret_cast<DPMInterface*>(handle)->dpm_restriction_get_sound_state(is_allowed);
+ return reinterpret_cast<DPMInterface*>(handle)->dpm_tv_get_sound_state(is_allowed);
}
-int dpm_restriction_set_tuner_state(device_policy_manager_h handle, int allow)
+int dpm_tv_set_tuner_state(device_policy_manager_h handle, int allow)
{
assert(handle != nullptr);
- return reinterpret_cast<DPMInterface*>(handle)->dpm_restriction_set_tuner_state(allow);
+ return reinterpret_cast<DPMInterface*>(handle)->dpm_tv_set_tuner_state(allow);
}
-int dpm_restriction_get_tuner_state(device_policy_manager_h handle, int* is_allowed)
+int dpm_tv_get_tuner_state(device_policy_manager_h handle, int* is_allowed)
{
assert(handle != nullptr);
- return reinterpret_cast<DPMInterface*>(handle)->dpm_restriction_get_tuner_state(is_allowed);
+ return reinterpret_cast<DPMInterface*>(handle)->dpm_tv_get_tuner_state(is_allowed);
}
virtual int dpm_restriction_set_usb_client_state(int allow) = 0;
virtual int dpm_restriction_get_usb_client_state(int* is_allowed) = 0;
- virtual int dpm_restriction_set_sound_state(int allow) = 0;
- virtual int dpm_restriction_get_sound_state(int* is_allowed) = 0;
- virtual int dpm_restriction_set_tuner_state(int allow) = 0;
- virtual int dpm_restriction_get_tuner_state(int* is_allowed) = 0;
+ virtual int dpm_tv_set_sound_state(int allow) = 0;
+ virtual int dpm_tv_get_sound_state(int* is_allowed) = 0;
+ virtual int dpm_tv_set_tuner_state(int allow) = 0;
+ virtual int dpm_tv_get_tuner_state(int* is_allowed) = 0;
};
/**
{
return 0;
}
- int dpm_restriction_set_sound_state(int allow) override
+ int dpm_tv_set_sound_state(int allow) override
{
return 0;
}
- int dpm_restriction_get_sound_state(int* is_allowed) override
+ int dpm_tv_get_sound_state(int* is_allowed) override
{
return 0;
}
- int dpm_restriction_set_tuner_state(int allow) override
+ int dpm_tv_set_tuner_state(int allow) override
{
return 0;
}
- int dpm_restriction_get_tuner_state(int* is_allowed) override
+ int dpm_tv_get_tuner_state(int* is_allowed) override
{
return 0;
}
EXPECT_CALL(dpm, dpm_manager_create()).WillOnce(Return(&dpm));
- EXPECT_CALL(dpm, dpm_restriction_set_sound_state(1)).WillOnce(Return(0));
+ EXPECT_CALL(dpm, dpm_tv_set_sound_state(1)).WillOnce(Return(0));
EXPECT_CALL(dpm, dpm_restriction_set_camera_state(0)).WillOnce(Return(0));
EXPECT_CALL(dpm, dpm_manager_destroy()).Times(1);
EXPECT_CALL(dpm, dpm_manager_create()).WillOnce(Return(&dpm));
- EXPECT_CALL(dpm, dpm_restriction_set_sound_state(1)).WillOnce(Return(0));
+ EXPECT_CALL(dpm, dpm_tv_set_sound_state(1)).WillOnce(Return(0));
EXPECT_CALL(dpm, dpm_restriction_set_bluetooth_mode_change_state(1)).WillOnce(Return(0));
EXPECT_CALL(dpm, dpm_restriction_set_wifi_state(0)).WillOnce(Return(0));
EXPECT_CALL(dpm, dpm_restriction_set_usb_client_state(0)).WillOnce(Return(0));
- EXPECT_CALL(dpm, dpm_restriction_set_tuner_state(1)).WillOnce(Return(0));
+ EXPECT_CALL(dpm, dpm_tv_set_tuner_state(1)).WillOnce(Return(0));
EXPECT_CALL(dpm, dpm_manager_destroy()).Times(1);
EXPECT_CALL(dpm, dpm_firewall_flush_deny_rules()).WillOnce(Return(0));
EXPECT_CALL(dpm, dpm_firewall_apply_deny_rules(_)).Times(3).WillRepeatedly(Return(0));