Posts

Showing posts from May, 2018

Android External Storage Support: Mount Service Architecture

Image
Introduction. We have already seen in the previous tutorial that the vold service talks to the MountService which is responsible for actually initiating commands from the userspace to mount,unmount,create,remove different volumes. Let us spend sometime to understand more on this. The relationship between the command message, MountService, Vold, and Kernel is shown in the following figure. Vold receives the kernel uevent message through the Netlink messages and sends them to the MountService through the socket method and receives the MountService commands in real time. We have seen earlier that vold process 1.      CommandListener module creates a socket listener thread at startup. 2.      The thread is used to listen to MountServcie's connection and receives the command message sent by the MountService to Vold. The MountService needs to receive the uevent message from the kernel. It must also create a socket monitor thread. The sock

Android External Storage Support: Volume Daemon (vold) Architecture

Image
Introduction. When we insert an sdcard/usb drive in an Android device, The system automatically mounts them for use. The vold [short for Volume Daemon] is the service responsible for detecting and mounting/unmounting of all the external or extended storage media in Android like usb, sdcard, cdrom. Its main function involves in helping Android support   hot pluggable storage devices. In this tutorial we will understand vold and associated components along with their code walkthrough. The vold process receives external storage device connection or disconnection messages from the kernel to manage and control the external storage devices on the Android platform. They include sdcard plugging, mounting, uninstalling, and formatting. When the external device changes, the kernel sends messages in uEvent format through Netlink. For user space programs, Netlink is a special socket based communication mechanism   which is asynchronous and used for bidirectional data