From: Chan-yeol Park <chanyeol.park@xxxxxxxxxxx> This patch fixes the problem that storage's Discoverable value is not updated like hciconfig when BlueZ receives the MGMT adapter mode changed event after DiscoverableTimeout has been expired. This problem occurs because no longer bluetoothd does not take on requesting part to disable discoverable when the timer expires. --- src/adapter.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index 69ec821..7d06633 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2249,6 +2249,11 @@ static void set_mode_complete(struct btd_adapter *adapter) adapter->mode_sessions = NULL; } + modestr = mode2str(adapter->mode); + write_device_mode(&adapter->bdaddr, modestr); + + DBG("%s", modestr); + if (adapter->pending_mode == NULL) return; @@ -2273,16 +2278,6 @@ static void set_mode_complete(struct btd_adapter *adapter) g_dbus_send_message(connection, reply); } - modestr = mode2str(adapter->mode); - - DBG("%s", modestr); - - /* restore if the mode doesn't matches the pending */ - if (err != 0) { - write_device_mode(&adapter->bdaddr, modestr); - error("unable to set mode: %s", mode2str(pending->mode)); - } - session_unref(pending); } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html