Hello community,

here is the log from the commit of package bluez for openSUSE:Factory checked 
in at 2019-05-03 22:07:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/bluez (Old)
 and      /work/SRC/openSUSE:Factory/.bluez.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "bluez"

Fri May  3 22:07:03 2019 rev:161 rq:698654 version:5.50

Changes:
--------
--- /work/SRC/openSUSE:Factory/bluez/bluez.changes      2019-04-17 
10:03:20.426426178 +0200
+++ /work/SRC/openSUSE:Factory/.bluez.new.5148/bluez.changes    2019-05-03 
22:07:05.850879001 +0200
@@ -1,0 +2,6 @@
+Wed Apr 24 17:43:18 UTC 2019 - Michal Suchanek <msucha...@suse.de>
+
+- Connect Sink profile which HSP profile connects (boo#1131772).
+  - Add 0001-policy-Add-logic-to-connect-a-Sink.patch
+
+-------------------------------------------------------------------

New:
----
  0001-policy-Add-logic-to-connect-a-Sink.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ bluez.spec ++++++
--- /var/tmp/diff_new_pack.03USMW/_old  2019-05-03 22:07:06.474880198 +0200
+++ /var/tmp/diff_new_pack.03USMW/_new  2019-05-03 22:07:06.474880198 +0200
@@ -38,6 +38,8 @@
 Patch5:         0001-obexd-use-AM_LDFLAGS-for-linking.patch
 # disable tests for bypass boo#1078285
 Patch6:         disable_some_obex_tests.patch
+# PATCH-FIX-UPSTREAM: improve profile availability on some audio devices
+Patch7:         0001-policy-Add-logic-to-connect-a-Sink.patch
 # Upstream suggests to use btmon instead of hcidump and does not want those 
patches
 # => PATCH-FIX-OPENSUSE for those two :-)
 # fix some memory leak with malformed packet (reported upstream but not yet 
fixed)
@@ -157,6 +159,7 @@
 %ifarch ppc ppc64 ppc64le
 %patch6 -p1
 %endif
+%patch7 -p1
 %patch101 -p1
 %patch102 -p1
 mkdir dbus-apis

++++++ 0001-policy-Add-logic-to-connect-a-Sink.patch ++++++
>From 477ecca127c529611adbc53f08039cefaf86305d Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.von.de...@intel.com>
Date: Tue, 26 Jun 2018 13:37:33 +0300
Subject: [PATCH] policy: Add logic to connect a Sink

References: boo#1131772
Patch-mainline: 5.51
Git-commit: 477ecca127c529611adbc53f08039cefaf86305d

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.
Acked-by: Michal Suchanek <msucha...@suse.de>
---
 plugins/policy.c | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/plugins/policy.c b/plugins/policy.c
index 1f5a506a2c2f..de51e58b91dc 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
-- 
2.20.1


Reply via email to