Change SIM module APIs 35/57735/2
authorWootak Jung <wootak.jung@samsung.com>
Fri, 22 Jan 2016 06:55:09 +0000 (15:55 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Mon, 25 Jan 2016 00:32:03 +0000 (09:32 +0900)
- Remove some sim lock states
- Change API naming & document

Change-Id: Iad7873a16e781275b7efc02c6ba59ad5343390f4

include/telephony_common.h
include/telephony_sim.h
packaging/capi-telephony.spec
src/telephony_common.c
src/telephony_sim.c
test/test_all_api.c

index 12455cdd4fee8e35906717ce9e63f1cc43305a9c..fd32382da9c15d7dee58b70b16bda3a9ab39b424 100644 (file)
@@ -75,7 +75,7 @@ typedef enum {
  */
 typedef enum  {
     TELEPHONY_NOTI_SIM_STATUS = 0x10,            /**< Notification to be invoked when the SIM card state changes, '#telephony_sim_state_e' will be delivered in notification data */
-    TELEPHONY_NOTI_SIM_CALL_FORWARDING_STATE, /**< Notification to be invoked when the SIM call forwarding state changes, 'call_forwarding_state(bool)' will be delivered in notification data (@b Since: 3.0) */
+    TELEPHONY_NOTI_SIM_CALL_FORWARDING_INDICATOR_STATE, /**< Notification to be invoked when the SIM call forwarding indicator state changes, 'state(bool)' will be delivered in notification data (@b Since: 3.0) */
 
     TELEPHONY_NOTI_NETWORK_SERVICE_STATE = 0x20, /**< Notification to be invoked when the network service state changes, '#telephony_network_service_state_e' will be delivered in notification data */
     TELEPHONY_NOTI_NETWORK_CELLID,               /**< Notification to be invoked when the cell ID changes, 'cell_id(int)' will be delivered in notification data */
index 398f3db8ce7881d6a0b985387ac12e523b073c4f..9befb65c9144e78901ea4d2f11472a8ab81d74ac 100644 (file)
@@ -53,11 +53,7 @@ typedef enum {
        TELEPHONY_SIM_LOCK_STATE_PIN_REQUIRED, /**< SIM is PIN(Personal Identification Number) locked */
        TELEPHONY_SIM_LOCK_STATE_PUK_REQUIRED, /**< SIM is PUK(Personal Unblocking Code) locked */
        TELEPHONY_SIM_LOCK_STATE_PERM_LOCKED, /**< SIM is permanently blocked(All the attempts for PIN/PUK failed) */
-       TELEPHONY_SIM_LOCK_STATE_NCK_REQUIRED, /**< SIM is NCK(Network Control Key) locked */
-       TELEPHONY_SIM_LOCK_STATE_NSCK_REQUIRED, /**< SIM is NSCK(Network Subset Control Key) locked */
-       TELEPHONY_SIM_LOCK_STATE_SPCK_REQUIRED, /**< SIM is SPCK(Service Provider Control Key) locked */
-       TELEPHONY_SIM_LOCK_STATE_CCK_REQUIRED, /**< SIM is CCK(Corporate Control Key) locked */
-       TELEPHONY_SIM_LOCK_STATE_PHONE_REQUIRED /**< SIM is PH-SIM(Phone-SIM) locked */
+       TELEPHONY_SIM_LOCK_STATE_NCK_REQUIRED /**< SIM is NCK(Network Control Key) locked */
 } telephony_sim_lock_state_e;
 
 /**
@@ -374,16 +370,18 @@ int telephony_sim_get_lock_state(telephony_h handle, telephony_sim_lock_state_e
 int telephony_sim_get_group_id1(telephony_h handle, char **gid1);
 
 /**
- * @brief Gets the call fowarding state of the SIM.
+ * @brief Gets the call fowarding indicator state of the SIM.
  * @details If the state is true, incoming call will be forwarded to selected number.
+ *          @c state indicates the CFU (Call Forwarding Unconditional) indicator status - Voice.
+ *          (3GPP TS 31.102 4.2.64 EF CFIS)
  *
  * @since_tizen 3.0
  * @privlevel public
  * @privilege %http://tizen.org/privilege/telephony
  *
  * @param[in] handle The handle from telephony_init()
- * @param[out] call_forwarding_state The value whether incoming call will be forwarded or not.
- *                                   (true: forwarded, false: not forwarded)
+ * @param[out] state The value whether incoming call will be forwarded or not.
+ *                   (true: forwarded, false: not forwarded)
  *
  * @return @c 0 on success,
  *         otherwise a negative error value
@@ -398,7 +396,7 @@ int telephony_sim_get_group_id1(telephony_h handle, char **gid1);
  *
  * @see telephony_sim_get_state()
  */
-int telephony_sim_get_call_forwarding_state(telephony_h handle, bool *call_forwarding_state);
+int telephony_sim_get_call_forwarding_indicator_state(telephony_h handle, bool *state);
 
 /**
  * @}
index 187ea77f6a650ef5146f3c3dfa69084285387cce..ded72a3630de36df4a681eb04ceb49a56613acda 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-telephony
 Summary:    Telephony Core API
-Version:    0.1.55
+Version:    0.1.56
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 8073a26672377223979361a7105ad17c37536376..30a3cea2bd23d12a6b817bf753ab7fb83edfec6d 100644 (file)
@@ -77,7 +77,7 @@ static const char *_mapping_noti_id(telephony_noti_e noti_id)
        switch (noti_id) {
        case TELEPHONY_NOTI_SIM_STATUS:
                return TAPI_NOTI_SIM_STATUS;
-       case TELEPHONY_NOTI_SIM_CALL_FORWARDING_STATE:
+       case TELEPHONY_NOTI_SIM_CALL_FORWARDING_INDICATOR_STATE:
                return TAPI_PROP_SIM_CALL_FORWARD_STATE;
        case TELEPHONY_NOTI_NETWORK_SERVICE_STATE:
                return TAPI_PROP_NETWORK_SERVICE_TYPE;
@@ -250,8 +250,8 @@ static void on_signal_callback(TapiHandle *tapi_h, const char *evt_id,
                int sim_status = _mapping_sim_status(*(TelSimCardStatus_t *)data);
                CALLBACK_CALL(&sim_status);
        } else if (!g_strcmp0(evt_id, TAPI_PROP_SIM_CALL_FORWARD_STATE)) {
-               bool call_forwarding_state = *(bool *)data;
-               CALLBACK_CALL(&call_forwarding_state);
+               bool state = *(bool *)data;
+               CALLBACK_CALL(&state);
        } else if (!g_strcmp0(evt_id, TAPI_PROP_NETWORK_SERVICE_TYPE)) {
                int service_state = _mapping_service_state(*(int *)data);
                CALLBACK_CALL(&service_state);
index e312dc2c639cd17643b6394c6385738c337d10c1..df9ce18c30d3b7f7e93a50c3028a441879e481fd 100644 (file)
@@ -490,18 +490,6 @@ int telephony_sim_get_lock_state(telephony_h handle, telephony_sim_lock_state_e
        case TAPI_SIM_STATUS_SIM_NCK_REQUIRED:
                *lock_state = TELEPHONY_SIM_LOCK_STATE_NCK_REQUIRED;
                break;
-       case TAPI_SIM_STATUS_SIM_NSCK_REQUIRED:
-               *lock_state = TELEPHONY_SIM_LOCK_STATE_NSCK_REQUIRED;
-               break;
-       case TAPI_SIM_STATUS_SIM_SPCK_REQUIRED:
-               *lock_state = TELEPHONY_SIM_LOCK_STATE_SPCK_REQUIRED;
-               break;
-       case TAPI_SIM_STATUS_SIM_CCK_REQUIRED:
-               *lock_state = TELEPHONY_SIM_LOCK_STATE_CCK_REQUIRED;
-               break;
-       case TAPI_SIM_STATUS_SIM_LOCK_REQUIRED:
-               *lock_state = TELEPHONY_SIM_LOCK_STATE_PHONE_REQUIRED;
-               break;
        default:
                *lock_state = TELEPHONY_SIM_LOCK_STATE_UNKNOWN;
                break;
@@ -571,7 +559,7 @@ int telephony_sim_get_group_id1(telephony_h handle, char **gid1)
        return error_code;
 }
 
-int telephony_sim_get_call_forwarding_state(telephony_h handle, bool *call_forwarding_state)
+int telephony_sim_get_call_forwarding_indicator_state(telephony_h handle, bool *state)
 {
        int error_code;
        TapiHandle *tapi_h;
@@ -581,12 +569,12 @@ int telephony_sim_get_call_forwarding_state(telephony_h handle, bool *call_forwa
        CHECK_INPUT_PARAMETER(handle);
        tapi_h = ((telephony_data *)handle)->tapi_h;
        CHECK_INPUT_PARAMETER(tapi_h);
-       CHECK_INPUT_PARAMETER(call_forwarding_state);
+       CHECK_INPUT_PARAMETER(state);
 
        error_code = tel_get_property_int(tapi_h, TAPI_PROP_SIM_CALL_FORWARD_STATE, &tel_state);
        if (error_code == TAPI_API_SUCCESS) {
-               *call_forwarding_state = (bool)tel_state;
-               LOGI("call_forwarding_state: [%s]", *call_forwarding_state ? "ON" : "OFF");
+               *state = (bool)tel_state;
+               LOGI("Call forwarding indicator state: [%s]", *state ? "ON" : "OFF");
                error_code = TELEPHONY_ERROR_NONE;
        } else if (error_code == TAPI_API_ACCESS_DENIED) {
                LOGE("PERMISSION_DENIED");
index 070d98ee3329d32bf69ffc9936c28139ba038dfd..2b6c2ae45b80a5cfeb309d900072f5964b1c5706 100644 (file)
@@ -31,7 +31,7 @@ static telephony_handle_list_s handle_list;
 
 static int sim_noti_tbl[] = {
        TELEPHONY_NOTI_SIM_STATUS,
-       TELEPHONY_NOTI_SIM_CALL_FORWARDING_STATE
+       TELEPHONY_NOTI_SIM_CALL_FORWARDING_INDICATOR_STATE
 };
 
 static int network_noti_tbl[] = {
@@ -71,7 +71,16 @@ static const char *_mapping_sim_state(telephony_sim_state_e sim_state)
 
 static void sim_noti_cb(telephony_h handle, telephony_noti_e noti_id, void *data, void *user_data)
 {
-       LOGI("Noti!! SIM status: [%d]", *(int *)data);
+       switch (noti_id) {
+       case TELEPHONY_NOTI_SIM_STATUS:
+               LOGI("Noti!! SIM status: [%d]", *(int *)data);
+               break;
+       case TELEPHONY_NOTI_SIM_CALL_FORWARDING_INDICATOR_STATE:
+               LOGI("Noti!! SIM Call forwarding indicator state: [%s]", *(bool *)data ? "ON" : "OFF");
+               break;
+       default:
+               break;
+       }
 }
 
 static const char *_mapping_service_state(telephony_network_service_state_e service_state)
@@ -326,7 +335,7 @@ int main()
        bool is_changed = FALSE;
        telephony_sim_lock_state_e lock_state = 0;
        char *gid1 = NULL;
-       bool call_forwarding_state = FALSE;
+       bool cf_state = FALSE;
 
        /* Network value */
        int cell_id = 0;
@@ -457,11 +466,11 @@ int main()
                free(gid1);
        }
 
-       ret_value = telephony_sim_get_call_forwarding_state(handle_list.handle[0], &call_forwarding_state);
+       ret_value = telephony_sim_get_call_forwarding_indicator_state(handle_list.handle[0], &cf_state);
        if (ret_value != TELEPHONY_ERROR_NONE) {
-               LOGE("telephony_sim_get_call_forwarding_state() failed!!! [%d]", ret_value);
+               LOGE("telephony_sim_get_call_forwarding_indicator_state() failed!!! [%d]", ret_value);
        } else {
-               LOGI("Call forwarding state is [%s]", call_forwarding_state ? "ON" : "OFF");
+               LOGI("Call forwarding indicator state is [%s]", cf_state ? "ON" : "OFF");
        }
 
        /* Network API */