Android disk management-system source code analysis (1)

Source: Internet
Author: User

Author: gzshun. Original Works. Reprinted, please indicate the source!

This seriesArticleThe disk management section of the Android system will be explained in detail. You can familiarize yourself with the architecture and implementation principles of the entire android system through this breakthrough.

Android disk management involves four source codes:
1. Linux kernel: Android is built on the Linux kernel. The underlying part is the responsibility of Linux kernel for detecting hot swapping events;
2. vold: Android does not use udev for processing on the Linux platform, so Google wrote a vold similar to the udev function, serving as a bridge between the kernel and the framework;
3. framework: the core framework of Android (only disk management) is responsible for vold operations and issuing operation commands to vold;
4. UI: Android system application that interacts with the framework to mount/uninstall the SD card.

The process for attaching an SD card to Android is as follows:
1. on the "Settings" page, click "Mount" in "SD card and mobile phone memory ";
2. the UI obtains the disk operation function from the framework (the function that can be used only after registration with the Framework) and then calls the mounted processing function;
3. This processing function sends the mount command "volume mount sdcard" through the broadcast mechanism. After the vold accepts the command and mounts the SD card, it uses the broadcast notification framework;
4. The framework receives a reply from the mounted SD card and notifies the UI of the processing result;
5. Mount succeeded/failed on the page.

From this point, we can see that the disk management of Android involves the entire system framework. This is an important sub-system of Android system. You can familiarize yourself with the Android system architecture through the disk management sub-system, can understand many aspects of Android. From the SD card mounting process, we can see that the Android system uses IPC a lot, thus achieving the effect of module independence. From the four parts of disk management, the intercommunication between the four parts uses Socket for communication, and the entire system is very independent if the traditional API call is not used.

Source code location:
Vold: System/vold
Framework: Frameworks/base/services/Java/COM/Android/Server
Ui: android-2.2r2/packages/apps/settings/src/COM/Android/settings/deviceinfo/

The next article analyzes the source code and goes from the bottom up ..

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.