Android vold Architecture

Source: Internet
Author: User

1. Overall Architecture

2. Process Overview

2.1 enable vold

2.2 boot uevent

2.3 handle events

 

As a local service of Android, the vold-volume daemon is responsible for processing events such as storage devices such as SD and USB.

1. Overall Architecture

The vold service is centrally controlled by volumemanager. It distributes specific tasks to netlinkmanager, commandlistener, directvolume, and volume.

The vold service interacts with the underlying driver through the socket mechanism downward, and interacts with the Java framework through mechanisms such as JNI, intent, socket, and docommand.

 

2 Process Overview

2.1 enable the Service

Enable the vold local service when initializing the Android system,

Create a vold folder under/dev/block and enable volumemanager, netlinkmanager, and commandlistener.

2.2 boot uevent

Netlinkmanager monitors uevent events reported by underlying Linux.

 

The system's socketlistner manages all socket events in a unified manner.

Netlinklistner is responsible for parsing socket events.

Finally, onevent () returns the vold event to netlinkmanager for processing.

2.3 process block and switch events

Netlinkmanager calls the class that handles vold events in volumemanager.

Handleblockevent () is used to mount and detach the SD file, which is handed over to directvolume.

Handleswitchevent () connects USB flash drives.

The two finally use setbroadcast () to pass the responsiblecode through the socket listening mechanism of nativedaemonconnector, and finally upload it to mountservice for unified planning.

The onevent () in mountservice obtains the parsed event and completes the two tasks,

-> Send command docommand () to volumemanager through commandlistener

-> Broadcast event information to related services for upper-layer applications.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.