- if (connection_set_default_cellular_service_profile(connection, type, profile) != CONNECTION_ERROR_NONE)
- return -1;
+ if (input == 1) {
+ if (connection_set_default_cellular_service_profile(connection, type, profile) != CONNECTION_ERROR_NONE)
+ return -1;
+ } else {
+ if (connection_set_default_cellular_service_profile_async(connection,
+ type, profile, test_connection_set_default_callback, NULL) != CONNECTION_ERROR_NONE)
+ return -1;
+ }