[ITC][capi-network-inm][Non-ACR][Modify logic to get connection] 49/200549/1
authorYu <jiung.yu@samsung.com>
Tue, 26 Feb 2019 10:28:32 +0000 (19:28 +0900)
committerYu <jiung.yu@samsung.com>
Tue, 26 Feb 2019 10:28:36 +0000 (19:28 +0900)
Change-Id: I94b6537ed2266c16023c7db6a648d7bdd35c025a
Signed-off-by: Yu Jiung <jiung.yu@samsung.com>
src/itc/capi-network-inm/ITs-capi-network-inm-common.c

index b1f008342aaf20a6f3c5076c3f97c9a6fb754c70..b42abde45c1b8d5224d4a890000bc401a83bd0f3 100755 (executable)
@@ -192,26 +192,8 @@ char* InmGetDisconnectReason(int error)
 
 int InmGetAnyProfile(inm_connection_h *profile)
 {
-       inm_connection_h hProfile;
-       inm_connection_iterator_h hProfileIter;
-
-       int  nRet = inm_get_connection_iterator(g_hInm, &hProfileIter);
-       if (g_bFeatureAllNotSupported) {
-               PRINT_RESULT_CHECK(nRet, INM_ERROR_NOT_SUPPORTED, "inm_get_connection_iterator", InmGetError(nRet));
-               return FEATURE_NOT_SUPPORTED;
-       }
-       PRINT_RESULT(nRet, INM_ERROR_NONE, "inm_get_connection_iterator", InmGetError(nRet));
-       CHECK_HANDLE(hProfileIter, "inm_get_connection_iterator");
-
-       nRet = inm_connection_iterator_next(hProfileIter, &hProfile);
-       PRINT_RESULT_CLEANUP(nRet, INM_ERROR_NONE, "inm_connection_iterator_next", InmGetError(nRet), inm_destroy_connection_iterator(hProfileIter));
-       CHECK_HANDLE_CLEANUP(hProfile, "inm_connection_iterator_next", inm_destroy_connection_iterator(hProfileIter));
-
-       nRet = inm_connection_clone(profile, hProfile);
-       PRINT_RESULT_CLEANUP(nRet, INM_ERROR_NONE, "inm_connection_clone", InmGetError(nRet), inm_destroy_connection_iterator(hProfileIter); inm_connection_destroy(&hProfile));
-
-       nRet = inm_destroy_connection_iterator(hProfileIter);
-       PRINT_RESULT_NORETURN(nRet, INM_ERROR_NONE, "inm_destroy_connection_iterator", InmGetError(nRet));
+       int  nRet = inm_get_current_connection(g_hInm, profile);
+       PRINT_RESULT_NORETURN(nRet, INM_ERROR_NONE, "inm_get_current_connection", InmGetError(nRet));
 
        return 0;
 }