[ITC][watchface-complication][Non-ACR][Fix wrong implemenation] 24/234824/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 29 May 2020 05:16:41 +0000 (14:16 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Fri, 29 May 2020 05:18:33 +0000 (05:18 +0000)
- Uses g_main_loop_quit() instead of service_app_exit()

Change-Id: If6d7643c0ad0d1811d200f3eadda15f341396709
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/itc/watchface-complication/ITs-watchface-complication-common.c
src/itc/watchface-complication/ITs-watchface-complication-common.h
src/itc/watchface-complication/ITs-watchface-complication-editable.c
src/itc/watchface-complication/ITs-watchface-complication-provider.c
src/itc/watchface-complication/ITs-watchface-complication.c

index 36caf7e9a167228c2992db0c2f9173c01c665dfb..0a7976ad1e9996b3579aa057da5110c4225858de 100644 (file)
@@ -105,13 +105,9 @@ char* BundleGetError(int nRet)
  */
 gboolean TimeoutFunction(gpointer data)
 {
-       GMainLoop *pMainLoop = NULL;
-       pMainLoop = (GMainLoop *)data;
-       if ( pMainLoop != NULL )
-       {
-               g_main_loop_quit(pMainLoop);
-       }
-       return false;
+       g_nTimeoutId = 0;
+       QuitGmainLoop();
+       return G_SOURCE_REMOVE;
 }
 
 /**
@@ -132,3 +128,19 @@ void IterateGmainLoop(void)
                g_pMainLoop = NULL;
        }
 }
+
+void QuitGmainLoop(void)
+{
+       if(g_nTimeoutId)
+       {
+               g_source_remove(g_nTimeoutId);
+               g_nTimeoutId = 0;
+       }
+
+       if(g_pMainLoop)
+       {
+               g_main_loop_quit(g_pMainLoop);
+               g_main_loop_unref(g_pMainLoop);
+               g_pMainLoop = NULL;
+       }
+}
index 731ffc13ebcd27d8f6229ea98387257ead98c7f4..f980a06e6ac18b515654621e880e84e1538fed04 100644 (file)
@@ -78,7 +78,6 @@ static char g_pszCheckUserData[] = "check_user_data";
        else \
 {\
        FPRINTF("[Line : %d][%s] %s failed, error returned = %s [%d]\\n", __LINE__, API_NAMESPACE, API, Error, eRetVal);\
-       service_app_exit(); \
        return;\
 }\
 }
@@ -95,7 +94,6 @@ static char g_pszCheckUserData[] = "check_user_data";
 {\
        FPRINTF("[Line : %d][%s] %s failed, error returned = %s [%d]\\n", __LINE__, API_NAMESPACE, API, Error, eRetVal);\
        FreeResource;\
-       service_app_exit(); \
        return;\
 }\
 }
@@ -104,7 +102,6 @@ static char g_pszCheckUserData[] = "check_user_data";
        if ( Handle == NULL )\
 {\
        FPRINTF("[Line : %d][%s] %s failed, error returned = Handle returned is NULL\\n", __LINE__, API_NAMESPACE, API);\
-       service_app_exit(); \
        return;\
 }\
 }
@@ -114,7 +111,6 @@ static char g_pszCheckUserData[] = "check_user_data";
 {\
        FPRINTF("[Line : %d][%s] %s failed, error returned = Handle returned is NULL\\n", __LINE__, API_NAMESPACE, API);\
        FreeResource;\
-       service_app_exit(); \
        return;\
 }\
 }
@@ -131,7 +127,6 @@ static char g_pszCheckUserData[] = "check_user_data";
        if ( Handle == NULL )\
 {\
        FPRINTF("[Line : %d][%s] %s failed, error returned = Handle returned is NULL\\n", __LINE__, API_NAMESPACE, API);\
-       service_app_exit(); \
        return 1;\
 }\
 }
@@ -150,7 +145,6 @@ static char g_pszCheckUserData[] = "check_user_data";
 {\
        FPRINTF("[Line : %d][%s] %s failed, error returned = Handle returned is NULL\\n", __LINE__, API_NAMESPACE, API);\
        FreeResource;\
-       service_app_exit(); \
        return 1;\
 }\
 }
@@ -166,7 +160,6 @@ static char g_pszCheckUserData[] = "check_user_data";
        else \
 {\
        FPRINTF("[Line : %d][%s] %s failed, error returned = %s [%d]\\n", __LINE__, API_NAMESPACE, API, Error, eRetVal);\
-       service_app_exit(); \
        return 1;\
 }\
 }
@@ -182,7 +175,6 @@ static char g_pszCheckUserData[] = "check_user_data";
        else \
 {\
        FPRINTF("[Line : %d][%s] %s failed, error returned = %s [%d]\\n", __LINE__, API_NAMESPACE, API, Error, eRetVal);\
-       service_app_exit(); \
        return;\
 }\
 }
@@ -199,7 +191,6 @@ else \
 {\
        FPRINTF("[Line : %d][%s] %s failed, error returned = %s [%d]\\n", __LINE__, API_NAMESPACE, API, Error, eRetVal);\
        FreeResource;\
-       service_app_exit(); \
        return 1;\
 }\
 }
@@ -211,14 +202,12 @@ else \
 {\
        FPRINTF("[Line:%d][%s] FeatureWatchApp not supported\\n", __LINE__, API_NAMESPACE);\
        g_bFeatureNotSupported = true;\
-       service_app_exit();\
        return 0;\
 }\
        else \
 {\
        g_bIsFeatureMismatched = true;\
        FPRINTF("[Line : %d][%s] %s failed due to feature mismatch.\\n", __LINE__, API_NAMESPACE, API);\
-       service_app_exit(); \
        return 1;\
 }\
 }\
@@ -231,14 +220,12 @@ else \
 {\
        FPRINTF("[Line:%d][%s] FeatureWatchApp not supported\\n", __LINE__, API_NAMESPACE);\
        g_bFeatureNotSupported = true;\
-       service_app_exit();\
        return;\
 }\
        else \
 {\
        g_bIsFeatureMismatched = true;\
        FPRINTF("[Line : %d][%s] %s failed due to feature mismatch.\\n", __LINE__, API_NAMESPACE, API);\
-       service_app_exit(); \
        return;\
 }\
 }\
@@ -248,7 +235,6 @@ else \
 {\
        nRet = watchface_complication_provider_remove_update_requested_cb(PROVIDER_ID, UpdateRequestedCb2);\
        PRINT_RESULT_NORETURN(nRet, WATCHFACE_COMPLICATION_ERROR_NONE, "watchface_complication_provider_remove_update_requested_cb", WatchfaceComplicationGetError(nRet));\
-       service_app_exit();\
 }
 
 #define WATCHFACE_COMPLICATION_REMOVE_UPDATED_CB_EXIT(hHandle, Callback, nRet)\
@@ -257,7 +243,6 @@ else \
        PRINT_RESULT_NORETURN(nRet, WATCHFACE_COMPLICATION_ERROR_NONE, "watchface_complication_remove_updated_cb", WatchfaceComplicationGetError(nRet));\
        nRet = watchface_complication_destroy(hHandle);\
        PRINT_RESULT_NORETURN(nRet, WATCHFACE_COMPLICATION_ERROR_NONE, "watchface_complication_destroy", WatchfaceComplicationGetError(nRet));\
-       service_app_exit();\
 }
 
 char* WatchfaceComplicationGetError(int nRet);
@@ -265,6 +250,7 @@ char* AppControlGetError(int nRet);
 char* BundleGetError(int nRet);
 gboolean TimeoutFunction(gpointer data);
 void IterateGmainLoop(void);
+void QuitGmainLoop(void);
 extern void WatchfaceComplicationProviderSetupGetContextChecker(void);
 extern void WatchfaceComplicationProviderSetupReplyToEditorChecker(void);
 extern void WatchfaceComplicationProviderSetupIsEditingChecker(void);
index d04834d7ea2fffaff71f32edd4c63c0457c4c572..c76af8c0871ca2dd0046deec8c7aafa613024a4f 100755 (executable)
@@ -195,7 +195,7 @@ static void RequestEditWithComplicationCb(const watchface_editable_h hHandle, in
 {
        FPRINTF("[Line : %d][%s] entered %s.\\n", __LINE__, API_NAMESPACE, "RequestEditWithComplicationCb");
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -215,7 +215,7 @@ static void AddComplicationOnEditReadyCb(watchface_editable_container_h hEdCon,c
        char *pszXUserData = (char *)pszUserData;
 
        if(strncmp(pszXUserData, g_pszCheckUserData, strlen(g_pszCheckUserData)) != 0){
-               service_app_exit();
+               QuitGmainLoop();
                return;
        }
        nRet = watchface_editable_highlight_create(&hHighlight, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE);
@@ -239,7 +239,7 @@ static void AddComplicationOnEditReadyCb(watchface_editable_container_h hEdCon,c
        watchface_editable_highlight_destroy(hHighlight);
        watchface_complication_destroy(hHandle);
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -261,7 +261,7 @@ static void GetNthUpdateRequestedCb(const watchface_editable_h hHandle, int nSel
        CALLBACK_CHECK_HANDLE_EXIT(pszNthData, "watchface_editable_get_nth_data");
        bundle_free(pszNthData);
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -291,7 +291,7 @@ static void UpdateRequestedCb(const watchface_editable_h hHandle,int nSelectedId
 {
        FPRINTF("[Line : %d][%s] entered %s.\\n", __LINE__, API_NAMESPACE, "UpdateRequestedCb");
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -347,7 +347,7 @@ static void RequestEditOnEditReadyCb(watchface_editable_container_h hEdCon,const
        watchface_editable_highlight_destroy(hHighlight);
        watchface_complication_destroy(hHandle);
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -418,12 +418,12 @@ static void GetCurDataIdxUpdateRequestedCb(const watchface_editable_h hHandle, i
        if(nIdx < 0)
        {
                FPRINTF("[Line : %d][%s] %s failed. nIdx = %d\\n", __LINE__, API_NAMESPACE, "watchface_editable_get_current_data_idx", nIdx);
-               service_app_exit();
+               QuitGmainLoop();
                return;
        }
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -458,11 +458,11 @@ static void GetEditableIdUpdateRequestedCb(const watchface_editable_h hHandle, i
        if(nEditableId < 0)
        {
                FPRINTF("[Line : %d][%s] %s failed. nEditableId = %d\\n", __LINE__, API_NAMESPACE, "watchface_editable_get_editable_id", nEditableId);
-               service_app_exit();
+               QuitGmainLoop();
                return;
        }
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -501,7 +501,7 @@ static void LoadCurrentDataUpdateRequestedCb(const watchface_editable_h hHandle,
                if(nEditableId < 0)
                {
                        FPRINTF("[Line : %d][%s] %s failed. nEditableId = %d\\n", __LINE__, API_NAMESPACE, "watchface_editable_get_editable_id", nEditableId);
-                       service_app_exit();
+                       QuitGmainLoop();
                        return;
                }
                nRet = watchface_editable_load_current_data(nEditableId, &pszCurrentData);
@@ -510,7 +510,7 @@ static void LoadCurrentDataUpdateRequestedCb(const watchface_editable_h hHandle,
                FREE_MEMORY(pszCurrentData);
                g_bCallBackHit = true;
        }
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -542,7 +542,7 @@ static void EditableSetNameUpdateRequestedCb(const watchface_editable_h hHandle,
        int nRet = watchface_editable_set_editable_name(hHandle, pszEditableSetName);
        CALLBACK_EXIT(nRet, WATCHFACE_COMPLICATION_ERROR_NONE, "watchface_editable_set_editable_name", WatchfaceComplicationGetError(nRet));
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -579,7 +579,7 @@ static void EditableGetNameUpdateRequestedCb(const watchface_editable_h hHandle,
        CALLBACK_CHECK_HANDLE_EXIT(g_pszEditableGetName, "watchface_editable_get_editable_name");
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -625,13 +625,13 @@ static void GetHighlightUpdateRequestedCb(const watchface_editable_h hHandle, in
        {
                FPRINTF("[Line : %d][%s] %s failed. \\nnX = %d\\nnY = %d\\nnW = %d\\nnH = %d\\n", __LINE__, API_NAMESPACE,                              "watchface_editable_highlight_get_geometry", nX, nY, nH, nW);
                watchface_editable_highlight_destroy(highlight);
-               service_app_exit();
+               QuitGmainLoop();
                return;
        }
 
        watchface_editable_highlight_destroy(highlight);
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
index a395d195931479436188cce47963f33a414e47c9..101129f16f58c60f4abae00545fefadd40224497 100755 (executable)
@@ -230,7 +230,6 @@ static void SetupOnEditReadyCb(watchface_editable_container_h hEdCon, const char
 
        watchface_editable_highlight_destroy(hHighlight);
        watchface_complication_destroy(hComp);
-       service_app_exit();
        return;
 }
 
@@ -308,7 +307,7 @@ static void UpdateRequestedCb2(const char *pszProviderId, const char *pszReqAppi
                break;
        }
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
 }
 
 /**
@@ -336,19 +335,19 @@ static void WatchfaceComplicationProviderDataIsValidCb(const char *pszProviderId
                {
                        FPRINTF("[Line : %d][%s] %s failed. bIsValid = false\\n", __LINE__, API_NAMESPACE, "watchface_complication_provider_data_is_valid");
                        app_control_destroy(g_hTestControl);
-                       service_app_exit();
+                       QuitGmainLoop();
                        return;
                }
 
                if(strncmp(pszUserDataChar, g_pszCheckUserData, strlen(g_pszCheckUserData)) != 0){
                        app_control_destroy(g_hTestControl);
-                       service_app_exit();
+                       QuitGmainLoop();
                        return;
                }
                g_bCallBackHit = true;
        }
        app_control_destroy(g_hTestControl);
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -368,7 +367,6 @@ void WatchfaceComplicationProviderSetupReplyToEditorChecker(void)
        CALLBACK_EXIT_CLEANUP(nRet, WATCHFACE_COMPLICATION_ERROR_NONE, "watchface_complication_provider_setup_reply_to_editor",                                         WatchfaceComplicationGetError(nRet), bundle_free(pszContext);app_control_destroy(g_hTestControl));
        bundle_free(pszContext);
        app_control_destroy(g_hTestControl);
-       service_app_exit();
        g_bCheckerHit = true;
        return;
 }
@@ -388,11 +386,10 @@ void WatchfaceComplicationProviderSetupIsEditingChecker(void)
        {
                FPRINTF("[Line : %d][%s] %s failed. IsEditing = false\\n", __LINE__, API_NAMESPACE, "watchface_complication_provider_setup_is_editing");
                app_control_destroy(g_hTestControl);
-               service_app_exit();
+               QuitGmainLoop();
                return;
        }
        app_control_destroy(g_hTestControl);
-       service_app_exit();
        g_bCheckerHit = true;
        return;
 }
@@ -411,7 +408,6 @@ void WatchfaceComplicationProviderSetupGetContextChecker(void)
        CALLBACK_CHECK_HANDLE_EXIT_CLEANUP(pszContext, "watchface_complication_provider_setup_get_context", app_control_destroy(g_hTestControl));
        bundle_free(pszContext);
        app_control_destroy(g_hTestControl);
-       service_app_exit();
        g_bCheckerHit = true;
        return;
 }
@@ -432,13 +428,11 @@ void WatchfaceComplicationProviderEventGetTypeChecker(void)
        {
                FPRINTF("[Line : %d][%s] %s failed. eType = %d\\n", __LINE__, API_NAMESPACE, "watchface_complication_provider_event_get_type", eEventType);
                app_control_destroy(g_hTestControl);
-               service_app_exit();
                return;
        }
 
        g_bCheckerHit = true;
        app_control_destroy(g_hTestControl);
-       service_app_exit();
        return;
 }
 
@@ -460,7 +454,7 @@ void WatchfaceComplicationProviderEventGetProviderIdChecker(void)
        g_bCheckerHit = true;
        app_control_destroy(g_hTestControl);
        FREE_MEMORY(pszProviderId);
-       service_app_exit();
+       QuitGmainLoop();
 }
 
 /**
@@ -480,12 +474,12 @@ void WatchfaceComplicationProviderEventGetComplicationTypeChecker(void)
        {
                FPRINTF("[Line : %d][%s] %s failed. eType = %d\\n", __LINE__, API_NAMESPACE, "watchface_complication_provider_event_complication_type", eType);
                app_control_destroy(g_hTestControl);
-               service_app_exit();
+               QuitGmainLoop();
                return;
        }
        g_bCheckerHit = true;
        app_control_destroy(g_hTestControl);
-       service_app_exit();
+       QuitGmainLoop();
 }
 
 /**
@@ -505,12 +499,12 @@ void WatchfaceComplicationProviderEventGetContextChecker(void)
        {
                FPRINTF("[Line : %d][%s] %s failed. eType = %d\\n", __LINE__, API_NAMESPACE, "watchface_complication_provider_event_get_complication_type", eType);
                app_control_destroy(g_hTestControl);
-               service_app_exit();
+               QuitGmainLoop();
                return;
        }
        g_bCheckerHit = true;
        app_control_destroy(g_hTestControl);
-       service_app_exit();
+       QuitGmainLoop();
 }
 
 /*****************************************************Helper Functions End*****************************************************/
index b2e54e6e34d7cb10d09cbbeaa75a0d616cf6f209..47c67fe1ad45772e018f2940af765cc509a0dd35 100755 (executable)
@@ -113,12 +113,12 @@ static void TypeComplicationUpdatedCb(int nComplicationId,const char *pszProvide
        if( eDataType <  WATCHFACE_COMPLICATION_TYPE_NO_DATA || eDataType > WATCHFACE_COMPLICATION_TYPE_IMAGE )
        {
                FPRINTF("[Line : %d][%s] %s failed. eDataType = %d\\n", __LINE__, API_NAMESPACE, "watchface_complication_data_get_type", eDataType);
-               service_app_exit();
+               QuitGmainLoop();
                return;
        }
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -138,7 +138,7 @@ static void ShortTextComplicationUpdatedCb(int nComplicationId,const char *pszPr
 
        FREE_MEMORY(pszText);
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -158,7 +158,7 @@ static void LongTextComplicationUpdatedCb(int nComplicationId,const char *pszPro
        FREE_MEMORY(pszText);
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -178,7 +178,7 @@ static void TitleComplicationUpdatedCb(int nComplicationId,const char *pszProvid
        FREE_MEMORY(pszText);
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -200,7 +200,7 @@ static void ImageComplicationUpdatedCb(int nComplicationId,const char *pszProvid
        FREE_MEMORY(pszText);
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -224,24 +224,24 @@ static void RangedValueComplicationUpdatedCb(int nComplicationId,const char *psz
        if( nCurrentValue < 0 )
        {
                FPRINTF("[Line : %d][%s] %s failed. nCurrentValue = %d\\n", __LINE__, API_NAMESPACE, "watchface_complication_data_get_ranged_value", nCurrentValue);
-               service_app_exit();
+               QuitGmainLoop();
                return;
        }
        if( nMinValue < 0 )
        {
                FPRINTF("[Line : %d][%s] %s failed. nMinValue = %d\\n", __LINE__, API_NAMESPACE, "watchface_complication_data_get_ranged_value", nMinValue);
-               service_app_exit();
+               QuitGmainLoop();
                return;
        }
        if( nMaxValue < 0 )
        {
                FPRINTF("[Line : %d][%s] %s failed. nMaxValue = %d\\n", __LINE__, API_NAMESPACE, "watchface_complication_data_get_ranged_value", nMaxValue);
-               service_app_exit();
+               QuitGmainLoop();
                return;
        }
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -261,7 +261,7 @@ static void IconComplicationUpdatedCb(int nComplicationId,const char *pszProvide
        FREE_MEMORY(pszText);
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -296,7 +296,7 @@ static void ScreenReaderCb(int nComplicationId, const char *pszProviderId, watch
        FREE_MEMORY(pszText);
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -328,7 +328,7 @@ static void GetTimeInfoComplicationCb(int nComplicationId, const char *pszProvid
        }
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -368,7 +368,7 @@ static void GetTimeZoneComplicationCb(int nComplicationId, const char *pszProvid
                        nRet = watchface_complication_timeinfo_destroy(hComlicationTimeInfo);
                        CALLBACK_EXIT(WATCHFACE_COMPLICATION_ERROR_NONE, nRet, "watchface_complication_timeinfo_destroy", WatchfaceComplicationGetError(nRet));
 
-                       service_app_exit();
+                       QuitGmainLoop();
                        return;
                }
                FREE_MEMORY(pszGetTimeZone);
@@ -378,7 +378,7 @@ static void GetTimeZoneComplicationCb(int nComplicationId, const char *pszProvid
        }
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -418,7 +418,7 @@ static void GetTimeZoneIDComplicationCb(int nComplicationId, const char *pszProv
                        nRet = watchface_complication_timeinfo_destroy(hComlicationTimeInfo);
                        CALLBACK_EXIT(WATCHFACE_COMPLICATION_ERROR_NONE, nRet, "watchface_complication_timeinfo_destroy", WatchfaceComplicationGetError(nRet));
 
-                       service_app_exit();
+                       QuitGmainLoop();
                        return;
                }
                FREE_MEMORY(pszGetTimeZoneID);
@@ -428,7 +428,7 @@ static void GetTimeZoneIDComplicationCb(int nComplicationId, const char *pszProv
        }
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -468,7 +468,7 @@ static void GetTimeZoneCountryComplicationCb(int nComplicationId, const char *ps
                        nRet = watchface_complication_timeinfo_destroy(hComlicationTimeInfo);
                        CALLBACK_EXIT(WATCHFACE_COMPLICATION_ERROR_NONE, nRet, "watchface_complication_timeinfo_destroy", WatchfaceComplicationGetError(nRet));
 
-                       service_app_exit();
+                       QuitGmainLoop();
                        return;
                }
                FREE_MEMORY(pszGetTimeZoneCtry);
@@ -478,7 +478,7 @@ static void GetTimeZoneCountryComplicationCb(int nComplicationId, const char *ps
        }
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -518,7 +518,7 @@ static void GetTimeZoneCityComplicationCb(int nComplicationId, const char *pszPr
                        nRet = watchface_complication_timeinfo_destroy(hComlicationTimeInfo);
                        CALLBACK_EXIT(WATCHFACE_COMPLICATION_ERROR_NONE, nRet, "watchface_complication_timeinfo_destroy", WatchfaceComplicationGetError(nRet));
 
-                       service_app_exit();
+                       QuitGmainLoop();
                        return;
                }
                FREE_MEMORY(pszGetTimeZoneCity);
@@ -528,7 +528,7 @@ static void GetTimeZoneCityComplicationCb(int nComplicationId, const char *pszPr
        }
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -564,7 +564,7 @@ static void GetTimeStampComplicationCb(int nComplicationId, const char *pszProvi
        }
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }
 
@@ -596,7 +596,7 @@ static void TimeInfoDestroyComplicationCb(int nComplicationId, const char *pszPr
        }
 
        g_bCallBackHit = true;
-       service_app_exit();
+       QuitGmainLoop();
        return;
 }