Removed deprecated 2.3 APIs 97/175597/2 accepted/tizen/5.0/unified/20181102.014622 accepted/tizen/unified/20180503.080748 submit/tizen/20180502.100559 submit/tizen/20180503.021159 submit/tizen_5.0/20181101.000002
authorsinikang <sinikang@samsung.com>
Wed, 11 Apr 2018 02:25:00 +0000 (11:25 +0900)
committersinikang <sinikang@samsung.com>
Wed, 11 Apr 2018 08:17:17 +0000 (17:17 +0900)
Change-Id: I10cebc39202ee6433de38802dffa22f96ab95315

include/telephony_call.h
include/telephony_common.h
packaging/capi-telephony.spec
src/telephony_call.c
src/telephony_common.c

index f94d14d755019d433aad158369acd4c6566e73d0..e8bb93d1a1571611a42018cb615ba2f739f963ac 100644 (file)
@@ -39,17 +39,6 @@ extern "C" {
  */
 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.
@@ -95,63 +84,6 @@ typedef enum {
        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.
index 61c06b8f912b8973ba295792d9a1eac30d4a6130..bab58288aee30ba38f14f924cf486c25a7691a1e 100644 (file)
@@ -127,14 +127,7 @@ typedef enum  {
        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
index 150e4125d6e61d5680fda1484de8fe9b935608df..a8044eca824388cd420f71d6353bfc4a44c017e3 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-telephony
 Summary:    Telephony Core API
-Version:    0.1.79
+Version:    0.1.80
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 6144abfced5519c94bfc00c6f37856d7d540b827..7aa2b177431be1665bcf9e270a28dc76e7b15332 100644 (file)
 #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)
 {
@@ -78,27 +57,6 @@ static void _mapping_call_status(TelCallStates_t tapi_call_state,
        }
 }
 
-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;
@@ -130,66 +88,6 @@ static void _get_call_status_cb(TelCallStatus_t *status, void *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;
index 1a3a41922a657caa7eb0cdb5cb36ca8421489e7d..5bb3d7335e5a4d197a39bd67b5763376b790e79b 100644 (file)
                         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;
@@ -56,23 +42,6 @@ typedef struct {
        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) {
@@ -200,40 +169,22 @@ static int _mapping_service_state(int tapi_service_type)
 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;
 }
@@ -320,36 +271,30 @@ static void on_signal_callback(TapiHandle *tapi_h, const char *evt_id,
                        || !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;
@@ -368,7 +313,7 @@ int telephony_set_noti_cb(telephony_h handle,
 {
        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);
@@ -379,8 +324,7 @@ int telephony_set_noti_cb(telephony_h handle,
 
        /* 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;
        }
@@ -392,37 +336,12 @@ int telephony_set_noti_cb(telephony_h handle,
        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 */