Skip to content
Permalink
Browse files
Merge branch 'mer1677_cable_to_charger' into 'master'
Cancel mode selection when charger is detected



See merge request !15
  • Loading branch information
spiiroin committed Oct 18, 2016
2 parents b70f679 + b1d7a18 commit 8714bf4d720d67e521eea0efed152edfb4e35f35
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/usb_moded-udev.c
@@ -311,6 +311,20 @@ static void setup_charger_connection(void)
cancel_cable_connection_timeout();

log_debug("UDEV:USB dedicated charger connected\n");

if (cable) {
/* The connection was initially reported incorrectly
* as pc cable, then later on declared as charger.
*
* Clear "connected" boolean flag so that the
* set_charger_connected() call below acts as if charger
* were detected already on connect: mode gets declared
* as dedicated charger (and the mode selection dialog
* shown by ui gets closed).
*/
set_usb_connection_state(FALSE);
}

charger = 1;
cable = 0;
set_charger_connected(TRUE);

0 comments on commit 8714bf4

Please sign in to comment.