Skip to content

Commit

Permalink
Merge branch 'mer1677_cable_to_charger' into 'master'
Browse files Browse the repository at this point in the history
Cancel mode selection when charger is detected



See merge request !15
  • Loading branch information
spiiroin committed Oct 18, 2016
2 parents b70f679 + b1d7a18 commit 8714bf4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/usb_moded-udev.c
Expand Up @@ -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);
Expand Down

0 comments on commit 8714bf4

Please sign in to comment.