From dde42ce2517c6cc84f767202d4a780bd2715bd07 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 30 Dec 2012 00:51:28 -0800 Subject: [PATCH] core: Force reset of class of device property on power down The kernel resets the class of device on power down, but it forgets to actually tell userspace about. Until this gets fixed force the reset of the class of device property. --- src/adapter.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index fc7c63811..2c11efb68 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1786,6 +1786,14 @@ int btd_adapter_stop(struct btd_adapter *adapter) g_dbus_emit_property_changed(conn, adapter->path, ADAPTER_INTERFACE, "Discovering"); + if (adapter->dev_class) { + /* the kernel should reset the class of device when powering + * down, but it does not. So force it here ... */ + adapter->dev_class = 0; + g_dbus_emit_property_changed(conn, adapter->path, + ADAPTER_INTERFACE, "Class"); + } + g_dbus_emit_property_changed(conn, adapter->path, ADAPTER_INTERFACE, "Powered"); -- 2.47.3