I checked a lot of information and many people mistakenly thought it was the/dev/yourdevice created by the kernel.
In the latest kernel, this statement is incorrect. In fact, the kernel is only responsible for creating a large number of directories and files in/sys,
The real device nodes are created in the user space.
In the Android system, the INIT process is responsible for processing such uevent events. If it is an "add" device event, init will create corresponding nodes under/dev /.
For specific code, see system/CORE/init/devices. C: handle_device_event-> make_device
Node users, groups, and permissions can all be customized in devperms.
For Linux systems, I think it should be implemented by udev.
For non-android systems, it should be mdev
In fact, the key to who will handle it depends on the method in which the application layer processes the uevent sent by the kernel, whether to listen to the socket or set
/Proc/sys/kernel/hotplug command file