From fab849d1daed0ba7f2ac497d07985c3dbb692543 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 16 Jun 2019 21:23:20 +0100 Subject: gentoo resync : 16.06.2019 --- .../bluez/files/bluez-5.50-sink-connect.patch | 72 ++++++++++++++++++++++ .../bluez/files/bluez-udevadm-path-r1.patch | 10 +++ 2 files changed, 82 insertions(+) create mode 100644 net-wireless/bluez/files/bluez-5.50-sink-connect.patch create mode 100644 net-wireless/bluez/files/bluez-udevadm-path-r1.patch (limited to 'net-wireless/bluez/files') diff --git a/net-wireless/bluez/files/bluez-5.50-sink-connect.patch b/net-wireless/bluez/files/bluez-5.50-sink-connect.patch new file mode 100644 index 000000000000..2093b69a6554 --- /dev/null +++ b/net-wireless/bluez/files/bluez-5.50-sink-connect.patch @@ -0,0 +1,72 @@ +From 477ecca127c529611adbc53f08039cefaf86305d Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Tue, 26 Jun 2018 13:37:33 +0300 +Subject: policy: Add logic to connect a Sink + +If HFP/HSP HS connects and the device also supports a Sink connect it +as well since some devices (e.g. Sony MW600) may not connect it +automatically. +--- + plugins/policy.c | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +diff --git a/plugins/policy.c b/plugins/policy.c +index 1f5a506a2..de51e58b9 100644 +--- a/plugins/policy.c ++++ b/plugins/policy.c +@@ -297,6 +297,42 @@ static void sink_cb(struct btd_service *service, btd_service_state_t old_state, + } + } + ++static void hs_cb(struct btd_service *service, btd_service_state_t old_state, ++ btd_service_state_t new_state) ++{ ++ struct btd_device *dev = btd_service_get_device(service); ++ struct policy_data *data; ++ struct btd_service *sink; ++ ++ /* If the device supports Sink set a timer to connect it as well */ ++ sink = btd_device_get_service(dev, A2DP_SINK_UUID); ++ if (sink == NULL) ++ return; ++ ++ data = policy_get_data(dev); ++ ++ switch (new_state) { ++ case BTD_SERVICE_STATE_UNAVAILABLE: ++ break; ++ case BTD_SERVICE_STATE_DISCONNECTED: ++ break; ++ case BTD_SERVICE_STATE_CONNECTING: ++ break; ++ case BTD_SERVICE_STATE_CONNECTED: ++ /* Check if service initiate the connection then proceed ++ * immediately otherwise set timer ++ */ ++ if (old_state == BTD_SERVICE_STATE_CONNECTING) ++ policy_connect(data, sink); ++ else if (btd_service_get_state(sink) != ++ BTD_SERVICE_STATE_CONNECTED) ++ policy_set_sink_timer(data); ++ break; ++ case BTD_SERVICE_STATE_DISCONNECTING: ++ break; ++ } ++} ++ + static gboolean policy_connect_tg(gpointer user_data) + { + struct policy_data *data = user_data; +@@ -615,6 +651,9 @@ static void service_cb(struct btd_service *service, + controller_cb(service, old_state, new_state); + else if (g_str_equal(profile->remote_uuid, AVRCP_TARGET_UUID)) + target_cb(service, old_state, new_state); ++ else if (g_str_equal(profile->remote_uuid, HFP_HS_UUID) || ++ g_str_equal(profile->remote_uuid, HSP_HS_UUID)) ++ hs_cb(service, old_state, new_state); + + /* + * Return if the reconnection feature is not enabled (all +-- +cgit 1.2-0.3.lf.el7 + diff --git a/net-wireless/bluez/files/bluez-udevadm-path-r1.patch b/net-wireless/bluez/files/bluez-udevadm-path-r1.patch new file mode 100644 index 000000000000..ac1c94ccd219 --- /dev/null +++ b/net-wireless/bluez/files/bluez-udevadm-path-r1.patch @@ -0,0 +1,10 @@ +--- a/tools/hid2hci.rules ++++ b/tools/hid2hci.rules +@@ -20,6 +20,7 @@ + # Unfortunately the only event seen is the BT device disappearing, so the mouse + # device needs to be chased down on the USB bus. + ATTR{bDeviceClass}=="e0", ATTR{bDeviceSubClass}=="01", ATTR{bDeviceProtocol}=="01", ATTR{idVendor}=="413c", \ ++ ENV{REMOVE_CMD}="/bin/udevadm trigger --action=change --subsystem-match=usb --property-match=HID2HCI_SWITCH=1" \ + ENV{REMOVE_CMD}="/sbin/udevadm trigger --action=change --subsystem-match=usb --property-match=HID2HCI_SWITCH=1" + + # CSR devices -- cgit v1.2.3