partially sync with private git ver.0.1.55
authorJunghwan Song <jump.song@samsung.com>
Fri, 31 Aug 2012 11:52:31 +0000 (20:52 +0900)
committerJunghwan Song <jump.song@samsung.com>
Fri, 31 Aug 2012 11:52:31 +0000 (20:52 +0900)
packaging/tel-plugin-dbus_tapi.spec
src/call.c
src/desc-dbus.c
src/network.c
src/sat_manager.c

index 42614c33a0ed85d45f5a3cb952ead577a2fad960..a09b04c6939ba9b3c3a19e76bf6d6c1633dd6cb5 100644 (file)
@@ -1,6 +1,9 @@
+%define major 0
+%define minor 1
+%define patchlevel 49
 Name: tel-plugin-dbus_tapi
 Summary: dbus-tapi plugin for telephony
-Version:    0.1.49
+Version:    %{major}.%{minor}.%{patchlevel}
 Release:    1
 Group:      System/Libraries
 License:    Apache
@@ -26,7 +29,8 @@ dbus-tapi plugin for telephony
 %setup -q
 
 %build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+versionint=$[%{major} * 1000000 + %{minor} * 1000 + %{patchlevel}]
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DVERSION=$versionint
 make %{?jobs:-j%jobs}
 
 %post
index 4187dc7a6aeb99e3e45d56e8ec285d896037684b..b2bdbf800438ed48558b07bf62a876271762d21c 100644 (file)
@@ -9,6 +9,7 @@
 #include <gio/gio.h>
 
 #include <aul.h>
+#include <appsvc.h>
 #include <bundle.h>
 #include <tcore.h>
 #include <plugin.h>
@@ -32,7 +33,7 @@ static void _launch_voice_call( struct tnoti_call_status_incoming* incoming )
        char cna[2] = {0, };
        char number[83] = {0, };
        char name[83] = {0, };
-       int ret = 0;
+//     int ret = 0;
 
        bundle *kb  = 0;
 
@@ -57,6 +58,9 @@ static void _launch_voice_call( struct tnoti_call_status_incoming* incoming )
        dbg("name : [%s]", name );
 
        kb = bundle_create();
+
+#if 0
+       /* AUL */
        bundle_add(kb, "launch-type", "MT");
        bundle_add(kb, "handle", id);
        bundle_add(kb, "number", number);
@@ -67,9 +71,24 @@ static void _launch_voice_call( struct tnoti_call_status_incoming* incoming )
        bundle_add(kb, "activeline", active_line);
 
        ret = aul_launch_app("com.samsung.call", kb);
-       bundle_free(kb);
-
        dbg("aul_launch_app [ voice call ] : %d", ret );
+#else
+       /* AppSvc */
+       appsvc_set_operation(kb, APPSVC_OPERATION_CALL);
+       appsvc_set_uri(kb,"tel:MT");
+
+       appsvc_add_data(kb, "launch-type", "MT");
+       appsvc_add_data(kb, "handle", id);
+       appsvc_add_data(kb, "number", number);
+       appsvc_add_data(kb, "name_mode", cna);
+       appsvc_add_data(kb, "name", name);
+       appsvc_add_data(kb, "clicause", cli);
+       appsvc_add_data(kb, "fwded", forward);
+       appsvc_add_data(kb, "activeline", active_line);
+
+       appsvc_run_service(kb, 0, NULL, NULL);
+#endif
+       bundle_free(kb);
 }
 
 static void _launch_video_call( struct tnoti_call_status_incoming* incoming )
index 2dcb31adf25930bb179678410ba4bb1045d45957..1d7d9112050db28b1a78b7d69fc12a34a8256695 100644 (file)
 #include <co_sim.h>
 #include <co_ps.h>
 
+#ifndef PLUGIN_VERSION
+#define PLUGIN_VERSION 1
+#endif
+
 #include "generated-code.h"
 #include "common.h"
 
@@ -76,7 +80,6 @@ static void add_modem(struct custom_data *ctx, TcorePlugin *p)
                dbus_plugin_setup_call_interface(object, ctx);
        }
 
-
        co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_NETWORK);
        if (co_list) {
                g_slist_free(co_list);
@@ -376,6 +379,8 @@ static void on_bus_acquired(GDBusConnection *conn, const gchar *name, gpointer u
        struct custom_data *ctx = user_data;
        TelephonyManager *mgr;
 
+       info("dbus registered");
+
        ctx->manager = g_dbus_object_manager_server_new (MY_DBUS_PATH);
 
        refresh_object(ctx);
@@ -482,7 +487,7 @@ struct tcore_plugin_define_desc plugin_define_desc =
 {
        .name = "NEW_DBUS_COMMUNICATOR",
        .priority = TCORE_PLUGIN_PRIORITY_HIGH,
-       .version = 1,
+       .version = PLUGIN_VERSION,
        .load = on_load,
        .init = on_init,
        .unload = on_unload
index 8a4ef5f9463404ef411725db3b0f75de3e285ed6..8b0ee9b7eca3c7242ab0270a72d135e44203b7dd 100644 (file)
@@ -643,6 +643,7 @@ gboolean dbus_plugin_setup_network_interface(TelephonyObjectSkeleton *object, st
 gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
 {
        const struct tresp_network_search *resp_network_search = data;
+       const struct tresp_network_set_cancel_manual_search *resp_set_cancel_manual_search = data;
        const struct tresp_network_get_plmn_selection_mode *resp_get_plmn_selection_mode = data;
        const struct tresp_network_set_plmn_selection_mode *resp_set_plmn_selection_mode = data;
        const struct tresp_network_set_service_domain *resp_set_service_domain = data;
@@ -689,6 +690,9 @@ gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur,
                        GVariant *result = NULL;
                        GVariantBuilder b;
 
+                       dbg("receive TRESP_NETWORK_SEARCH");
+                       dbg("resp->result = %d", resp_network_search->result);
+
                        g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
                        for (i = 0; i < resp_network_search->list_count; i++) {
@@ -714,7 +718,7 @@ gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur,
 
                        result = g_variant_builder_end(&b);
 
-                       telephony_network_complete_search(dbus_info->interface_object, dbus_info->invocation, result, 0);
+                       telephony_network_complete_search(dbus_info->interface_object, dbus_info->invocation, result, resp_network_search->result);
                }
 
                        break;
@@ -731,15 +735,15 @@ gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur,
                        switch (resp_get_plmn_selection_mode->mode) {
                                case NETWORK_SELECT_MODE_GLOBAL_AUTOMATIC:
                                case NETWORK_SELECT_MODE_GSM_AUTOMATIC:
-                                       telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, 0, 0);
+                                       telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, 0, resp_get_plmn_selection_mode->result);
                                        break;
 
                                case NETWORK_SELECT_MODE_GSM_MANUAL:
-                                       telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, 1, 0);
+                                       telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, 1, resp_get_plmn_selection_mode->result);
                                        break;
 
                                default:
-                                       telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, -1, -1);
+                                       telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, -1, resp_get_plmn_selection_mode->result);
                                        break;
                        }
                        break;
@@ -753,7 +757,7 @@ gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur,
                case TRESP_NETWORK_GET_SERVICE_DOMAIN:
                        dbg("receive TRESP_NETWORK_GET_SERVICE_DOMAIN");
                        dbg("resp->domain = %d", resp_get_service_domain->domain);
-                       telephony_network_complete_get_service_domain(dbus_info->interface_object, dbus_info->invocation, resp_get_service_domain->domain, 0);
+                       telephony_network_complete_get_service_domain(dbus_info->interface_object, dbus_info->invocation, resp_get_service_domain->domain, resp_get_service_domain->result);
                        break;
 
                case TRESP_NETWORK_SET_BAND:
@@ -766,7 +770,7 @@ gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur,
                        dbg("receive TRESP_NETWORK_GET_BAND");
                        dbg("resp->mode = %d", resp_get_band->mode);
                        dbg("resp->band = %d", resp_get_band->band);
-                       telephony_network_complete_get_band(dbus_info->interface_object, dbus_info->invocation, resp_get_band->band, resp_get_band->mode, 0);
+                       telephony_network_complete_get_band(dbus_info->interface_object, dbus_info->invocation, resp_get_band->band, resp_get_band->mode, resp_get_band->result);
                        break;
 
                case TRESP_NETWORK_SET_MODE:
@@ -789,6 +793,7 @@ gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur,
 
                case TRESP_NETWORK_GET_PREFERRED_PLMN:
                        dbg("receive TRESP_NETWORK_GET_PREFERRED_PLMN");
+                       dbg("resp->result = %d", resp_get_preferred_plmn->result);
                        {
                                GVariant *result = NULL;
                                GVariantBuilder b;
@@ -817,13 +822,14 @@ gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur,
                                result = g_variant_builder_end(&b);
 
                                telephony_network_complete_get_preferred_plmn(dbus_info->interface_object, dbus_info->invocation,
-                                               result, 0);
+                                               result, resp_get_preferred_plmn->result);
                        }
                        break;
 
                case TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH:
                        dbg("receive TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH");
-                       telephony_network_complete_search_cancel(dbus_info->interface_object, dbus_info->invocation, 0);
+                       dbg("resp->result = %d", resp_set_cancel_manual_search->result);
+                       telephony_network_complete_search_cancel(dbus_info->interface_object, dbus_info->invocation, resp_set_cancel_manual_search->result);
                        break;
 
                case TRESP_NETWORK_GET_SERVING_NETWORK:
@@ -835,7 +841,7 @@ gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur,
                                        resp_get_serving_network->act,
                                        resp_get_serving_network->plmn,
                                        resp_get_serving_network->gsm.lac,
-                                       0);
+                                       resp_get_serving_network->result);
                        break;
 
                default:
index 8722dd5651992a294cb31d7b961517b322e9354c..7dbf093bf070bdc00f43f4b8f4ac75ea27f389e3 100755 (executable)
@@ -119,10 +119,20 @@ static gboolean _pop_nth_data(struct custom_data *ctx, struct sat_manager_queue_
 
 static gboolean _peek_nth_data(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj, int command_id)
 {
-       if (g_queue_is_empty(&ctx->queue_sat))
+       gpointer element = NULL;
+
+       if (g_queue_is_empty(&ctx->queue_sat)) {
+               dbg("[SAT] queue_sat is empty.")
+               return FALSE;
+       }
+
+       element = g_queue_peek_nth(&ctx->queue_sat, command_id);
+       if (element==NULL) {
+               dbg("[SAT] queue_sat has no element with command_id [%d].\n", command_id);
                return FALSE;
+       }
 
-       memcpy((void*)cmd_obj, g_queue_peek_nth(&ctx->queue_sat, command_id), sizeof(struct sat_manager_queue_data));
+       memcpy((void*)cmd_obj, element, sizeof(struct sat_manager_queue_data));
        return TRUE;
 }