Add method for GetPsismsc 45/195945/1 accepted/tizen/unified/20181227.062101 submit/tizen/20181227.011059
authorsinikang <sinikang@samsung.com>
Thu, 20 Dec 2018 02:07:02 +0000 (11:07 +0900)
committersinikang <sinikang@samsung.com>
Thu, 20 Dec 2018 02:07:02 +0000 (11:07 +0900)
Change-Id: Ide37ffe6d284038f1c0ba2a4c396944b9cee2d04

introspection/sim.xml
packaging/tel-plugin-dbus_tapi.spec
src/dtapi_sim.c

index db0b2f7..3fdc215 100644 (file)
                -->
                </method>
 
+               <method name="GetPsismsc">
+                       <arg direction="out" type="i" name="result"/>
+                       <arg direction="out" type="s" name="url"/>
+               <!-- dict
+                    "plmn" STRING
+                    "b_umts" BOOLEAN TRUE/FALSE
+                    "b_gsm" BOOLEAN TRUE/FALSE
+               -->
+               </method>
+
                <method name="GetSpn">
                        <arg direction="out" type="i" name="result"/>
                        <arg direction="out" type="y" name="display_condition"/>
index 980b208..382f609 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
-%define minor 3
-%define patchlevel 99
+%define minor 4
+%define patchlevel 00
 
 Name:           tel-plugin-dbus_tapi
 Version:        %{major}.%{minor}.%{patchlevel}
index 5bcdead..6ef8194 100644 (file)
@@ -127,24 +127,25 @@ enum dbus_tapi_sim_gdbus_method_name {
        GET_OPLMWACT,
        GET_SPN,
        GET_CPHS_NET_NAME,
+       GET_PSISMSC,
 
        /* Misc */
-       AUTHENTICATION = 20,
+       AUTHENTICATION = 21,
        VERIFY_SEC,
        VERIFY_PUK,
        CHANGE_PIN,
        DISABLE_FACILITY,
-       ENABLE_FACILITY = 25,
+       ENABLE_FACILITY = 26,
        GET_FACILITY,
        GET_LOCK_INFO,
        TRANSFER_APDU,
        GET_ATR,
-       GET_FIELDS = 30, /* for get various data at once */
+       GET_FIELDS = 31, /* for get various data at once */
        GET_GID,
        SET_POWERSTATE,
        GET_IMPI,
        GET_IMPU,
-       GET_DOMAIN = 35,
+       GET_DOMAIN = 36,
        GET_PCSCF,
        GET_APP_LIST,
        GET_ISIM_SERVICE_TABLE,
@@ -259,6 +260,7 @@ static gboolean __check_sim_state(enum dbus_tapi_sim_gdbus_method_name method,
        case GET_SVCT:
        case GET_MSISDN:
        case GET_OPLMWACT:
+       case GET_PSISMSC:
        case GET_CPHS_NET_NAME:
        case GET_CALL_FORWARDING:
        case SET_CALL_FORWARDING:
@@ -1063,6 +1065,24 @@ static gboolean on_sim_get_oplmnwact(TelephonySim *sim,
        return TRUE;
 }
 
+static gboolean on_sim_get_psismsc(TelephonySim *sim,
+       GDBusMethodInvocation *invocation, gpointer user_data)
+{
+       struct custom_data *ctx = user_data;
+       CoreObject *co_sim = NULL;
+
+       DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+       DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_PSISMSC, co_sim);
+       DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get PSISMSC");
+
+       /* Dispatch request */
+       dtapi_dispatch_request(ctx, sim, invocation,
+               TREQ_SIM_GET_PSISMSC,
+               NULL, 0);
+
+       return TRUE;
+}
+
 static gboolean on_sim_get_spn(TelephonySim *sim,
        GDBusMethodInvocation *invocation, gpointer user_data)
 {
@@ -2005,6 +2025,10 @@ gboolean dbus_plugin_setup_sim_interface(TelephonyObjectSkeleton *object,
                G_CALLBACK(on_sim_get_oplmnwact), ctx);
 
        g_signal_connect(sim,
+               "handle-get-psismsc",
+               G_CALLBACK(on_sim_get_psismsc), ctx);
+
+       g_signal_connect(sim,
                "handle-get-spn",
                G_CALLBACK(on_sim_get_spn), ctx);
 
@@ -2675,6 +2699,32 @@ gboolean dbus_plugin_sim_response(struct custom_data *ctx,
        }
        break;
 
+       case TRESP_SIM_GET_PSISMSC:{
+               const struct tresp_sim_read *resp_read = data;
+               CoreObject *co_sim = NULL;
+
+               dbg("[%s] SIM_GET_PSISMSC - Result: [%s], URIDATA[%s]", cpname,
+                       (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
+                       (resp_read->data.psismsc.uridata != NULL ? resp_read->data.psismsc.uridata : "NULL"));
+
+               co_sim = __get_sim_co_from_ur(ctx->server, ur);
+               if (!co_sim) {
+                       err("SIM Core object is NULL");
+                       return FALSE;
+               }
+
+               /* Added check to send empty string in case request is successful and value is NULL. To be checked and updated if need be */
+               if (resp_read->result == SIM_ACCESS_SUCCESS && !resp_read->data.psismsc.uridata) {
+                       telephony_sim_complete_get_psismsc(dbus_info->interface_object,
+                               dbus_info->invocation, resp_read->result, "");
+               }
+               else {
+                       telephony_sim_complete_get_psismsc(dbus_info->interface_object,
+                               dbus_info->invocation, resp_read->result, (const gchar *)resp_read->data.psismsc.uridata);
+               }
+       }
+       break;
+
        case TRESP_SIM_REQ_AUTHENTICATION: {
                const struct tresp_sim_req_authentication *resp_auth = data;
                GVariantBuilder builder;