Skip to content

Commit 08eadea

Browse files
uos-engZeno-sole
authored andcommitted
fix: Fix airpods pairing and main conf for connection.
1 parent 7eadaa6 commit 08eadea

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
bluez (5.71-1deepin3) unstable; urgency=medium
2+
3+
* fix: Fix main conf for connection.
4+
* Fix airpods pairing.
5+
6+
-- zhaochengyi <zhaochengyi@uniontech.com> Sat, 14 Dec 2024 16:35:09 +0800
7+
18
bluez (5.71-1deepin2) unstable; urgency=medium
29

310
* Change the service startup program to use a shell script.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From 98bed16d254c3f1b2075290c69e74749d08c39b4 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= <frederic.danis@collabora.com>
3+
Date: Fri, 5 Apr 2024 11:00:50 +0200
4+
Subject: [PATCH] device: Fix airpods pairing
5+
6+
Apple Airpods are discoverable and pairable in BREDR mode, but also
7+
advertise in unconnectable mode in LE with the same Public address, at the
8+
same time. As the pairing process uses the latest seen address, sometimes
9+
it uses the LE Public address to pair, which fails.
10+
11+
This commit introduces the connectable state when selecting the bearer to
12+
use for a connection. The last_seen value is used only for connectable
13+
devices.
14+
---
15+
src/device.c | 4 ++--
16+
1 file changed, 2 insertions(+), 2 deletions(-)
17+
18+
diff --git a/src/device.c b/src/device.c
19+
index ac0b0e003..1d4b8ab36 100644
20+
--- a/src/device.c
21+
+++ b/src/device.c
22+
@@ -2537,13 +2537,13 @@ static uint8_t select_conn_bearer(struct btd_device *dev)
23+
if (dev->bdaddr_type == BDADDR_LE_RANDOM)
24+
return dev->bdaddr_type;
25+
26+
- if (dev->bredr_state.last_seen) {
27+
+ if (dev->bredr_state.connectable && dev->bredr_state.last_seen) {
28+
bredr_last = current - dev->bredr_state.last_seen;
29+
if (bredr_last > SEEN_TRESHHOLD)
30+
bredr_last = NVAL_TIME;
31+
}
32+
33+
- if (dev->le_state.last_seen) {
34+
+ if (dev->le_state.connectable && dev->le_state.last_seen) {
35+
le_last = current - dev->le_state.last_seen;
36+
if (le_last > SEEN_TRESHHOLD)
37+
le_last = NVAL_TIME;
38+
--
39+
2.20.1
40+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From e4b8fb410768d505ebb79e7f26bfc037337ea2f6 Mon Sep 17 00:00:00 2001
2+
From: Chengyi Zhao <zhaochengyi@uniontech.com>
3+
Date: Sat, 14 Dec 2024 15:57:06 +0800
4+
Subject: [PATCH] fix: Fix main conf for connection
5+
6+
---
7+
src/main.conf | 4 ++--
8+
1 file changed, 2 insertions(+), 2 deletions(-)
9+
10+
diff --git a/src/main.conf b/src/main.conf
11+
index 35dccce..d0d54cb 100644
12+
--- a/src/main.conf
13+
+++ b/src/main.conf
14+
@@ -12,7 +12,7 @@
15+
# How long to stay in discoverable mode before going back to non-discoverable
16+
# The value is in seconds. Default is 180, i.e. 3 minutes.
17+
# 0 = disable timer, i.e. stay discoverable forever
18+
-#DiscoverableTimeout = 0
19+
+DiscoverableTimeout = 0
20+
21+
# Always allow pairing even if there are no agent registered
22+
# Possible values: true, false
23+
@@ -68,7 +68,7 @@
24+
# however the tradeoff is increased power consumptions. This feature
25+
# will fully work only on kernel version 4.1 and newer. Defaults to
26+
# 'false'.
27+
-#FastConnectable = false
28+
+FastConnectable = true
29+
30+
# Default privacy setting.
31+
# Enables use of private address.
32+
--
33+
2.20.1
34+

debian/patches/series

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ Change-shebang-from-usr-bin-python-to-usr-bin-python.patch
1414
Add-HCI_TO_STR-macro-for-FIRMWARE_DIR.patch
1515
uniontech-add-custom-config-for-huawei.patch
1616
uniontech-add-sh-for-debug.patch
17+
deepin-bug282163-Fix-airpods-pairing.patch
18+
deepin-bug282163-Fix-main-conf-for-connection.patch
19+

0 commit comments

Comments
 (0)