return 0;
}
+ connection_cellular_state_e state;
+ int ret = connection_get_cellular_state(connection, &state);
+ assert_eq(ret, CONNECTION_ERROR_NONE);
+ if (state == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE)
+ return 0;
+
int service_type = CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET;
- int ret = connection_get_default_cellular_service_profile(connection, service_type, &profile);
+ ret = connection_get_default_cellular_service_profile(connection, service_type, &profile);
assert_eq(ret, CONNECTION_ERROR_NONE);
service_type = CONNECTION_CELLULAR_SERVICE_TYPE_MMS;
return 0;
}
- int ret = connection_get_default_cellular_service_profile(connection, service_type, &profile_cellular);
+ connection_cellular_state_e state;
+ int ret = connection_get_cellular_state(connection, &state);
+ assert_eq(ret, CONNECTION_ERROR_NONE);
+ if (state == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE)
+ return 0;
+
+ ret = connection_get_default_cellular_service_profile(connection, service_type, &profile_cellular);
assert_eq(ret, CONNECTION_ERROR_NONE);
ret = connection_set_default_cellular_service_profile(connection, service_type, profile_cellular);
return 0;
}
- int ret = connection_get_default_cellular_service_profile(connection, service_type, &profile_cellular);
+ connection_cellular_state_e state;
+ int ret = connection_get_cellular_state(connection, &state);
+ assert_eq(ret, CONNECTION_ERROR_NONE);
+ if (state == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE)
+ return 0;
+
+ ret = connection_get_default_cellular_service_profile(connection, service_type, &profile_cellular);
assert_eq(ret, CONNECTION_ERROR_NONE);
ret = connection_set_default_cellular_service_profile_async(connection, service_type, profile_cellular, test_connection_set_default_callback, NULL);