elm_conform: Prevent infinite trial of connection to the indicator 73/144473/4
authorWonki Kim <wonki_.kim@samsung.com>
Thu, 17 Aug 2017 01:49:40 +0000 (10:49 +0900)
committerwonki kim <wonki_.kim@samsung.com>
Thu, 17 Aug 2017 04:41:45 +0000 (04:41 +0000)
Even if there isn't a indicator at all,
the conformant tries to connect to the indicator server INFINITELY.
Therefore that makes wasting of computing power.

This patch prevents the trials to save computing power.

@tizen_fix

Change-Id: I2ec5034bae969f13f49babbf3900aaa74390a471
Signed-off-by: Wonki Kim <wonki_.kim@samsung.com>
src/lib/elm_conform.c
src/lib/elm_widget_conform.h

index 5f980531b713898f97b80b67c9c411858d466679..6348897233cb01235ffd80f22e34dc427ae4406d 100644 (file)
@@ -17,6 +17,9 @@
 //TIZEN_ONLY(20160330): add processing properties of window
 #define SWAP(x, y, t) ((t) = (x), (x) = (y), (y) = (t))
 //
+//TIZEN_ONLY(20170817) : Prevent infinite trial of connection to the indicator server
+#define CONNECT_TRY_MAX (3)
+//END
 
 static char CONFORMANT_KEY[] = "_elm_conform_key";
 
@@ -608,6 +611,16 @@ _indicator_connect_cb(void *data)
    ELM_CONFORMANT_DATA_GET(data, sd);
 
    if (!sd) return ECORE_CALLBACK_CANCEL;
+
+   //TIZEN_ONLY(20170817) : Prevent infinite trial of connection to the indicator server
+   if(++sd->connect_try > CONNECT_TRY_MAX)
+     {
+        DBG("Conformant tried to connect to indicator %d times but give up now", CONNECT_TRY_MAX);
+        sd->indi_timer = NULL;
+        return ECORE_CALLBACK_CANCEL;
+     }
+   //END
+
    if (sd->indmode != ELM_WIN_INDICATOR_SHOW)
      {
         sd->indi_timer = NULL;
@@ -834,6 +847,9 @@ _create_indicator(Evas_Object *obj)
    evas_object_size_hint_min_set(indicator, -1, 0);
    evas_object_size_hint_max_set(indicator, -1, 0);
 
+   //TIZEN_ONLY(20170817) : Prevent infinite trial of connection to the indicator server
+   sd->connect_try = 1;
+   //END
    return indicator;
 }
 //END
index 6b50b5b7da040aab05937b2800805ceddf7dbba7..5a9342280f9b79660a9274a7a1b905022213d1b8 100644 (file)
@@ -63,6 +63,9 @@ struct _Elm_Conformant_Data
    int                            rot;
    Evas_Object                   *indicator;
    Ecore_Timer                   *indi_timer;
+   //TIZEN_ONLY(20170817) : Prevent infinite trial of connection to the indicator server
+   int                            connect_try;
+   //END
 };
 
 /* Enum to identify conformant swallow parts */