+int __connman_profile_set_carrier(struct connman_device *device,
+ connman_bool_t carrier)
+{
+ struct connman_group *group;
+ char *name;
+
+ DBG("device %p carrier %d", device, carrier);
+
+ name = g_strdup_printf("%s_%d", __connman_device_get_type(device),
+ connman_device_get_index(device));
+ group = lookup_group(name);
+ g_free(name);
+
+ if (group == NULL)
+ return -EINVAL;
+
+ if (group->favorite == carrier)
+ return -EALREADY;
+
+ group->favorite = carrier;
+
+ g_sequence_sort_changed(group->iter, compare_group, NULL);
+ emit_services_signal();
+
+ return 0;
+}
+