Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[android] Make sure android usb is enabled on usb-moded startup. JB#3…
…5683

If android usb is in enable=0 state, cable detection is persistently
broken as the existing workarounds in usb-moded are made when cable
disconnect is detected and that can't happen unless cable detect works.

Enable android usb on usb-moded startup.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Jul 7, 2016
1 parent 358b23d commit 750ce66
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/usb_moded-android.c
Expand Up @@ -81,6 +81,10 @@ void android_init_values(void)
}
/* For rndis to be discovered correctly in M$ Windows (vista and later) */
write_to_file("/sys/class/android_usb/f_rndis/wceis", "1");

/* Make sure android_usb does not stay disabled in case usb moded
* has crashed / been killed in inconvenient time. */
write_to_file("/sys/class/android_usb/android0/enable", "1");
}

/* Set a charging mode for the android gadget
Expand Down

0 comments on commit 750ce66

Please sign in to comment.