}
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);