Merge ~dirksu/bluez:plucky into ~bluetooth/bluez:plucky

Proposed by Dirk Su
Status: Merged
Merged at revision: da299e73493c8e00c065a530abd2fb8180ad1611
Proposed branch: ~dirksu/bluez:plucky
Merge into: ~bluetooth/bluez:plucky
Diff against target: 150 lines (+29/-92)
4 files modified
debian/changelog (+10/-0)
debian/patches/cleanup-endpoints-when-devices-been-removed.patch (+18/-0)
debian/patches/series (+1/-1)
dev/null (+0/-91)
Reviewer Review Type Date Requested Status
Bluetooth Pending
Review via email: mp+492663@code.launchpad.net

Commit message

Update merged patch to reflect the upstream commit changes

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index cd13323..ceda2ac 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,13 @@
6+bluez (5.79-2ubuntu1.3) plucky; urgency=medium
7+
8+ [ Dirk Su ]
9+ * Improve audio profiles compatibility (LP: #2122382)
10+ d/patches: audio-upgrade-versions-to-latest-possible-to-qualify.patch
11+ d/patches: cleanup-endpoints-when-devices-been-removed.patch
12+ d/patches: profiles-avdtp-Fix-reply-for-bad-media-transport-for.patch
13+
14+ -- Dirk Su <dirk.su@canonical.com> Wed, 17 Sep 2025 11:38:49 +0800
15+
16 bluez (5.79-2ubuntu1.2) plucky; urgency=medium
17
18 [ Dirk Su ]
19diff --git a/debian/patches/a2dp-Remove-Endpoints-cache-entries-on-device-remova.patch b/debian/patches/a2dp-Remove-Endpoints-cache-entries-on-device-remova.patch
20deleted file mode 100644
21index ca376c1..0000000
22--- a/debian/patches/a2dp-Remove-Endpoints-cache-entries-on-device-remova.patch
23+++ /dev/null
24@@ -1,91 +0,0 @@
25-From ea3f4047e452b081e34d017cce316aba9d623301 Mon Sep 17 00:00:00 2001
26-From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= <frederic.danis@collabora.com>
27-Date: Mon, 17 Feb 2025 12:48:02 +0100
28-Subject: [PATCH] a2dp: Remove Endpoints cache entries on device removal
29-
30-When a device is removed, currently the endpoints and last used info
31-are kept in cache:
32- [General]
33- Name=Frederic's Phone
34-
35- [Endpoints]
36- 01=00:00:01:29f50235
37- 02=00:02:01:80010484e200
38- LastUsed=01:02
39-
40-This may prevent future connection, after a new pairing, to use the
41-best codec available.
42-
43-Bug-Ubuntu: https://bugs.launchpad.net/bugs/2122382
44----
45- profiles/audio/a2dp.c | 40 ++++++++++++++++++++++++++++++++++++++++
46- 1 file changed, 40 insertions(+)
47-
48-diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
49-index 0eac151db..81dbbfae3 100644
50---- a/profiles/audio/a2dp.c
51-+++ b/profiles/audio/a2dp.c
52-@@ -880,6 +880,44 @@ static void store_remote_seps(struct a2dp_channel *chan)
53- g_key_file_free(key_file);
54- }
55-
56-+static void remove_endpoints_cache(struct btd_service *service)
57-+{
58-+ struct btd_device *device = btd_service_get_device(service);
59-+ char filename[PATH_MAX];
60-+ char dst_addr[18];
61-+ GKeyFile *key_file;
62-+ GError *gerr = NULL;
63-+ char *data;
64-+ gsize length = 0;
65-+
66-+ ba2str(device_get_address(device), dst_addr);
67-+
68-+ create_filename(filename, PATH_MAX, "/%s/cache/%s",
69-+ btd_adapter_get_storage_dir(device_get_adapter(device)),
70-+ dst_addr);
71-+
72-+ key_file = g_key_file_new();
73-+ if (!g_key_file_load_from_file(key_file, filename, 0, &gerr)) {
74-+ g_error_free(gerr);
75-+ g_key_file_free(key_file);
76-+ return;
77-+ }
78-+ g_key_file_remove_group(key_file, "Endpoints", NULL);
79-+
80-+ data = g_key_file_to_data(key_file, &length, NULL);
81-+ if (length > 0) {
82-+ create_file(filename, 0600);
83-+ if (!g_file_set_contents(filename, data, length, &gerr)) {
84-+ error("Unable set contents for %s: (%s)", filename,
85-+ gerr->message);
86-+ g_error_free(gerr);
87-+ }
88-+ }
89-+
90-+ g_free(data);
91-+ g_key_file_free(key_file);
92-+}
93-+
94- static void invalidate_remote_cache(struct a2dp_setup *setup,
95- struct avdtp_error *err)
96- {
97-@@ -3352,6 +3390,7 @@ static int a2dp_source_probe(struct btd_service *service)
98- static void a2dp_source_remove(struct btd_service *service)
99- {
100- source_unregister(service);
101-+ remove_endpoints_cache(service);
102- }
103-
104- static int a2dp_sink_probe(struct btd_service *service)
105-@@ -3366,6 +3405,7 @@ static int a2dp_sink_probe(struct btd_service *service)
106- static void a2dp_sink_remove(struct btd_service *service)
107- {
108- sink_unregister(service);
109-+ remove_endpoints_cache(service);
110- }
111-
112- static int a2dp_source_connect(struct btd_service *service)
113---
114-2.43.0
115-
116diff --git a/debian/patches/cleanup-endpoints-when-devices-been-removed.patch b/debian/patches/cleanup-endpoints-when-devices-been-removed.patch
117new file mode 100644
118index 0000000..00400a7
119--- /dev/null
120+++ b/debian/patches/cleanup-endpoints-when-devices-been-removed.patch
121@@ -0,0 +1,18 @@
122+Description: Cleanup endpoints when device been removed
123+ This patch merge two upstream commit
124+ https://github.com/bluez/bluez/commit/ea3f4047e452b081e34d017cce316aba9d623301
125+ https://github.com/bluez/bluez/commit/78aabd896dbe3e23faaebbc97b8ecd711b2502fc
126+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2122382
127+---
128+Index: bluez-5.72/src/device.c
129+===================================================================
130+--- bluez-5.72.orig/src/device.c 2025-09-16 16:02:14.000000000 +0800
131++++ bluez-5.72/src/device.c 2025-09-16 16:03:12.615527575 +0800
132+@@ -4645,6 +4645,7 @@
133+ }
134+ g_key_file_remove_group(key_file, "ServiceRecords", NULL);
135+ g_key_file_remove_group(key_file, "Attributes", NULL);
136++ g_key_file_remove_group(key_file, "Endpoints", NULL);
137+
138+ data = g_key_file_to_data(key_file, &length, NULL);
139+ if (length > 0) {
140diff --git a/debian/patches/series b/debian/patches/series
141index 484b084..8ba7060 100644
142--- a/debian/patches/series
143+++ b/debian/patches/series
144@@ -16,5 +16,5 @@ raspi-bcm43xx-3wire.patch
145 ubuntu_error_restart.patch
146 reconnect-hsp-on-a2dp-reconnect.patch
147 profiles-avdtp-Fix-reply-for-bad-media-transport-for.patch
148-a2dp-Remove-Endpoints-cache-entries-on-device-remova.patch
149+cleanup-endpoints-when-devices-been-removed.patch
150 audio-upgrade-versions-to-latest-possible-to-qualify.patch

Subscribers

People subscribed via source and target branches

to all changes: