sync with private git ver.0.1.56
authorJunghwan Song <jump.song@samsung.com>
Wed, 5 Sep 2012 11:07:38 +0000 (20:07 +0900)
committerJunghwan Song <jump.song@samsung.com>
Wed, 5 Sep 2012 11:07:38 +0000 (20:07 +0900)
introspection/sms.xml
packaging/tel-plugin-dbus_tapi.spec
src/desc-dbus.c
src/sap.c
src/sat_manager.c
src/sat_ui_support/sat_ui_support.c
src/sim.c
src/sms.c

index ff4b81d..031ff4e 100644 (file)
                <!--
                        GetCbConfig:
                        @result: Success(0)
+                       @3gppType: Type of 3gpp, 0x01 . 3gpp. 0x02 . 3gpp2(CDMA)
                        @cbEnable: CB service state. If cb_enabled is true then cell broadcast service will be enabled 
-                       @slectedId: CBMI Identifier selected (all or some)
                        @msgIdMaxCount: CB Channel List Max Count
                        @msgIdCount: CB message ID count
                        @msgId: CB message ID information
                -->
                <method name="GetCbConfig">
                        <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="i" name="net3gppType"/>
                        <arg direction="out" type="i" name="cbEnable"/>
-                       <arg direction="out" type="i" name="slectedId"/>
                        <arg direction="out" type="i" name="msgIdMaxCount"/>
-                       <arg direction="out" type="i" name="msgIdCount"/>
-                       <arg direction="out" type="s" name="msgId"/>
+                       <arg direction="out" type="i" name="msgIdRangeCount"/>
+                       <arg direction="out" type="aa{sv}" name="msgId"/>
                </method>
 
                <!--
                        SetCbConfig:
+                       @3gppType: Type of 3gpp, 0x01 . 3gpp. 0x02 . 3gpp2(CDMA)
                        @cbEnable: CB service state. If cb_enabled is true then cell broadcast service will be enabled
-                       @slectedId: CBMI Identifier selected (all or some)
                        @msgIdMaxCount: CB Channel List Max Count
                        @msgIdCount: CB message ID count
                        @msgId: CB message ID information
                        Set SMS CB Message Identifiers in the appropriate EF-CBMI/EF-CBMIR file in (U)SIM.
                -->
                <method name="SetCbConfig">
+                       <arg direction="in" type="i" name="net3gppType"/>
                        <arg direction="in" type="i" name="cbEnable"/>
-                       <arg direction="in" type="i" name="slectedId"/>
                        <arg direction="in" type="i" name="msgIdMaxCount"/>
-                       <arg direction="in" type="i" name="msgIdCount"/>
+                       <arg direction="in" type="i" name="msgIdRangeCount"/>
                        <arg direction="in" type="s" name="msgId"/>
                        <arg direction="out" type="i" name="result"/>
                </method>
                </signal>
 
                <!--
+                       IncommingEtwsMsg:
+                        @cbMsgType: ETWS message type. PRIMARY, SECONDARY_GSM, SECONDARY_UMTS
+                        @msgLength: Size of the array which is actual TPDU message
+                        @tpdu: ETWS message data[Refer 3GPP TS 23.041 9.4.1
+
+                       This is an unsolicited Incoming cell broadcast message
+               -->
+               <signal name="IncommingEtwsMsg">
+                       <arg type="i" name="etwsMsgType"/>
+                       <arg type="i" name="msgLength"/>
+                       <arg type="s" name="tpdu"/>
+               </signal>
+
+               <!--
                        MemoryStatus:
                        @status: SIM memory status.
 
index 4260574..4ae570b 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
 %define minor 1
-%define patchlevel 49
+%define patchlevel 56
 Name: tel-plugin-dbus_tapi
 Summary: dbus-tapi plugin for telephony
 Version:    %{major}.%{minor}.%{patchlevel}
index fd7e6fd..1d7d911 100644 (file)
@@ -379,7 +379,7 @@ static void on_bus_acquired(GDBusConnection *conn, const gchar *name, gpointer u
        struct custom_data *ctx = user_data;
        TelephonyManager *mgr;
 
-       dbg("dbus registered");
+       info("dbus registered");
 
        ctx->manager = g_dbus_object_manager_server_new (MY_DBUS_PATH);
 
index 6df88bd..65911c0 100644 (file)
--- a/src/sap.c
+++ b/src/sap.c
 #include "generated-code.h"
 #include "common.h"
 
-#define g_variant_iter_free0( iter ) \
-       if ( iter ) \
-               g_variant_iter_free( iter );\
-       else \
-               dbg("iter : 0");
-
-
 static gboolean on_sap_connect(TelephonySap *sap, GDBusMethodInvocation *invocation,
                gint arg_req_max_size, gpointer user_data)
 {
@@ -140,7 +133,7 @@ static gboolean on_sap_transfer_apdu(TelephonySap *sap, GDBusMethodInvocation *i
                i++;
        }
        t_apdu.apdu_length = (unsigned int)i;
-       g_variant_iter_free0(iter);
+       g_variant_iter_free(iter);
        g_variant_unref(inner_gv);
        g_variant_unref(arg_req_apdu);
 
index 7dbf093..bcda369 100755 (executable)
 #define SAT_DEF_CMD_Q_MAX 10
 #define SAT_TIME_OUT 60000
 
-#define g_variant_iter_free0( iter ) \
-       if ( iter ) \
-               g_variant_iter_free( iter );\
-       else \
-               dbg("iter : 0");
-
-
 static unsigned int _get_time_in_ms(struct tel_sat_duration *dr)
 {
        switch (dr->time_unit) {
@@ -2920,7 +2913,7 @@ static gboolean sat_manager_handle_receive_data_result(struct custom_data *ctx,
                        tr->terminal_rsp_data.receive_data.channel_data.data_string[index] = data;
                        index++;
                }
-               g_variant_iter_free0(iter);
+               g_variant_iter_free(iter);
 
                dbg("the last index data(%d), data_total_len(%d)", index, data_str_len);
        }
@@ -3355,7 +3348,7 @@ static gboolean _sat_manager_handle_menu_select_confirm(struct custom_data *ctx,
                        item_id = data;
                        index++;
                }
-               g_variant_iter_free0(iter);
+               g_variant_iter_free(iter);
                g_variant_unref(inner_gv);
        }
 
@@ -3523,7 +3516,7 @@ static gboolean _sat_manager_handle_get_inkey_confirm(struct custom_data *ctx, T
                        inkey_data[index] = data;
                        index++;
                }
-               g_variant_iter_free0(iter);
+               g_variant_iter_free(iter);
                g_variant_unref(inner_gv);
                inkey_data_len = index;
        }
@@ -3679,7 +3672,7 @@ static gboolean _sat_manager_handle_get_input_confirm(struct custom_data *ctx, T
                        input_data[index] = data;
                        index++;
                }
-               g_variant_iter_free0(iter);
+               g_variant_iter_free(iter);
                g_variant_unref(inner_gv);
                input_data_len = index;
        }
@@ -3818,7 +3811,7 @@ static gboolean _sat_manager_handle_setup_call_confirm(struct custom_data *ctx,
                        input_data[index] = data;
                        index++;
                }
-               g_variant_iter_free0(iter);
+               g_variant_iter_free(iter);
                g_variant_unref(inner_gv);
                input_data_len = index;
        }
index 66a1be1..4dbd3a0 100644 (file)
 #include "TelSat.h"
 #include "sat_ui_support.h"
 
-#define g_variant_iter_free0( iter ) \
-       if ( iter ) \
-               g_variant_iter_free( iter );\
-       else \
-               dbg("iter : 0");
-
 static gboolean _sat_ui_support_processing_setup_menu_ind(GVariant *data)
 {
        gint rv;
@@ -54,7 +48,7 @@ static gboolean _sat_ui_support_processing_setup_menu_ind(GVariant *data)
                        memcpy(setup_menu.satMainMenuItem[index].itemString, item_str, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6);
                        index++;
                }
-               g_variant_iter_free0(iter);
+               g_variant_iter_free(iter);
        }
        setup_menu.bIsSatMainMenuHelpInfo = (b_helpinfo ? 1 : 0);
        setup_menu.bIsUpdatedSatMainMenu = (b_updated ? 1 : 0);
@@ -160,7 +154,7 @@ static gboolean _sat_ui_support_processing_select_item_ind(GVariant *data)
                        memcpy(select_item.menuItem[index].text, item_str, TAPI_SAT_ITEM_TEXT_LEN_MAX + 1);
                        index++;
                }
-               g_variant_iter_free0(iter);
+               g_variant_iter_free(iter);
        }
 
        cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_SELECT_ITEM);
index 6b0c7a5..54242e7 100644 (file)
--- a/src/sim.c
+++ b/src/sim.c
 #include "generated-code.h"
 #include "common.h"
 
-#define g_variant_iter_free0( iter ) \
-       if ( iter ) \
-               g_variant_iter_free( iter );\
-       else \
-               dbg("iter : 0");
 
 static gboolean dbus_sim_data_request(struct custom_data *ctx, enum tel_sim_status sim_status )
 {
@@ -696,7 +691,7 @@ static gboolean on_sim_transfer_apdu(TelephonySim *sim, GDBusMethodInvocation *i
                i++;
        }
        send_apdu.apdu_length = (unsigned int)i;
-       g_variant_iter_free0(iter);
+       g_variant_iter_free(iter);
        g_variant_unref(inner_gv);
        g_variant_unref(arg_apdu);
 
index dd85759..f447893 100644 (file)
--- a/src/sms.c
+++ b/src/sms.c
@@ -458,7 +458,7 @@ static gboolean
 on_sms_get_cb_config(TelephonySms *sms, GDBusMethodInvocation *invocation,
        gpointer user_data)
 {
-        struct treq_sms_get_cb_config getCbConfig;
+       struct treq_sms_get_cb_config getCbConfig;
        struct custom_data *ctx = user_data;
        UserRequest *ur = NULL;
 
@@ -478,27 +478,27 @@ on_sms_get_cb_config(TelephonySms *sms, GDBusMethodInvocation *invocation,
 
 static gboolean
 on_sms_set_cb_config(TelephonySms *sms, GDBusMethodInvocation *invocation,
+       gint arg_net3gppType,
        gboolean arg_cbEnable,
-       gint arg_slectedId,
        gint arg_msgIdMaxCount,
-       gint arg_msgIdCount,
+       gint arg_msgIdRangeCount,
        const gchar *arg_msgId,
        gpointer user_data)
 {
-        struct treq_sms_set_cb_config setCbConfig = {0,};
+    struct treq_sms_set_cb_config setCbConfig = {0,};
        struct custom_data *ctx = user_data;
        UserRequest *ur = NULL;
 
        gsize length;
        guchar *decoded_msgId = NULL;
 
-       setCbConfig.bCBEnabled = arg_cbEnable;
-       setCbConfig.selectedId = arg_slectedId;
+       setCbConfig.net3gppType = arg_net3gppType;
+       setCbConfig.cbEnabled = arg_cbEnable;
        setCbConfig.msgIdMaxCount = arg_msgIdMaxCount;
-       setCbConfig.msgIdCount = arg_msgIdCount;
+       setCbConfig.msgIdRangeCount = arg_msgIdRangeCount;
 
        decoded_msgId = g_base64_decode(arg_msgId, &length);
-       memcpy(&(setCbConfig.msgIDs[0]), decoded_msgId, SMS_GSM_SMS_CBMI_LIST_SIZE_MAX);
+       memcpy(&(setCbConfig.msgIDs[0]), decoded_msgId, SMS_GSM_SMS_CBMI_LIST_SIZE_MAX*5);
 
        ur = MAKE_UR(ctx, sms, invocation);
        tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_cb_config), &setCbConfig);
@@ -854,6 +854,7 @@ gboolean dbus_plugin_sms_response(struct custom_data *ctx, UserRequest *ur, stru
        CoreObject *co_sms;
        char *modem_name = NULL;
        TcorePlugin *p = NULL;
+       int i;
 
        modem_name = tcore_user_request_get_modem_name(ur);
        if (!modem_name)
@@ -1028,28 +1029,42 @@ gboolean dbus_plugin_sms_response(struct custom_data *ctx, UserRequest *ur, stru
 
                case TRESP_SMS_GET_CB_CONFIG: {
                        const struct tresp_sms_get_cb_config *resp = data;
-                       gchar *msgIDs = NULL;
+                       GVariant *result = NULL;
+                       GVariantBuilder b;
 
                        dbg("receive TRESP_SMS_GET_CB_CONFIG");
                        dbg("resp->result = 0x%x", resp->result);
 
-                       msgIDs = g_base64_encode((const guchar *)&(resp->cbConfig.msgIDs[0]), SMS_GSM_SMS_CBMI_LIST_SIZE_MAX);
-                       if (msgIDs == NULL) {
-                               dbg("g_base64_encode: Failed to Enocde cbConfig.msgIDs");
-                               msgIDs = "";
+                       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+
+                       for (i = 0; i < resp->cbConfig.msgIdRangeCount; i++) {
+                               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+
+                               if( resp->cbConfig.net3gppType == SMS_NETTYPE_3GPP ) {
+                                       g_variant_builder_add(&b, "{sv}", "FromMsgId", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp.fromMsgId));
+                                       g_variant_builder_add(&b, "{sv}", "ToMsgId", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp.toMsgId));
+                               } else if( resp->cbConfig.net3gppType == SMS_NETTYPE_3GPP2) {
+                                       g_variant_builder_add(&b, "{sv}", "CBCategory", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp2.cbCategory));
+                                       g_variant_builder_add(&b, "{sv}", "CBLanguage", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp2.cbLanguage));                            
+                               } else {
+                                       dbg("Unknown 3gpp type");
+                                       return FALSE;
+                               }
+                       
+                               g_variant_builder_add(&b, "{sv}", "Selected", g_variant_new_byte(resp->cbConfig.msgIDs[i].net3gpp.selected));
+                       
+                               g_variant_builder_close(&b);
                        }
                        
+                       result = g_variant_builder_end(&b);
+
                        telephony_sms_complete_get_cb_config(dbus_info->interface_object, dbus_info->invocation,
                                resp->result,
-                               resp->cbConfig.bCBEnabled,
-                               resp->cbConfig.selectedId,
+                               resp->cbConfig.net3gppType,
+                               resp->cbConfig.cbEnabled,
                                resp->cbConfig.msgIdMaxCount,
-                               resp->cbConfig.msgIdCount,
-                               msgIDs);
-
-                       if(msgIDs)
-                               g_free(msgIDs);
-
+                               resp->cbConfig.msgIdRangeCount,
+                               result);
                        }
                        break;
 
@@ -1283,6 +1298,26 @@ gboolean dbus_plugin_sms_notification(struct custom_data *ctx, const char *plugi
                        }
                        break;
 
+               case TNOTI_SMS_ETWS_INCOM_MSG: {
+                       const struct tnoti_sms_etws_msg *noti = data;
+                       gchar *msgData = NULL;
+                       
+                       msgData = g_base64_encode((const guchar *)&(noti->etwsMsg.msgData[0]), SMS_SMSP_ADDRESS_LEN);
+                       if (msgData == NULL) {
+                               dbg("g_base64_encode: Failed to Enocde etwsMsg.msgData");
+                               msgData = "";
+                       }
+
+                       telephony_sms_emit_incomming_etws_msg(sms,
+                               noti->etwsMsg.etwsMsgType,
+                               noti->etwsMsg.length,
+                               msgData);
+
+                       if(msgData)
+                               g_free(msgData);
+                       }
+                       break;
+
                case TNOTI_SMS_INCOM_EX_MSG: {
 #if 0
                        noti->cdmaMsg.ParamMask), SIPC_MARSHAL_DATA_INT_TYPE);