Reconnect in case of rejecting 32/210932/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 26 Jul 2019 05:14:23 +0000 (14:14 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 26 Jul 2019 05:15:18 +0000 (14:15 +0900)
Change-Id: I39ee186b51f2b5f4d67742901a4c231ef043fffa
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/autofill-daemon.c

index 64483fb..5acfa5a 100644 (file)
@@ -29,6 +29,8 @@
 #include "autofill_manager_stub.h"
 #include "autofill_config.h"
 
+#define RECONNECT_PERIOD 1.0
+
 static rpc_port_proxy_AutofillSvcPort_h svc_rpc_h = NULL;
 static rpc_port_AutofillSvcPort_autofill_svc_fill_response_cb_h fill_response_received_cb_h = NULL;
 static rpc_port_AutofillSvcPort_autofill_svc_auth_info_cb_h auth_info_cb_h = NULL;
@@ -711,11 +713,8 @@ static Eina_Bool connect_timer_cb(void *data)
     return ECORE_CALLBACK_RENEW;
 }
 
-//LCOV_EXCL_START
-static void __on_disconnected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data)
+static void retry_connect_service()
 {
-    LOGW("Autofill service is disconnected");
-
     svc_rpc_h = NULL;
 
     if (fill_response_received_cb_h) {
@@ -740,13 +739,23 @@ static void __on_disconnected(rpc_port_proxy_AutofillSvcPort_h h, void *user_dat
         if (g_connect_timer)
             ecore_timer_del(g_connect_timer);
 
-        g_connect_timer = ecore_timer_add(1.0, connect_timer_cb, NULL);
+        g_connect_timer = ecore_timer_add(RECONNECT_PERIOD, connect_timer_cb, NULL);
     }
 }
 
+//LCOV_EXCL_START
+static void __on_disconnected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data)
+{
+    LOGW("Autofill service is disconnected");
+
+    retry_connect_service();
+}
+
 static void __on_rejected(rpc_port_proxy_AutofillSvcPort_h h, void *user_data)
 {
     LOGW("Rejected to connect autofill service");
+
+    retry_connect_service();
 }
 //LCOV_EXCL_STOP