bbf4dbd4319031f5f3c85e63f6a2a63ea4a7fdd0
[platform/core/telephony/tel-plugin-imc.git] / packaging / 0010-s_sim-Extend-XSIMSTATE-parsing-to-get-SMS-service-st.patch
1 From 0ab2df1acdc37d1ada019d0e4c1ccb81913637ef Mon Sep 17 00:00:00 2001
2 From: Philippe Nunes <philippe.nunes@linux.intel.com>
3 Date: Wed, 26 Sep 2012 17:30:40 +0200
4 Subject: [PATCH 10/23] s_sim: Extend XSIMSTATE parsing to get SMS service
5  state
6 Content-Type: text/plain; charset="utf-8"
7 Content-Transfer-Encoding: 8bit
8
9 ---
10  src/s_sim.c |   18 ++++++++++++++++++
11  1 file changed, 18 insertions(+)
12
13 diff --git a/src/s_sim.c b/src/s_sim.c
14 index 1d7e5c6..7bff6dd 100644
15 --- a/src/s_sim.c
16 +++ b/src/s_sim.c
17 @@ -28,12 +28,14 @@
18  #include <plugin.h>
19  #include <queue.h>
20  #include <co_sim.h>
21 +#include <co_sms.h>
22  #include <storage.h>
23  #include <user_request.h>
24  #include <server.h>
25  #include <at.h>
26  
27  #include "s_common.h"
28 +#include "s_sms.h"
29  #include "s_sim.h"
30  
31  #define ID_RESERVED_AT 0x0229
32 @@ -1932,6 +1934,7 @@ static gboolean on_event_pin_status(CoreObject *o, const void *event_info, void
33         GSList *lines = NULL;
34         const char *line = NULL;
35         int sim_state = 0;
36 +       int sms_state = 0;
37  
38         dbg(" Function entry ");
39  
40 @@ -1948,6 +1951,7 @@ static gboolean on_event_pin_status(CoreObject *o, const void *event_info, void
41  
42         if (g_slist_length(tokens) == 4) {
43                 sim_state = atoi(g_slist_nth_data(tokens, 1));
44 +               sms_state = atoi(g_slist_nth_data(tokens, 3));
45         } else if (g_slist_length(tokens) == 1)
46                 sim_state = atoi(g_slist_nth_data(tokens, 0));
47         else {
48 @@ -2023,6 +2027,20 @@ static gboolean on_event_pin_status(CoreObject *o, const void *event_info, void
49                         _get_sim_type(o);
50                 else
51                         _sim_status_update(o, sim_status);
52 +
53 +               if (sms_state) {
54 +                       struct tnoti_sms_ready_status readyStatusInfo = {0, };
55 +                       CoreObject *sms;
56 +                       TcorePlugin *plugin;
57 +
58 +                       dbg("SMS Ready");
59 +                       readyStatusInfo.status = TRUE;
60 +                       plugin = tcore_object_ref_plugin(o);
61 +                       sms = tcore_plugin_ref_core_object(plugin, "umts_sms");
62 +                       tcore_sms_set_ready_status(sms, readyStatusInfo.status);
63 +
64 +                       tcore_server_send_notification(tcore_plugin_ref_server(plugin), sms, TNOTI_SMS_DEVICE_READY, sizeof(struct tnoti_sms_ready_status), &readyStatusInfo);
65 +               }
66                 break;
67  
68         case SIM_STATUS_INITIALIZING:
69 -- 
70 1.7.10.4
71