[ITC][contacts-service2][NonACR][DPTTIZEN-2134 : Added feature check for telephony_in...
authorsatyajit.a <satyajit.a@samsung.com>
Fri, 1 Jul 2016 04:33:11 +0000 (13:33 +0900)
committersatyajit.a <satyajit.a@samsung.com>
Fri, 1 Jul 2016 04:33:11 +0000 (13:33 +0900)
Change-Id: Ia1f83f8343a077ac2ad1c31ade8dc1bc27abdc77
Signed-off-by: satyajit.a <satyajit.a@samsung.com>
src/itc/contacts-service2/ITs-contacts-service2-sim.c

index 9e36fd2..d8806c2 100755 (executable)
@@ -185,6 +185,20 @@ int ITc_contacts_sim_get_initialization_status_by_sim_slot_no_p(void)
        bool bInitComplete = false;
        
        int nRet = telephony_init(&hTelList);
+       if(!g_bFeatureIsSupported)
+       {
+               if(nRet != TIZEN_ERROR_NOT_SUPPORTED)
+               {
+                       FPRINTF("[Line : %d][%s] telephony_init API call did not return 'UNSUPPORTED' error for unsupported feature\\n", __LINE__, API_NAMESPACE);
+                       return 1;
+               }
+               else
+               {
+                       FPRINTF("[Line : %d][%s] telephony_init API call correctly return 'UNSUPPORTED' error for unsupported feature\\n", __LINE__, API_NAMESPACE);
+                       return 0;
+               }
+       }
+
        PRINT_RESULT(TELEPHONY_ERROR_NONE, nRet, "telephony_init", "Telephony Api Failed");
        
        for (nSimSlotNo = 0; nSimSlotNo < hTelList.count; nSimSlotNo++) 
@@ -241,6 +255,20 @@ int ITc_contacts_sim_import_all_contacts_by_sim_slot_no_p(void)
        int nSimSlotNo = 0;
        
        int nRet = telephony_init(&hTelList);
+       if(!g_bFeatureIsSupported)
+       {
+               if(nRet != TIZEN_ERROR_NOT_SUPPORTED)
+               {
+                       FPRINTF("[Line : %d][%s] telephony_init API call did not return 'UNSUPPORTED' error for unsupported feature\\n", __LINE__, API_NAMESPACE);
+                       return 1;
+               }
+               else
+               {
+                       FPRINTF("[Line : %d][%s] telephony_init API call correctly return 'UNSUPPORTED' error for unsupported feature\\n", __LINE__, API_NAMESPACE);
+                       return 0;
+               }
+       }
+
        PRINT_RESULT(TELEPHONY_ERROR_NONE, nRet, "telephony_init", "Telephony Api Failed");
        
        for (nSimSlotNo = 0; nSimSlotNo < hTelList.count; nSimSlotNo++)