};
CallHistory.prototype.find = function() {
+ xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.CALLHISTORY_READ);
+
var args = validator_.validateArgs(arguments, [
{
name : 'successCallback',
};
CallHistory.prototype.remove = function() {
+ xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.CALLHISTORY_WRITE);
+
var args = validator_.validateArgs(arguments, [
{
name : 'entry',
};
CallHistory.prototype.removeBatch = function() {
+ xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.CALLHISTORY_WRITE);
+
var args = validator_.validateArgs(arguments, [
{
name : 'entries',
};
CallHistory.prototype.removeAll = function() {
+ xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.CALLHISTORY_WRITE);
+
var args = validator_.validateArgs(arguments, [
{
name : 'successCallback',
};
CallHistory.prototype.addChangeListener = function() {
+ xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.CALLHISTORY_READ);
+
var args = validator_.validateArgs(arguments, [
{
name : 'eventCallback',
};
CallHistory.prototype.removeChangeListener = function() {
+ xwalk.utils.checkPrivilegeAccess(xwalk.utils.privilege.CALLHISTORY_READ);
+
var args = validator_.validateArgs(arguments, [
{
name : 'watchId',
namespace extension {
namespace callhistory {
-namespace {
-// The privileges that required in CallHistory API
-const std::string kPrivilegeCallHistoryRead = "http://tizen.org/privilege/callhistory.read";
-const std::string kPrivilegeCallHistoryWrite = "http://tizen.org/privilege/callhistory.write";
-}
-
using namespace common;
CallHistoryInstance::CallHistoryInstance() : history_(*this) {
void CallHistoryInstance::Find(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeCallHistoryRead, &out);
history_.find(args.get<picojson::object>());
ReportSuccess(out);
}
void CallHistoryInstance::Remove(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeCallHistoryWrite, &out);
PlatformResult result = history_.remove(args.get<picojson::object>());
if (result.IsSuccess()) {
ReportSuccess(out);
void CallHistoryInstance::RemoveBatch(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeCallHistoryWrite, &out);
PlatformResult result = history_.removeBatch(args.get<picojson::object>());
if (result.IsSuccess()) {
ReportSuccess(out);
void CallHistoryInstance::RemoveAll(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeCallHistoryWrite, &out);
history_.removeAll(args.get<picojson::object>());
ReportSuccess(out);
}
void CallHistoryInstance::AddChangeListener(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeCallHistoryRead, &out);
PlatformResult result = history_.startCallHistoryChangeListener();
if (result.IsSuccess()) {
ReportSuccess(out);
void CallHistoryInstance::RemoveChangeListener(const picojson::value& args, picojson::object& out) {
LoggerD("Entered");
- CHECK_PRIVILEGE_ACCESS(kPrivilegeCallHistoryRead, &out);
PlatformResult result = history_.stopCallHistoryChangeListener();
if (result.IsSuccess()) {
ReportSuccess(out);