libsystemd-login
libtzplatform-config
capi-system-info
+ phonenumber-utils
)
FOREACH(flag ${common_pkgs_CFLAGS})
int _callmgr_util_is_recording_progress(gboolean *is_recording);
int _callmgr_util_is_video_recording_progress(gboolean *is_recording);
+int _callmgr_util_check_blocking_number(const char *number, gboolean *is_blocked);
int _callmgr_util_check_disturbing_setting(const char *number, gboolean *is_do_not_disturb);
gboolean _callmgr_util_check_access_control(cynara *p_cynara, GDBusMethodInvocation *invoc, const char *label, const char *perm);
return 0;
}
+/*
+ * Please consider to use _callmgr_util_check_blocking_number() instead of this function.
+ * Since tizen 4.0, phonenumber-utils provides this feature.
+ * http://mosaic.sec.samsung.net/club/club.menu.bbs.read.screen?p_club_id=1230&p_menu_id=62&p_group_id=58&message_id=6591434
+ */
int _callmgr_util_check_block_mode_num(const char *str_num, gboolean *is_blocked)
{
int result = 0;
#include <systemd/sd-login.h>
#include <tzplatform_config.h>
#include <system_info.h>
+#include <phone_number.h>
#include "callmgr-util.h"
#include "callmgr-log.h"
return 0;
}
+int _callmgr_util_check_blocking_number(const char *number, gboolean *is_blocked)
+{
+ int ret = 0;
+ phone_number_blocking_rule_h rule = NULL;
+
+ dbg("_callmgr_util_check_blocking_number");
+ if (!number || !is_blocked) {
+ err("Invalid parameter!!!");
+ return 0;
+ }
+
+ ret = phone_number_connect();
+ if (ret != PHONE_NUMBER_ERROR_NONE) {
+ err("phone_number_connect() failed!!! (%d,%s)", ret, get_error_message(ret));
+ return 0;
+ }
+
+ phone_number_check_blocking(number, is_blocked);
+ dbg("number[%s] is %s", number, *is_blocked ? "blocked" : "not blocked");
+
+ phone_number_disconnect();
+ return 0;
+}
+
int _callmgr_util_check_disturbing_setting(const char *number, gboolean *is_do_not_disturb)
{
notification_system_setting_h system_setting = NULL;
%define major 0
%define minor 2
-%define patchlevel 26
+%define patchlevel 27
%define ext_feature 0
Name: call-manager
BuildRequires: pkgconfig(cynara-session)
BuildRequires: pkgconfig(msg-service)
BuildRequires: pkgconfig(libsystemd)
+BuildRequires: pkgconfig(phonenumber-utils)
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
if (call) {
char *number = NULL;
_callmgr_telephony_get_call_number(call, &number);
- gboolean is_blocked_num = FALSE;
gboolean is_rec_blocked = FALSE;
gboolean is_bike_mode_enabled = FALSE;
gboolean is_low_battery = FALSE;
int call_cnt = -1;
gboolean is_do_not_disturb = FALSE;
+ gboolean is_blocked = FALSE;
_callmgr_telephony_get_call_type(call, &call_type);
__callmgr_core_convert_tel_call_type(call_type, &cm_call_type);
return;
}
- _callmgr_util_check_block_mode_num(number, &is_blocked_num);
+ _callmgr_util_check_blocking_number(number, &is_blocked);
_callmgr_vconf_is_recording_reject_enabled(&is_rec_blocked);
_callmgr_vconf_is_bike_mode_enabled(&is_bike_mode_enabled);
_callmgr_vconf_is_low_battery(&is_low_battery);
_callmgr_util_check_disturbing_setting(number, &is_do_not_disturb);
_callmgr_telephony_get_call_count(core_data->telephony_handle, &call_cnt);
- if ((is_blocked_num == TRUE)
+ if ((is_blocked == TRUE)
|| (is_rec_blocked == TRUE)
|| (is_do_not_disturb == TRUE)
|| ((is_bike_mode_enabled == TRUE) && (call_cnt > 1)) // if 2nd incoming call