androidthings / sample-usbenum Goto Github PK
View Code? Open in Web Editor NEWDiscover connected devices using the Android USB Host APIs
License: Apache License 2.0
Discover connected devices using the Android USB Host APIs
License: Apache License 2.0
When I connect a device to my ASUS Zenfone ZB500KL (Android 6.0.1), no devices are discovered. When working with another mobile, everything is fine.
I enclosed my error log.
usbenum error log.txt
The sample app crashes when an Arduino Yun is connected to the Raspberry Pi running Android Things.
Log
FATAL EXCEPTION: main
Process: com.example.androidthings.usbenum, PID: 7369
java.lang.ArrayIndexOutOfBoundsException: length=64; index=64
at com.example.androidthings.usbenum.ConfigurationDescriptor.parseResponse(ConfigurationDescriptor.java:125)
at com.example.androidthings.usbenum.ConfigurationDescriptor.fromDeviceConnection(ConfigurationDescriptor.java:54)
at com.example.androidthings.usbenum.UsbActivity.printDeviceDetails(UsbActivity.java:155)
at com.example.androidthings.usbenum.UsbActivity.handleIntent(UsbActivity.java:96)
at com.example.androidthings.usbenum.UsbActivity.onNewIntent(UsbActivity.java:61)
at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1223)
at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1235)
at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:2783)
at android.app.ActivityThread.performNewIntents(ActivityThread.java:2795)
at android.app.ActivityThread.handleNewIntent(ActivityThread.java:2804)
at android.app.ActivityThread.-wrap15(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1539)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
This probably isn't a defect but more of a issue with Android's USB system. If you plug a OTG adapter into a phone and then connect a USB powered hub, the hub won't be detected, but devices connected to the hub will be.
I'm encountering difficulties establishing communication between two Android devices, where one is designated as the host and the other as the accessory. I attempted to utilize the usb-serial-for-android library on one device and connected the two devices using a wired connection. However, I'm facing issues in establishing a connection and facilitating communication between the devices.
My setup
Running the app, after upgrading ext.kotlin_version
to 1.3.50
to make it build, just gives me empty device list when it's connected with a USB cable to a macOS with Android Studio 3.5.3 installed.
Here is my adb logcat
2019-12-26 18:08:40.435 10616-10616/? I/dthings.usbenu: Late-enabling -Xcheck:jni
2019-12-26 18:08:40.536 10616-10629/? I/dthings.usbenu: The ClassLoaderContext is a special shared library.
2019-12-26 18:08:40.562 10616-10629/? I/dthings.usbenu: The ClassLoaderContext is a special shared library.
2019-12-26 18:08:40.686 10616-10616/? I/Perf: Connecting to perf service.
2019-12-26 18:08:40.676 10616-10616/? W/embryo: type=1400 audit(0.0:1631): avc: denied { read } for name="u:object_r:vendor_iop_prop:s0" dev="tmpfs" ino=16888 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_iop_prop:s0 tclass=file permissive=0
2019-12-26 18:08:40.676 10616-10616/? W/embryo: type=1400 audit(0.0:1632): avc: denied { read } for name="u:object_r:vendor_iop_prop:s0" dev="tmpfs" ino=16888 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_iop_prop:s0 tclass=file permissive=0
2019-12-26 18:08:40.692 10616-10616/? E/libc: Access denied finding property "vendor.perf.iop_v3.enable"
2019-12-26 18:08:40.692 10616-10616/? E/libc: Access denied finding property "vendor.perf.iop_v3.enable.debug"
2019-12-26 18:08:40.694 10616-10616/? E/libc: Access denied finding property "vendor.perf.iop_v3.enable"
2019-12-26 18:08:40.694 10616-10616/? E/libc: Access denied finding property "vendor.perf.iop_v3.enable.debug"
2019-12-26 18:08:40.676 10616-10616/? W/embryo: type=1400 audit(0.0:1633): avc: denied { read } for name="u:object_r:vendor_iop_prop:s0" dev="tmpfs" ino=16888 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_iop_prop:s0 tclass=file permissive=0
2019-12-26 18:08:40.700 10616-10616/? D/Embryo: preload com.example.androidthings.usbenum, 53ms, hwui=true, layout=true, decor=false
2019-12-26 18:08:40.704 10616-10642/? D/OpenGLRenderer: Skia GL Pipeline
2019-12-26 18:08:42.865 10616-10616/com.example.androidthings.usbenum E/libc: Access denied finding property "vendor.perf.iop_v3.enable"
2019-12-26 18:08:42.865 10616-10616/com.example.androidthings.usbenum E/libc: Access denied finding property "vendor.perf.iop_v3.enable.debug"
2019-12-26 18:08:42.846 10616-10616/com.example.androidthings.usbenum W/dthings.usbenum: type=1400 audit(0.0:1635): avc: denied { read } for name="u:object_r:vendor_iop_prop:s0" dev="tmpfs" ino=16888 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_iop_prop:s0 tclass=file permissive=0
2019-12-26 18:08:42.870 10616-10616/com.example.androidthings.usbenum V/Font: Change font:2
2019-12-26 18:08:42.889 10616-10616/com.example.androidthings.usbenum E/libc: Access denied finding property "vendor.perf.iop_v3.enable"
2019-12-26 18:08:42.876 10616-10616/com.example.androidthings.usbenum W/dthings.usbenum: type=1400 audit(0.0:1637): avc: denied { read } for name="u:object_r:vendor_iop_prop:s0" dev="tmpfs" ino=16888 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_iop_prop:s0 tclass=file permissive=0
2019-12-26 18:08:42.889 10616-10616/com.example.androidthings.usbenum E/libc: Access denied finding property "vendor.perf.iop_v3.enable.debug"
2019-12-26 18:08:42.876 10616-10616/com.example.androidthings.usbenum W/dthings.usbenum: type=1400 audit(0.0:1638): avc: denied { read } for name="u:object_r:vendor_iop_prop:s0" dev="tmpfs" ino=16888 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_iop_prop:s0 tclass=file permissive=0
2019-12-26 18:08:42.890 10616-10616/com.example.androidthings.usbenum E/libc: Access denied finding property "vendor.perf.iop_v3.enable.debug"
2019-12-26 18:08:42.876 10616-10616/com.example.androidthings.usbenum W/dthings.usbenum: type=1400 audit(0.0:1640): avc: denied { read } for name="u:object_r:vendor_iop_prop:s0" dev="tmpfs" ino=16888 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_iop_prop:s0 tclass=file permissive=0
2019-12-26 18:08:42.914 10616-10616/com.example.androidthings.usbenum I/UsbEnumerator: Device List
2019-12-26 18:08:42.914 10616-10616/com.example.androidthings.usbenum I/UsbEnumerator: No Devices Currently Connected
2019-12-26 18:08:42.923 10616-10616/com.example.androidthings.usbenum E/libc: Access denied finding property "vendor.perf.iop_v3.enable"
2019-12-26 18:08:42.906 10616-10616/com.example.androidthings.usbenum W/dthings.usbenum: type=1400 audit(0.0:1641): avc: denied { read } for name="u:object_r:vendor_iop_prop:s0" dev="tmpfs" ino=16888 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_iop_prop:s0 tclass=file permissive=0
2019-12-26 18:08:42.923 10616-10616/com.example.androidthings.usbenum E/libc: Access denied finding property "vendor.perf.iop_v3.enable.debug"
2019-12-26 18:08:42.906 10616-10616/com.example.androidthings.usbenum W/dthings.usbenum: type=1400 audit(0.0:1642): avc: denied { read } for name="u:object_r:vendor_iop_prop:s0" dev="tmpfs" ino=16888 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:vendor_iop_prop:s0 tclass=file permissive=0
2019-12-26 18:08:42.943 10616-10668/com.example.androidthings.usbenum D/DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@5fbb7be[UsbActivity]
2019-12-26 18:08:42.944 10616-10642/com.example.androidthings.usbenum I/Adreno: QUALCOMM build : f909f5a, Ida6448821d
Build Date : 11/12/18
OpenGL ES Shader Compiler Version: EV031.25.03.00
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.7.3.R1.08.00.00.423.039
Remote Branch : NONE
Reconstruct Branch : NOTHING
2019-12-26 18:08:42.944 10616-10642/com.example.androidthings.usbenum I/Adreno: Build Config : S P 6.0.3 AArch64
2019-12-26 18:08:42.936 10616-10616/com.example.androidthings.usbenum W/RenderThread: type=1400 audit(0.0:1643): avc: denied { search } for name="proc" dev="debugfs" ino=16694 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:qti_debugfs:s0 tclass=dir permissive=0
2019-12-26 18:08:42.946 10616-10642/com.example.androidthings.usbenum I/Adreno: PFP: 0x016ee170, ME: 0x00000000
2019-12-26 18:08:42.949 10616-10642/com.example.androidthings.usbenum I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 1
2019-12-26 18:08:42.949 10616-10642/com.example.androidthings.usbenum I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2019-12-26 18:08:42.950 10616-10642/com.example.androidthings.usbenum I/OpenGLRenderer: Initialized EGL, version 1.4
2019-12-26 18:08:42.950 10616-10642/com.example.androidthings.usbenum D/OpenGLRenderer: Swap behavior 2
hei man,when i detached usb Peripheral ,and the I attached usb peripheral,the application can not run againt,it was with a blink screen! it was a bug!rigth!
--------------From Green Arrow
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.