Android implementation of MTP
In Linux, sysfs is an interface used for communication between user space and kernel space. Figure 2 illustrates the block-level architecture when an MTP device is connected to a standard host. The MTP implementation on the device side is divided across user space and kernel space.
rser space components: The mtp daemon (mtpd) runs in the gsM (gava sirtual Machine) of Android. It loads and calls the rSB aevice MTP Library via gNI (gava Native Interface). The rSB aevice MTP Library takes care of decoding and responding to MTP commands.
Kernel space components: The rSB aevice MTP )unFWLon DULYHU hDnGOHV WhH MTP FODVV-VSHFLfiF FonWUoO requests like opening or closing the session as per the user’s LnVWUuFWLonV. ,W DOVo FonWUoOV WhH UHDGLnJ/wULWLnJ oI fiOHV IUoP the storage media through the sirtual File System.