Code Cleanup for increasing SAM score 29/237629/1 accepted/tizen/unified/20200707.141013 submit/tizen/20200703.071903
authorsinikang <sinikang@samsung.com>
Thu, 2 Jul 2020 04:14:40 +0000 (13:14 +0900)
committersinikang <sinikang@samsung.com>
Thu, 2 Jul 2020 04:14:40 +0000 (13:14 +0900)
Change-Id: Ic9e85561de6fd83fa7abdb3f38a453f674cb59b0
Signed-off-by: sinikang <sinikang@samsung.com>
packaging/tel-plugin-packetservice.spec
src/ps_master.c
src/ps_modem.c
src/ps_tcore-interface.c

index 3bd7966..16f02d8 100644 (file)
@@ -4,7 +4,7 @@
 
 %define major 0
 %define minor 4
-%define patchlevel 31
+%define patchlevel 32
 
 Name:           tel-plugin-packetservice
 Version:        %{major}.%{minor}.%{patchlevel}
index c062bc6..e750390 100644 (file)
@@ -372,6 +372,12 @@ ps_master_t *_ps_master_create_master(GDBusConnection *conn, TcorePlugin *p)
        tcore_server_add_notification_hook(tcore_plugin_ref_server(p),
                                           TNOTI_SERVER_REMOVED_MODEM_PLUGIN, __on_hook_modem_removed, new_master);
 
+#ifdef TIZEN_SUPPORT_VOLTE
+       /*Adding Hook for SIM Refreshed laters*/
+       tcore_server_add_notification_hook(tcore_plugin_ref_server(p),
+                                          TNOTI_SIM_REFRESHED, __on_hook_sim_refresh, new_master);
+#endif
+
        info("Successfully created the master");
        return new_master;
 }
index 9efd01f..2f32afc 100644 (file)
@@ -542,9 +542,9 @@ gboolean _ps_modem_processing_sim_complete(ps_modem_t *modem, gboolean complete,
        return TRUE;
 }
 
+#ifdef TIZEN_SUPPORT_VOLTE
 gboolean _ps_modem_processing_sim_refresh(ps_modem_t *modem)
 {
-#ifdef TIZEN_SUPPORT_VOLTE
        GHashTableIter iter;
        gpointer key, value;
        unsigned int index;
@@ -584,10 +584,10 @@ gboolean _ps_modem_processing_sim_refresh(ps_modem_t *modem)
                }
        }
  EXIT:
-#endif
        ps_dbg_ex_modem(modem, "Exiting");
        return TRUE;
 }
+#endif
 
 gboolean _ps_modem_set_attach_apn(ps_modem_t *modem)
 {
index 2fbb921..2aa198e 100644 (file)
@@ -434,83 +434,6 @@ static enum tcore_hook_return __on_hook_call_status(Server *s, CoreObject *sourc
        return TCORE_HOOK_RETURN_CONTINUE;
 }
 
-#if 0 // TODO: libtcore need to be updated
-static enum tcore_hook_return __on_hook_gprs_backoff_timer(Server *s, CoreObject *source,
-                                                          enum tcore_notification_command command, unsigned int data_len, void *data,
-                                                          void *user_data)
-{
-       ps_service_t *service = user_data;
-       CoreObject *co_context = NULL;
-       CoreObject *co_ps = NULL;
-       struct tnoti_ps_backoff_timer *backoff = data;
-       unsigned int retryArray[] = { 0, };
-
-       g_return_val_if_fail(service != NULL, TCORE_HOOK_RETURN_STOP_PROPAGATION);
-
-       co_ps = _ps_service_ref_co_ps(service);
-       if (co_ps != source)
-               return TCORE_HOOK_RETURN_CONTINUE;
-
-       ps_dbg_ex_svc(service, "cid(%d) apn(%s) result(%d) retry_time(%d)", backoff->context_id, backoff->apn, backoff->result, backoff->retry_time);
-       if (!strlen(backoff->apn)) {
-               ps_warn_ex_svc(service, "Invalid APN");
-               return TCORE_HOOK_RETURN_CONTINUE;
-       }
-
-       co_context = tcore_ps_ref_context_by_apn(co_ps, backoff->apn);
-       if (!co_context) {
-               ps_warn_ex_svc(service, "Couldn't find matched context from apn(%s)", backoff->apn);
-               return TCORE_HOOK_RETURN_CONTINUE;
-       }
-
-       if (backoff->retry_time != 0xFFFFFFFF && backoff->retry_time > 0) {
-               if (backoff->retry_time > 72 * 60 * 60)
-                       backoff->retry_time = 72 * 60 * 60;
-
-               ps_info_ex_svc(service, "retry_time(%d) was set", backoff->retry_time);
-               retryArray[0] = backoff->retry_time;
-               tcore_context_set_max_retry_count(co_context, 1);
-               tcore_context_set_retry_timer_array(co_context, retryArray, 1);
-       }
-
-       if (backoff->result == PS_PDP_REJ_TIMER_T3396_DEACTIVATED) {
-               ps_info_ex_svc(service, "T3396_DEACTIVATED, PDN.apn(%s)", backoff->apn);
-               tcore_context_set_throttled_apn(co_context, TRUE);
-       } else if (backoff->result == PS_PDP_REJ_TIMER_T3396_STOPPED) {
-               ps_err_ex_svc(service, "T3396_STOPPED, PDN.apn(%s)", backoff->apn);
-               tcore_context_set_throttled_apn(co_context, FALSE);
-               _ps_service_connect_default_context(service);
-       }
-
-       return TCORE_HOOK_RETURN_CONTINUE;
-}
-#endif
-
-#if 0 // TODO: libtcore need to be updated
-static enum tcore_hook_return __on_hook_gprs_nas_timer(Server *s, CoreObject *source,
-                                                      enum tcore_notification_command command, unsigned int data_len, void *data,
-                                                      void *user_data)
-{
-       ps_service_t *service = user_data;
-       struct tnoti_ps_nas_timer *nas_timer = data;
-
-       g_return_val_if_fail(service != NULL, TCORE_HOOK_RETURN_STOP_PROPAGATION);
-
-       if (nas_timer->timer_type == 0x01) { /*T3346*/
-               if (nas_timer->timer_status == PS_NAS_TIMER_STATE_START) {
-                       ps_info_ex_svc(service, "T3346 START(%d)", nas_timer->timer_status);
-                       _ps_service_handling_nas_timer(service, nas_timer->timer_status);
-               } else if (nas_timer->timer_status == PS_NAS_TIMER_STATE_STOP
-                               || nas_timer->timer_status == PS_NAS_TIMER_STATE_EXPIRE) {
-                       ps_info_ex_svc(service, "T3346 STOP(%d)", nas_timer->timer_status);
-                       _ps_service_handling_nas_timer(service, nas_timer->timer_status);
-               }
-       }
-
-       return TCORE_HOOK_RETURN_CONTINUE;
-}
-#endif
-
 static enum tcore_hook_return __on_hook_dedicated_bearerinfo(Server *s, CoreObject *source,
                                                             enum tcore_notification_command command, unsigned int data_len, void *data,
                                                             void *user_data)
@@ -835,7 +758,8 @@ static enum tcore_hook_return __on_hook_sim_init(Server *s, CoreObject *source,
        return TCORE_HOOK_RETURN_CONTINUE;
 }
 
-#if 0 // TODO: libtcore need to be updated
+
+#ifdef TIZEN_SUPPORT_VOLTE
 static enum tcore_hook_return __on_hook_sim_refresh(Server *s, CoreObject *source,
                                                    enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
 {