Diff between c4f68e776a7e20cae059805cec073dd8f7546b8d and 0ec92aa4fea60c6baeb314c597d8c5b42765ef08

Changed Files

File Additions Deletions Status
src/device.c +8 -20 modified

Full Patch

diff --git a/src/device.c b/src/device.c
index 29518bd..8f82203 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2434,23 +2434,6 @@ static void device_remove_profiles(struct btd_device *device, GSList *uuids)
 	}
 }
 
-static void uuids_changed(struct btd_device *device)
-{
-	char **uuids;
-	GSList *l;
-	int i;
-
-	uuids = g_new0(char *, g_slist_length(device->uuids) + 1);
-	for (i = 0, l = device->uuids; l; l = l->next, i++)
-		uuids[i] = l->data;
-
-	emit_array_property_changed(device->path,
-					DEVICE_INTERFACE, "UUIDs",
-					DBUS_TYPE_STRING, &uuids, i);
-
-	g_free(uuids);
-}
-
 static void store_sdp_record(GKeyFile *key_file, sdp_record_t *rec)
 {
 	char handle_str[11];
@@ -2795,7 +2778,9 @@ static void search_cb(sdp_list_t *recs, int err, gpointer user_data)
 		device_remove_profiles(device, req->profiles_removed);
 
 	/* Propagate services changes */
-	uuids_changed(req->device);
+	g_dbus_emit_property_changed(btd_get_dbus_connection(),
+					req->device->path, DEVICE_INTERFACE,
+					"UUIDs");
 
 send_reply:
 	device_svc_resolved(device, err);
@@ -2958,7 +2943,8 @@ static void register_all_services(struct browse_req *req, GSList *services)
 	if (device->attios == NULL && device->attios_offline == NULL)
 		attio_cleanup(device);
 
-	uuids_changed(device);
+	g_dbus_emit_property_changed(btd_get_dbus_connection(), device->path,
+						DEVICE_INTERFACE, "UUIDs");
 
 	device_svc_resolved(device, 0);
 
@@ -4069,7 +4055,9 @@ void btd_device_add_uuid(struct btd_device *device, const char *uuid)
 	g_slist_free(uuid_list);
 
 	store_device_info(device);
-	uuids_changed(device);
+
+	g_dbus_emit_property_changed(btd_get_dbus_connection(), device->path,
+						DEVICE_INTERFACE, "UUIDs");
 }
 
 static sdp_list_t *read_device_records(struct btd_device *device)