diff mbox series

[BlueZ] adapter: battery provider for non-LE controllers

Message ID 20220212084541.221196-1-daniel.trnka@gmail.com
State New
Headers show
Series [BlueZ] adapter: battery provider for non-LE controllers | expand

Commit Message

Daniel Trnka Feb. 12, 2022, 8:45 a.m. UTC
Enable battery provider dbus interface BatteryProviderManager1 for
non-LE controllers, so external clients like pipewire can provide
battery information for bluetooth headsets on non-LE controllers.
---
 src/adapter.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/src/adapter.c b/src/adapter.c
index eef50f67a..2071cf8db 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -8976,6 +8976,11 @@  static int adapter_register(struct btd_adapter *adapter)
 		agent_unref(agent);
 	}
 
+	if (g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL) {
+		adapter->battery_provider_manager =
+			btd_battery_provider_manager_create(adapter);
+	}
+
 	/* Don't start GATT database and advertising managers on
 	 * non-LE controllers.
 	 */
@@ -9010,11 +9015,6 @@  static int adapter_register(struct btd_adapter *adapter)
 		}
 	}
 
-	if (g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL) {
-		adapter->battery_provider_manager =
-			btd_battery_provider_manager_create(adapter);
-	}
-
 	db = btd_gatt_database_get_db(adapter->database);
 	adapter->db_id = gatt_db_register(db, services_modified,
 							services_modified,