comp-manager: reduce unnecessary provisioing operation
authorsaerome.kim <saerome.kim@samsung.com>
Mon, 22 Jan 2018 07:37:06 +0000 (16:37 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 2 Jul 2018 10:38:47 +0000 (19:38 +0900)
mot-agent: remove set pre-preconfig PIN after MOT.

Signed-off-by: saerome.kim <saerome.kim@samsung.com>
src/companion-manager/src/comp_mot_agent.c
src/mot-agent/ma-subowner.c

index 0e730b49e82e38ac764cc42770b7d26f0a364f5d..3bec0f499d7616d9d182a38508d756767051e6ba 100644 (file)
@@ -433,6 +433,7 @@ static gboolean __perform_remove_mot_dev2(gpointer data)
        int ret;
 
        ret = agent_remove_mo_at_device(device_uuid2);
+#if 0
        if (ret != COMP_ERROR_NONE) {
                comp_group_notify_group_dismiss(ret);
                g_free(device_uuid1);
@@ -440,6 +441,7 @@ static gboolean __perform_remove_mot_dev2(gpointer data)
                g_free(device_uuid2);
                device_uuid1 = NULL;
        }
+#endif
 
        return FALSE;
 }
@@ -449,6 +451,7 @@ static gboolean __perform_remove_cred_at_local(gpointer data)
        int ret;
 
        ret = agent_remove_cred_at_local(device_uuid2);
+#if 0
        if (ret != COMP_ERROR_NONE) {
                comp_group_notify_group_dismiss(ret);
                g_free(device_uuid1);
@@ -456,7 +459,7 @@ static gboolean __perform_remove_cred_at_local(gpointer data)
                g_free(device_uuid2);
                device_uuid1 = NULL;
        }
-
+#endif
        return FALSE;
 }
 
@@ -690,33 +693,18 @@ static void _agent_signal_handler(GDBusConnection *connection,
                g_variant_get(parameters, "(i)", &result);
                LOG_DEBUG("Result : %d", result);
        } else if (0 == g_strcmp0(signal_name, "mot_done")) {
-               g_variant_get(parameters, "(i)", &result);
-               LOG_DEBUG("Result : %d", result);
+               comp_mot_device_t *device;
+               comp_context_t *comp_ctx = comp_context_get_context();
 
-               g_timeout_add(1000, __perform_agent_pairwise, NULL);
-#if 0
-               if (result != 0 && result != 49) {
-                       comp_group_notify_group_invite(result);
-                       mot_dev2 = false;
-               } else {
-                       if (mot_dev2 == false)
-                               g_timeout_add(1000, __perform_group_mot_dev2, NULL);
-                       else
-                               g_timeout_add(1000, __perform_agent_pairwise, NULL);
+               if (comp_ctx && (TRUE == comp_ctx->mot_me) ) {
+                       g_timeout_add(1000, __perform_agent_pairwise, NULL);
                }
-#endif
        } else if (0 == g_strcmp0(signal_name, "remove_mo_done")) {
                g_variant_get(parameters, "(i)", &result);
                LOG_DEBUG("Result : %d", result);
 
-               if (result != 0) {
-                       comp_group_notify_group_dismiss(result);
-                       g_free(device_uuid1);
-                       device_uuid1 = NULL;
-                       g_free(device_uuid2);
-                       device_uuid1 = NULL;
-               } else
-                       g_timeout_add(1000, __perform_remove_cred_at_local, NULL);
+               g_timeout_add(1000, __perform_remove_cred_at_local, NULL);
+
        } else if (0 == g_strcmp0(signal_name, "remove_cred_local_done")) {
                g_variant_get(parameters, "(i)", &result);
                LOG_DEBUG("Result : %d", result);
@@ -735,15 +723,16 @@ static void _agent_signal_handler(GDBusConnection *connection,
        } else if (0 == g_strcmp0(signal_name, "unpair_done")) {
                g_variant_get(parameters, "(i)", &result);
                LOG_DEBUG("Result : %d", result);
-
+#if 0
                if (result != 0) {
                        comp_group_notify_group_dismiss(result);
                        g_free(device_uuid1);
                        device_uuid1 = NULL;
                        g_free(device_uuid2);
                        device_uuid1 = NULL;
-               } else
-                       g_timeout_add(1000, __perform_remove_mot_dev2, NULL);
+               }
+#endif
+               g_timeout_add(1000, __perform_remove_mot_dev2, NULL);
        }
 }
 static int _subscribe_event()
index eb9ce77d7548eb6d7ff49dc706913a0ba65edc99..419e7d03e0c66b27f6b5c88c398d61a1d61c2660 100644 (file)
@@ -972,7 +972,7 @@ static gpointer _mot_func(gpointer data)
 MOT_ENDED:
 
        net_ma_emit_mot_done(ma_dbus_get_object(), (int)ret);
-
+#if 0
 #ifdef MULTIPLE_OWN_AT_ONCE
        OCProvisionDev_t* dev = NULL;
        LL_FOREACH(g_client->g_motdev_list, dev) {
@@ -995,6 +995,7 @@ MOT_ENDED:
                        MA_LOGE("Reset pre-configured PIN OxM for MOT");
                }
        }
+#endif
 #endif
 
        if (uuid_target)