From 358b23d673ba27d8e67236dcc4120838120580e8 Mon Sep 17 00:00:00 2001 From: Simo Piiroinen Date: Wed, 6 Jul 2016 16:38:40 +0300 Subject: [PATCH] [modesetting] Do not leave android usb disabled after unsetting mode. JB#35683 Seems that just writing enable=0 functions=none leaves the android usb in some sort of limbo where cable detection does not work until enable=1 write is also made. Do enable=1 write after clearing functions on cable disconnect. Signed-off-by: Simo Piiroinen --- src/usb_moded-modesetting.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/usb_moded-modesetting.c b/src/usb_moded-modesetting.c index 33bbad5..61e2eb1 100644 --- a/src/usb_moded-modesetting.c +++ b/src/usb_moded-modesetting.c @@ -541,6 +541,12 @@ void unset_dynamic_mode(void) set_android_vendorid(id); g_free(id); } + + /* enable after the changes have been made */ + if(data->softconnect) + { + write_to_file(data->softconnect_path, data->softconnect); + } } /** clean up mode changes or extra actions to perform after a mode change