From b0a76d0c90a54830727494b16f84c8ddda755665 Mon Sep 17 00:00:00 2001 From: Philippe De Swert Date: Thu, 22 Aug 2013 16:33:35 +0300 Subject: [PATCH] Use mass_storage also as fake charging mode with android gadget Seems an empty android gadget only enumerates if some configuration had been used before. Fix this by using mass_storage to make a similar fake mass_storage device as used with normal modules. [usb-moded] Use fake mass_storage for android gadget charging mode. Fixes: JB#8277 Signed-off-by: Philippe De Swert --- src/usb_moded-android.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usb_moded-android.c b/src/usb_moded-android.c index 5775a7e..30590e9 100644 --- a/src/usb_moded-android.c +++ b/src/usb_moded-android.c @@ -89,9 +89,9 @@ int set_android_charging_mode(void) { int ret = 0; - /* disable, set functions to "null", re-enable */ + /* disable, set functions to "mass_storage", re-enable */ write_to_file("/sys/class/android_usb/android0/enable", "0"); - write_to_file("/sys/class/android_usb/android0/functions", "null"); + write_to_file("/sys/class/android_usb/android0/functions", "mass_storage"); ret = write_to_file("/sys/class/android_usb/android0/enable", "1"); if(ret < 0) return(1);