From e6c5ae726f46f5cb76977dd974d42c91ee99a5cf Mon Sep 17 00:00:00 2001 From: Philippe De Swert Date: Mon, 12 Jan 2015 16:40:14 +0200 Subject: [PATCH] [debouncing] Improve debouncing to avoid missing signals. Fixes: JB#25557 In some border line cases there can be issues with signals not being sent. This is the case when a charger gets identified as cable and later on correctly as a dedicated charger. We make sure we actually compare the set state instead of just relying on connected state only. Signed-off-by: Philippe De Swert --- src/usb_moded.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usb_moded.c b/src/usb_moded.c index be87090..4b7d49c 100644 --- a/src/usb_moded.c +++ b/src/usb_moded.c @@ -105,7 +105,7 @@ void set_usb_connected(gboolean connected) spurious load/unloads due to faulty signalling NOKIA: careful with devicelock */ - if(current_mode.connected) + if(current_mode.connected == connected) return; #ifdef NOKIA @@ -194,7 +194,7 @@ void set_charger_connected(gboolean state) { /* check if charger is already connected to avoid spamming dbus */ - if(current_mode.connected) + if(current_mode.connected == state) return; if(state)