編輯:關於Android編程
External storage is managed by a combination of thevoldinit service andMountServicesystem service. Mounting of physical external storage volumes is handled byvold, which performs staging operations to prepare the media before exposing it to apps.
For Android 4.2.2 and earlier, the device-specificvold.fstabconfiguration file defines mappings from sysfs devices to filesystem mount points, and each line follows this format:
dev_mount
For Android releases 4.3 and later, the various fstab files used by init, vold and recovery were unified in the/fstab.
External storage interactions at and above the framework level are handled throughMountService. Due to configuration changes in Android 6.0 (like the removal of the storage_list.xml resource overlay), the configuration details are split into two categories.
Devices may provide external storage by emulating a case-insensitive, permissionless filesystem backed by internal storage. One possible implementation is provided by the FUSE daemon insystem/core/sdcard, which can be added as a device-specificinit.rcservice:
# virtual sdcard daemon running as media_rw (1023) service sdcard /system/bin/sdcard1023 1023 class late_start
Wheresource_pathis the backing internal storage anddest_pathis the target mount point.
When configuring a device-specificinit.rcscript, theEXTERNAL_STORAGEenvironment variable must be defined as the path to the primary external storage. The/sdcardpath must also resolve to the same location, possibly through a symlink. If a device adjusts the location of external storage between platform updates, symlinks should be created so that old paths continue working.
Configuration of the storage subsystem is now concentrated in the device-specificfstabfile, and several historical static configuration files/variables have been removed to support more dynamic behavior:
In addition to these configuration changes, Android 6.0 includes the notion of adoptable storage. For Android 6.0 devices, any physical media that is not adopted is viewed as portable.
To indicate an adoptable storage device in thefstab, use theencryptable=userdataattribute in thefs_mgr_flagsfield. Here’s a typical definition:
/devices/platform/mtk-msdc.1/mmc_host* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
When a storage device is adopted, the platform erases the contents and writes a GUID partition table that defines two partitions:
In thefstab, storage devices with thevoldmanagedattribute are considered to be portable by default unless another attribute likeencryptable=userdatais defined. For example, here’s a typical definition for USB OTG devices:
/devices/*/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usb:auto
The platform usesblkidto detect filesystem types before mounting, and users can choose to format the media when the filesystem is unsupported.
華為榮耀暢玩5x於去年10月份上市至今,是華為的中低端手機中口碑較好的一款,而華為榮耀5c是今年4月份剛剛上市的,剛上市就有花粉在問華為榮耀5x和5c哪個好
Google在Android 5.X 中增加了對SVG 矢量圖形的支持,這對於創建新的高效率動畫具有非常重大的意義。那首先了解SVG的含義。可伸縮矢量圖形(Scalabl
概述本篇博客是對developer.android.com/上的Training課程的簡單翻譯,若是覺得翻譯出來的理解有困難,請點擊下方鏈接查看原文!關於DrawerLa
概述 RecyclerView在安卓開發中非常實用,而且簡單易用,但是在實際開發中一直有一個問題困擾著我,就是定位問題,實際的項目中總是會遇到這樣的需求:檢索Recycl