[UTC][connection][Non-ACR][Fix an issue that did not check cellular status correctly] 52/214952/1
authorJaehyun Kim <jeik01.kim@samsung.com>
Mon, 30 Sep 2019 07:03:22 +0000 (16:03 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Mon, 30 Sep 2019 07:03:22 +0000 (16:03 +0900)
Change-Id: I734c9fcd1a09484d0bc7dd92fbff0e276d67f140
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/utc/connection/utc-network-connection.c

index fd2757a9fa3f9e1fdabc2996f4984a6f23c0626c..e3a26f730fa7aca2e60853909f43a2be145a2b9c 100755 (executable)
@@ -2196,6 +2196,16 @@ int utc_connection_remove_profile_p(void)
        }
 
        if (telephony_supported) {
+               connection_cellular_state_e state;
+               ret = connection_get_cellular_state(connection, &state);
+               PRINT_RETURN("connection_get_cellular_state", ret);
+
+               /* Profile Add/Remove method is not allowed when the cellular is in out-of-service state  */
+               if (state == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE) {
+                       fprintf(stderr, "Cellular state is out of service at %s:%d", __FILE__, __LINE__);
+                       return 0;
+               }
+
                test_get_profile_by_name(&profile_temp, CUSTOM_PROFILE_NAME);
                ret = connection_remove_profile(connection, profile_temp);
                CHECK_RETURN("connection_remove_profile", ret, CONNECTION_ERROR_NONE);