Skip to content

Commit

Permalink
battery: mark all battery DBus APIs non-experimental
Browse files Browse the repository at this point in the history
Remove experimental marker from BatteryProvider1 and Battery1.Source.

It's common that headsets send battery information via HFP, and often
this is also the only way to get it. Pipewire/pulseaudio manage HFP,
parse the battery commands, and use the BatteryProvider API if present
to forward it. No problems with the API appeared here, and it's been
experimental for a few years, so it's useful to enable it by default
now.
  • Loading branch information
pv authored and Vudentz committed Oct 5, 2023
1 parent a56bc5e commit 495a582
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -9286,10 +9286,8 @@ 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);
}
adapter->battery_provider_manager =
btd_battery_provider_manager_create(adapter);

/* Don't start GATT database and advertising managers on
* non-LE controllers.
Expand Down
7 changes: 3 additions & 4 deletions src/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ static gboolean property_source_exists(const GDBusPropertyTable *property,
static const GDBusPropertyTable battery_properties[] = {
{ "Percentage", "y", property_percentage_get, NULL,
property_percentage_exists },
{ "Source", "s", property_source_get, NULL, property_source_exists,
G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
{ "Source", "s", property_source_get, NULL, property_source_exists },
{}
};

Expand Down Expand Up @@ -523,10 +522,10 @@ static DBusMessage *unregister_battery_provider(DBusConnection *conn,
}

static const GDBusMethodTable methods[] = {
{ GDBUS_EXPERIMENTAL_METHOD("RegisterBatteryProvider",
{ GDBUS_METHOD("RegisterBatteryProvider",
GDBUS_ARGS({ "provider", "o" }), NULL,
register_battery_provider) },
{ GDBUS_EXPERIMENTAL_METHOD("UnregisterBatteryProvider",
{ GDBUS_METHOD("UnregisterBatteryProvider",
GDBUS_ARGS({ "provider", "o" }), NULL,
unregister_battery_provider) },
{}
Expand Down

0 comments on commit 495a582

Please sign in to comment.