闲来无事,不如加班,顺手解决一个bug
没啥技术含量,所以才放心写篇blog
公司自制android手机不能模拟成gadget u盘,报错
- D/VoldCmdListener( 981): volume share /mnt/sdcard ums
-
E/Vold ( 981): Unable to open ums lunfile (No such file or directory)
-
D/VoldConnector( 1046): RCV <- {406 volume operation failed (No such file or directory)}
-
D/VoldConnector( 1046): RSP <- {406 volume operation failed (No such file or directory)}
-
E/MountService( 1046): Failed to share/unshare
-
E/MountService( 1046): com.android.server.NativeDaemonConnectorException: Cmd {volume share /mnt/sdcard ums} failed with code 406 : {volume operation failed (No such file or directory)}
-
E/MountService( 1046): at com.android.server.NativeDaemonConnector.doCommand(NativeDaemonConnector.java:247)
-
E/MountService( 1046): at com.android.server.MountService.doShareUnshareVolume(MountService.java:366)
-
E/MountService( 1046): at com.android.server.MountService.access$100(MountService.java:51)
-
E/MountService( 1046): at com.android.server.MountService$UmsEnableCallBack.handleFinished(MountService.java:167)
-
E/MountService( 1046): at com.android.server.MountService$MountServiceHandler.handleMessage(MountService.java:270)
-
E/MountService( 1046): at android.os.Handler.dispatchMessage(Handler.java:99)
-
E/MountService( 1046): at android.os.Looper.loop(Looper.java:123)
-
E/MountService( 1046): at android.os.HandlerThread.run(HandlerThread.java:60)
-
^C
跟踪到./system/vold/VolumeManager.cpp 中有2处
- if ((fd = open("/sys/devices/platform/usb_mass_storage/lun0/file",
-
O_WRONLY)) < 0) {
-
SLOGE("Unable to open ums lunfile (%s)", strerror(errno));
-
return -1;
-
}
检查发现/sys/devices/platform/usb_mass_storage/lun0/file 这玩意还真没有
折腾一圈,觉得生成这个文件的USB_ANDROID_ADB_UMS驱动不会有问题
在/sys下执行find . -name lun0 ,揪出来真正的位置
/sys/devices/platform/s3c-hsotg/gadget/lun0/file
修改VolumeManager.cpp ,收工
阅读(3141) | 评论(0) | 转发(0) |