[ITC][connection][Non-ACR][DPTTIZEN-2007: Modified to check cellular state for connec...
authorAmritanshu Pandia <a.pandia1@samsung.com>
Fri, 17 Jun 2016 06:57:32 +0000 (12:27 +0530)
committerAmritanshu Pandia <a.pandia1@samsung.com>
Fri, 17 Jun 2016 06:57:32 +0000 (12:27 +0530)
Change-Id: Iba7b10e3f7cf774803669ce13b01d045c7fcc10c
Signed-off-by: Amritanshu Pandia <a.pandia1@samsung.com>
src/itc/connection/ITs-connection-profile.c

index ee62c0e..ce43181 100755 (executable)
@@ -126,6 +126,7 @@ void ITs_connection_profile_startup(void)
        g_hConnectionProfileHandleCellular = NULL;
        g_hConnectionProfileHandleMMS = NULL;
        g_hConenctionHandle = NULL;
+       connection_cellular_state_e eState;
 
        int nRet = connection_create(&g_hConenctionHandle);
        if ( false == bTelFeatureSupported && false == bWifiFeatureSupported && false == bBtFeatureSupported && false == bEthernetFeatureSupported )
@@ -150,6 +151,21 @@ void ITs_connection_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 )