[PATCH BlueZ] profiles/battery: Reset battery value cache on disconnect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Due to cache in batt object, bluetoothd fails to update publish the
battery value after reconnection when the battery value does not change
compared to before reconnection. We should reset the battery percentage
cache on disconnect.

Reviewed-by: Alain Michaud <alainm@xxxxxxxxxxxx>

---
 profiles/battery/battery.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/profiles/battery/battery.c b/profiles/battery/battery.c
index 81f849d57..176d127f6 100644
--- a/profiles/battery/battery.c
+++ b/profiles/battery/battery.c
@@ -75,6 +75,7 @@ static void batt_free(struct batt *batt)
 static void batt_reset(struct batt *batt)
 {
 	batt->attr = NULL;
+	batt->percentage = -1;
 	gatt_db_unref(batt->db);
 	batt->db = NULL;
 	bt_gatt_client_unref(batt->client);
-- 
2.29.2




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux