*/
typedef struct telephony_call_info_s *telephony_call_h;
-/**
- * @deprecated Deprecated Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. Use #telephony_call_status_e instead.
- *
- * @brief Enumeration for the call state.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-typedef enum {
- TELEPHONY_CALL_STATE_IDLE, /**< There exists no calls. */
- TELEPHONY_CALL_STATE_CONNECTING, /**< There exists at least one call that is dialing, alerting or incoming */
- TELEPHONY_CALL_STATE_CONNECTED, /**< There exist active or held calls, and no calls are dialing, alerting or incoming */
-} telephony_call_state_e;
/**
* @brief Enumeration for the call status.
TELEPHONY_CALL_DIRECTION_MT, /**< MT(Mobile Terminated) call */
} telephony_call_direction_e;
-/**
- * @deprecated Deprecated Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. Use #telephony_call_get_status instead.
- *
- * @brief Gets the voice call state of the telephony service.
- * @details Determines if the voice call is connecting, connected, or idle.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @privlevel public
- * @privilege %http://tizen.org/privilege/telephony
- *
- * @remarks When you are dialing a number or a new voice call is ringing,
- * the state of the voice call is #TELEPHONY_CALL_STATE_CONNECTING.
- * When a new voice call is connecting while another voice call is already connected,
- * the state of the voice call is #TELEPHONY_CALL_STATE_CONNECTING as well.
- *
- * @param[in] handle The handle from telephony_init()
- * @param[out] call_state The current state of the voice call
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- *
- * @retval #TELEPHONY_ERROR_NONE Successful
- * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
- * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
- * @retval #TELEPHONY_ERROR_OPERATION_FAILED Operation failed
- */
-int telephony_call_get_voice_call_state(telephony_h handle, telephony_call_state_e *call_state) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. Use #telephony_call_get_status instead.
- *
- * @brief Gets the video call state of the telephony service.
- * @details Determines if the video call is connecting, connected, or idle.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- * @privlevel public
- * @privilege %http://tizen.org/privilege/telephony
- *
- * @remarks When you are dialing a number or a new video call is ringing,
- * the state of the video call is #TELEPHONY_CALL_STATE_CONNECTING.
- * If a video call is connected, then the state of any other call cannot be
- * #TELEPHONY_CALL_STATE_CONNECTING and #TELEPHONY_CALL_STATE_CONNECTED.
- *
- * @param[in] handle The handle from telephony_init()
- * @param[out] call_state The current state of the video call
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- *
- * @retval #TELEPHONY_ERROR_NONE Successful
- * @retval #TELEPHONY_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #TELEPHONY_ERROR_PERMISSION_DENIED Permission denied
- * @retval #TELEPHONY_ERROR_NOT_SUPPORTED Not supported
- * @retval #TELEPHONY_ERROR_OPERATION_FAILED Operation failed
- */
-int telephony_call_get_video_call_state(telephony_h handle, telephony_call_state_e *call_state) TIZEN_DEPRECATED_API;
/**
* @brief Gets the current value for the preferred voice call subscription.
TELEPHONY_NOTI_NETWORK_BS_LONGITUDE, /**< Notification to be invoked when the base station longitude changes. @n
'bs_longitue(int)' will be delivered in notification data (@b Since: 3.0) @n
Privilege : http://tizen.org/privilege/location.coarse */
-
- TELEPHONY_NOTI_VOICE_CALL_STATE = 0x30, /**< Notification to be invoked when the voice call state changes. @n
- '#telephony_call_state_e' will be delivered in notification data (Deprecated Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. Use TELEPHONY_NOTI_VOICE_CALL_STATUS_XXX instead.) @n
- Privilege : http://tizen.org/privilege/telephony */
- TELEPHONY_NOTI_VIDEO_CALL_STATE, /**< Notification to be invoked when the video call state changes. @n
- '#telephony_call_state_e' will be delivered in notification data (Deprecated Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. Use TELEPHONY_NOTI_VIDEO_CALL_STATUS_XXX instead.) @n
- Privilege : http://tizen.org/privilege/telephony */
- TELEPHONY_NOTI_VOICE_CALL_STATUS_IDLE, /**< Notification to be invoked when a voice call is in idle status. @n
+ TELEPHONY_NOTI_VOICE_CALL_STATUS_IDLE = 0x32, /**< Notification to be invoked when a voice call is in idle status. @n
'handle_id(unsigned int)' will be delivered in notification data (@b Since: @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) @n
Privilege : http://tizen.org/privilege/telephony */
TELEPHONY_NOTI_VOICE_CALL_STATUS_ACTIVE, /**< Notification to be invoked when a voice call is in active status. @n
Name: capi-telephony
Summary: Telephony Core API
-Version: 0.1.79
+Version: 0.1.80
Release: 1
Group: System/Libraries
License: Apache-2.0
#include "telephony_private.h"
/* LCOV_EXCL_START */
-static void _mapping_call_state(TelCallStates_t tapi_call_state, telephony_call_state_e *call_state)
-{
- switch (tapi_call_state) {
- case TAPI_CALL_STATE_ACTIVE:
- case TAPI_CALL_STATE_HELD:
- if (*call_state != TELEPHONY_CALL_STATE_CONNECTING)
- *call_state = TELEPHONY_CALL_STATE_CONNECTED;
- break;
- case TAPI_CALL_STATE_DIALING:
- case TAPI_CALL_STATE_ALERT:
- case TAPI_CALL_STATE_INCOMING:
- case TAPI_CALL_STATE_WAITING:
- *call_state = TELEPHONY_CALL_STATE_CONNECTING;
- break;
- /* Do not check IDLE state to prevent overriding in case of multi-party call */
- default:
- LOGE("Not handled call state: [%d]", tapi_call_state);
- break;
- }
-}
-
static void _mapping_call_status(TelCallStates_t tapi_call_state,
telephony_call_status_e *status)
{
}
}
-static void _voice_call_get_state_cb(TelCallStatus_t *tapi_status, void *user_data)
-{
- telephony_call_state_e *call_state = user_data;
-
- if (tapi_status->CallType != TAPI_CALL_TYPE_VOICE
- && tapi_status->CallType != TAPI_CALL_TYPE_E911)
- return;
-
- _mapping_call_state(tapi_status->CallState, call_state);
-}
-
-static void _video_call_get_state_cb(TelCallStatus_t *tapi_status, void *user_data)
-{
- telephony_call_state_e *call_state = user_data;
-
- if (tapi_status->CallType != TAPI_CALL_TYPE_DATA)
- return;
-
- _mapping_call_state(tapi_status->CallState, call_state);
-}
-
static void _get_call_status_cb(TelCallStatus_t *status, void *user_data)
{
GSList **list = user_data;
}
/* LCOV_EXCL_STOP */
-int telephony_call_get_voice_call_state(telephony_h handle, telephony_call_state_e *call_state)
-{
- int ret;
- TapiHandle *tapi_h;
-
- LOGW("DEPRECATION WARNING: telephony_call_get_voice_call_state() is deprecated and will be removed from next release. Use telephony_call_get_status() instead.");
- CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
- CHECK_INPUT_PARAMETER(handle);
- tapi_h = ((telephony_data *)handle)->tapi_h;
- CHECK_INPUT_PARAMETER(tapi_h);
- CHECK_INPUT_PARAMETER(call_state);
-
- *call_state = TELEPHONY_CALL_STATE_IDLE;
-
- ret = tel_get_call_status_all(tapi_h, _voice_call_get_state_cb, call_state);
- /* LCOV_EXCL_START */
- if (ret == TAPI_API_ACCESS_DENIED) {
- LOGE("PERMISSION_DENIED");
- return TELEPHONY_ERROR_PERMISSION_DENIED;
- } else if (ret != TAPI_API_SUCCESS) {
- LOGE("OPERATION_FAILED");
- return TELEPHONY_ERROR_OPERATION_FAILED;
- }
- /* LCOV_EXCL_STOP */
-
- LOGI("call_state: [%d]", *call_state);
-
- return TELEPHONY_ERROR_NONE;
-}
-
-int telephony_call_get_video_call_state(telephony_h handle, telephony_call_state_e *call_state)
-{
- int ret;
- TapiHandle *tapi_h;
-
- LOGW("DEPRECATION WARNING: telephony_call_get_video_call_state() is deprecated and will be removed from next release. Use telephony_call_get_status() instead.");
- CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
- CHECK_INPUT_PARAMETER(handle);
- tapi_h = ((telephony_data *)handle)->tapi_h;
- CHECK_INPUT_PARAMETER(tapi_h);
- CHECK_INPUT_PARAMETER(call_state);
-
- *call_state = TELEPHONY_CALL_STATE_IDLE;
-
- ret = tel_get_call_status_all(tapi_h, _video_call_get_state_cb, call_state);
- /* LCOV_EXCL_START */
- if (ret == TAPI_API_ACCESS_DENIED) {
- LOGE("PERMISSION_DENIED");
- return TELEPHONY_ERROR_PERMISSION_DENIED;
- } else if (ret != TAPI_API_SUCCESS) {
- LOGE("OPERATION_FAILED");
- return TELEPHONY_ERROR_OPERATION_FAILED;
- }
- /* LCOV_EXCL_STOP */
-
- LOGI("call_state: [%d]", *call_state);
-
- return TELEPHONY_ERROR_NONE;
-}
-
int telephony_call_get_preferred_voice_subscription(telephony_h handle, telephony_call_preferred_voice_subs_e *call_sub)
{
int ret;
evt_cb_data->noti_id, data, evt_cb_data->user_data); \
}
-/* Handle deprecated noti_id for backward compatibility */
-#define CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data) \
- if (evt_cb_data->noti_id == TELEPHONY_NOTI_VOICE_CALL_STATE) { \
- telephony_call_state_e call_state; \
- telephony_call_get_voice_call_state(evt_cb_data->handle, &call_state); \
- CALLBACK_CALL(&call_state); \
- return; \
- } else if (evt_cb_data->noti_id == TELEPHONY_NOTI_VIDEO_CALL_STATE) { \
- telephony_call_state_e call_state; \
- telephony_call_get_video_call_state(evt_cb_data->handle, &call_state); \
- CALLBACK_CALL(&call_state); \
- return; \
- }
-
typedef struct {
telephony_h handle;
telephony_noti_e noti_id;
void *user_data;
} telephony_evt_cb_data;
-static const char *voice_call_state_tbl[] = {
- TAPI_NOTI_VOICE_CALL_STATUS_IDLE,
- TAPI_NOTI_VOICE_CALL_STATUS_ACTIVE,
- TAPI_NOTI_VOICE_CALL_STATUS_HELD,
- TAPI_NOTI_VOICE_CALL_STATUS_DIALING,
- TAPI_NOTI_VOICE_CALL_STATUS_ALERT,
- TAPI_NOTI_VOICE_CALL_STATUS_INCOMING
-};
-
-static const char *video_call_state_tbl[] = {
- TAPI_NOTI_VIDEO_CALL_STATUS_IDLE,
- TAPI_NOTI_VIDEO_CALL_STATUS_ACTIVE,
- TAPI_NOTI_VIDEO_CALL_STATUS_DIALING,
- TAPI_NOTI_VIDEO_CALL_STATUS_ALERT,
- TAPI_NOTI_VIDEO_CALL_STATUS_INCOMING
-};
-
static const char *_mapping_noti_id(telephony_noti_e noti_id)
{
switch (noti_id) {
static telephony_error_e __deregister_all_noti(telephony_h handle, telephony_noti_e noti_id)
{
const char *tapi_noti;
- int ret, i;
+ int ret;
TapiHandle *tapi_h;
CHECK_INPUT_PARAMETER(handle);
tapi_h = ((telephony_data *)handle)->tapi_h;
tapi_noti = _mapping_noti_id(noti_id);
- if (tapi_noti == NULL && noti_id != TELEPHONY_NOTI_VOICE_CALL_STATE
- && noti_id != TELEPHONY_NOTI_VIDEO_CALL_STATE) {
+ if (tapi_noti == NULL) {
LOGE("Not supported noti_id");
return TELEPHONY_ERROR_INVALID_PARAMETER;
}
- /* Deregister all TAPI_NOTI_VOICE/VIDEO_CALL_STATUS_xxx notification */
- if (noti_id == TELEPHONY_NOTI_VOICE_CALL_STATE) {
- int count = sizeof(voice_call_state_tbl) / sizeof(char *);
- for (i = 0; i < count; i++) {
- ret = tel_deregister_noti_event(tapi_h, voice_call_state_tbl[i]);
- if (ret != TAPI_API_SUCCESS)
- LOGE("Noti [%s] deregistration failed", voice_call_state_tbl[i]);
- }
- } else if (noti_id == TELEPHONY_NOTI_VIDEO_CALL_STATE) {
- int count = sizeof(video_call_state_tbl) / sizeof(char *);
- for (i = 0; i < count; i++) {
- ret = tel_deregister_noti_event(tapi_h, video_call_state_tbl[i]);
- if (ret != TAPI_API_SUCCESS)
- LOGE("Noti [%s] deregistration failed", video_call_state_tbl[i]);
- }
- } else {
- /* Deregister other notifications */
- ret = tel_deregister_noti_event(tapi_h, tapi_noti);
- if (ret != TAPI_API_SUCCESS)
- LOGE("Noti [%s] deregistration failed", tapi_noti);
- }
+ /* Deregister notifications */
+ ret = tel_deregister_noti_event(tapi_h, tapi_noti);
+ if (ret != TAPI_API_SUCCESS)
+ LOGE("Noti [%s] deregistration failed", tapi_noti);
return TELEPHONY_ERROR_NONE;
}
|| !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_IDLE)) {
TelCallStatusIdleNoti_t *noti = data;
unsigned int handle_id = noti->id;
- CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
CALLBACK_CALL(&handle_id);
} else if (!g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_ACTIVE)
|| !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_ACTIVE)) {
TelCallStatusActiveNoti_t *noti = data;
unsigned int handle_id = noti->id;
- CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
CALLBACK_CALL(&handle_id);
} else if (!g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_HELD)) {
TelCallStatusHeldNoti_t *noti = data;
unsigned int handle_id = noti->id;
- CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
CALLBACK_CALL(&handle_id);
} else if (!g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_DIALING)
|| !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_DIALING)) {
TelCallStatusDialingNoti_t *noti = data;
unsigned int handle_id = noti->id;
- CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
CALLBACK_CALL(&handle_id);
} else if (!g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_ALERT)
|| !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_ALERT)) {
TelCallStatusAlertNoti_t *noti = data;
unsigned int handle_id = noti->id;
- CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
CALLBACK_CALL(&handle_id);
} else if (!g_strcmp0(evt_id, TAPI_NOTI_VOICE_CALL_STATUS_INCOMING)
|| !g_strcmp0(evt_id, TAPI_NOTI_VIDEO_CALL_STATUS_INCOMING)) {
TelCallIncomingCallInfo_t *noti = data;
unsigned int handle_id = noti->CallHandle;
- CALLBACK_CALL_FOR_DEPRECATED_NOTI(evt_cb_data);
CALLBACK_CALL(&handle_id);
} else if (!g_strcmp0(evt_id, TAPI_NOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION)) {
int call_pref_voice_sub = *(int *)data;
{
telephony_evt_cb_data *evt_cb_data = NULL;
const char *tapi_noti;
- int ret, i;
+ int ret;
TapiHandle *tapi_h;
CHECK_TELEPHONY_SUPPORTED(TELEPHONY_FEATURE);
/* Mapping TAPI notification */
tapi_noti = _mapping_noti_id(noti_id);
- if (tapi_noti == NULL && noti_id != TELEPHONY_NOTI_VOICE_CALL_STATE
- && noti_id != TELEPHONY_NOTI_VIDEO_CALL_STATE) {
+ if (tapi_noti == NULL) {
LOGE("Not supported noti_id");
return TELEPHONY_ERROR_INVALID_PARAMETER;
}
evt_cb_data->cb = cb;
evt_cb_data->user_data = user_data;
- /*
- * In case of register Call State notification,
- * we should take care of all TAPI_NOTI_VOICE/VIDEO_CALL_STATUS_xxx notification
- */
- if (noti_id == TELEPHONY_NOTI_VOICE_CALL_STATE) {
- int count = sizeof(voice_call_state_tbl) / sizeof(char *);
- for (i = 0; i < count; i++) {
- ret = tel_register_noti_event(tapi_h, voice_call_state_tbl[i], on_signal_callback, evt_cb_data);
- if (ret != TAPI_API_SUCCESS) {
- LOGE("Noti registration failed");
- g_free(evt_cb_data);
- return TELEPHONY_ERROR_OPERATION_FAILED;
- }
- }
- } else if (noti_id == TELEPHONY_NOTI_VIDEO_CALL_STATE) {
- int count = sizeof(video_call_state_tbl) / sizeof(char *);
- for (i = 0; i < count; i++) {
- ret = tel_register_noti_event(tapi_h, video_call_state_tbl[i], on_signal_callback, evt_cb_data);
- if (ret != TAPI_API_SUCCESS) {
- LOGE("Noti registration failed");
- g_free(evt_cb_data);
- return TELEPHONY_ERROR_OPERATION_FAILED;
- }
- }
- } else { /* Register other notifications */
- ret = tel_register_noti_event(tapi_h, tapi_noti, on_signal_callback, evt_cb_data);
- if (ret != TAPI_API_SUCCESS) {
- LOGE("Noti registration failed");
- g_free(evt_cb_data);
- return TELEPHONY_ERROR_OPERATION_FAILED;
- }
+ /* Register notifications */
+ ret = tel_register_noti_event(tapi_h, tapi_noti, on_signal_callback, evt_cb_data);
+ if (ret != TAPI_API_SUCCESS) {
+ LOGE("Noti registration failed");
+ g_free(evt_cb_data);
+ return TELEPHONY_ERROR_OPERATION_FAILED;
}
/* Append evt_cb_data to free */