[ITC][connection][Non-ACR][Fix TC scenario for wearable emulator]
authorShashank Shekhar Shukla <shekhar1.s@samsung.com>
Thu, 23 Jun 2016 06:19:14 +0000 (15:19 +0900)
committerShashank Shekhar Shukla <shekhar1.s@samsung.com>
Thu, 23 Jun 2016 06:19:14 +0000 (15:19 +0900)
Change-Id: I543a008ed5018f71900cbec90f956e8ccf5b55af
Signed-off-by: Shashank Shekhar Shukla <shekhar1.s@samsung.com>
src/itc/connection/ITs-connection-cellular-profile.c

index 641fb95..415c660 100755 (executable)
@@ -30,6 +30,7 @@ static GMainLoop *g_pMainLoop;
 static bool g_bCallbackResult = false;
 gboolean Timeout_Function_cellular(gpointer data);
 bool bTelFeatureSupported;
+connection_cellular_state_e eState;
 
 gboolean Timeout_Function_cellular(gpointer data)
 {
@@ -97,6 +98,21 @@ void ITs_connection_cellular_profile_startup(void)
                g_hConenctionHandle = NULL;
                return;
        }
+       
+       nRet = connection_get_cellular_state(g_hConenctionHandle, &eState);
+    if ( nRet != CONNECTION_ERROR_NONE )
+       {
+               FPRINTF("[Line: %d][%s] connection_get_cellular_state failed in startup, returned error %s\\n", __LINE__, API_NAMESPACE, ConnectionGetError(nRet));
+               g_nConnectionPreconditionError = 1;
+               return;
+       }
+    if (eState == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE)
+       {
+               FPRINTF("[Line: %d][%s] Cellular state is out of service\\n", __LINE__, API_NAMESPACE);
+               g_bFeatureNotSupported = true;
+               return;
+       }
+       
        if ( ConnectionManager_get_celluar_profile(g_hConenctionHandle, &g_hConnectionProfileHandleCellular) == 0 )
        {       
                if ( false == bTelFeatureSupported )