Android mount daemon

Source: Internet
Author: User
[First written by Steve Guo, please keep the mark if forwarding.] The original URL from: http://letsgoustc.spaces.live.com/blog/cns! 89ad27dfb5e249ba! 470. Entry

Here is the overall picture.

There are two processes in the scenario. mountd is a native application which does the real Mount work. while mountservice in system_server application is a Java layer service, it communicates with mountd through "/dev/socket/mountd" Local UNIX domain socket.

MOUNTD first creates mount point list parsed from "/system/etc/mountd. conf "configuration file. then it tries to mount devices defined in the configuration file. it opens another thread for automatically monitor inotify event for "/dev/block/" directory and uevent for USB Mass Storage. this thread is for monitor SD card and USB is plugged in or not. finally in the main thread, mountd will listen on the android_socket_mountd Local UNIX domain socket to receive commands from mountservice and send events to mountservice.

The uevent for USB is observed if it contains these two strings: "power_supply_type = USB", "power_supply_online =" + ["1" | "0"].

The commands and events between mountservice and mountd are all plain texts. It's easy to understand.

Mountservice will broadcast the following intents for any interested clients if it has es any event from mountd:

Action_ums_connected,

Action_ums_disconnected,

Action_media_removed,

Action_media_unmounted,

Action_media_mounted,

Action_media_shared,

Action_media_bad_removal,

Action_media_unmountable,

Action_media_eject.

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.