首页 > 其他分享 >Android官方资料--Adoptable Storage

Android官方资料--Adoptable Storage

时间:2023-09-06 13:07:12浏览次数:46  
标签:Adoptable -- Storage storage adopted internal media device Android


Adoptable Storage


IN THIS DOCUMENT

  1. Security
  2. Performance and stability



Android has always supported external storage accessories (such as SD cards), but these accessories were historically limited to simple file storage, due to their expected impermanence and the minimal data protection offered to traditional external storage. Android 6.0 introduces the ability to adopt external storage media to act like internal storage.

When external storage media is adopted, it’s formatted and encrypted to only work with a single Android device at a time. Because the media is strongly tied to the Android device that adopted it, it can safely store both apps and private data for all users.

When users insert new storage media (such as an SD card) in an adoptable location, Android asks them how they want to use the media. They can choose to adopt the media, which formats and encrypts it, or they can continue using it as-is for simple file storage. If they choose to adopt, the platform offers to migrate the primary shared storage contents (typically mounted at /sdcard) to the newly adopted media, freeing up valuable space on internal storage. Unlike traditional storage, which is limited to 2TB due to its use of MBR, adoptable storage usesGPT and therefore has file storage limit of ~9ZB.Apps can be placed on adopted storage media only when the developer has indicated support through theandroid:installLocation attribute. New installs of supported apps are automatically placed on the storage device with the most free space, and users can move supported apps between storage devices in the Settingsapp. Apps moved to adopted media are remembered while the media is ejected, and return when the media is reinserted.

Security


The platform randomly generates an encryption key for each adopted device, and that key is stored on the internal storage of the Android device. This effectively makes the adopted media as secure as internal storage. Keys are associated with adopted devices based on the adopted partition GUID. The adopted device is encrypted using dm-crypt configured with the aes-cbc-essiv:sha256

The on-disk layout of the adopted device closely mirrors the internal data partition, including SELinux labels, etc. When multi-user is supported on the Android device, the adopted storage device also supports multi-user with the same level of isolation as internal storage.

Because the contents of an adopted storage device are strongly tied to the Android device that adopted it, the encryption keys should not be extractable from the parent device, and therefore the storage device can't be mounted elsewhere.

Performance and stability


Only external storage media in stable locations, such as a slot inside a battery compartment or behind a protective cover, should be considered for adoption to help avoid accidental data loss or corruption. In particular, USB devices connected to a phone or tablet should never be considered for adoption. One common exception would be an external USB drive connected to a TV-style device, because the entire TV is typically installed in a stable location.

When a user adopts a new storage device, the platform runs a benchmark and compares its performance against internal storage. If the adopted device is significantly slower than internal storage, the platform warns the user about a possibly degraded experience. This benchmark was derived from the actual I/O behavior of popular Android apps. Currently, the AOSP implementation will only warn users beyond a single threshold, but device manufacturers may adapt this further, such as rejecting adoption completely if the card is extremely slow.

Adopted devices must be formatted with a filesystem that supports POSIX permissions and extended attributes, such as ext4 or f2fs. For optimal performance, the f2fsWhen performing periodic idle maintenance, the platform issues FI_TRIM to adopted media just like it does for internal storage. The current SD card specification does not support the DISCARD command; but the kernel instead falls back to the ERASE

标签:Adoptable,--,Storage,storage,adopted,internal,media,device,Android
From: https://blog.51cto.com/u_16248677/7385130

相关文章

  • Android官方资料--OTA Package Tools
    OTAPackageToolsINTHISDOCUMENTFullupdatesIncrementalupdatesUpdatepackagesThe ota_from_target_files toolprovidedinbuild/tools/releasetools canbuildtwotypesofpackage: full andincremental.Thetooltakesthe target-files .zipfileproduc......
  • android编译报错:error: ro.build.fingerprint cannot exceed 91 bytes
    http://stackoverflow.com/questions/28776970/android-build-error-ro-build-fingerprint-cannot-exceed-91-bytesbuild/tools/post_process_props.py.Changelinesasfollows:PROP_NAME_MAX=31#PROP_VALUE_MAX=91PROP_VALUE_MAX=128PROP_NAME_MAX=31#PROP_V......
  • ota升级包编译过程中firmware如何添加进来
    整个分析过程中,机型名以xxxx为例主要可分为一firmware如何添加进target-files.zip二编译ota升级包时如何从target-files.zip取出firmware并添加到ota升级包三如何向升级脚本updater-script中加入控制firmware升级的语句四增量升级包相比全量包不同的步骤五结论及修复方......
  • 前端歌谣的刷题之路-第十三题-画一个圆
     目录前言题目 核心代码总结前言我是歌谣我有个兄弟巅峰的时候排名c站总榜19叫前端小歌谣曾经我花了三年的时间创作了他现在我要用五年的时间超越他今天又是接近兄弟的一天人生难免坎坷大不了从头再来歌谣的意志是永恒的放弃很容易但是坚持一定很酷本题目源自于牛客网......
  • TARGET_DEVICE_DIR取值过程分析
    xxx(机型名)为例在build/core/main.mk中,会包含build/core/config.mk,在config.mk中,会包含build/core/envsetup.mk,在envsetup.mk中有:#ReadtheproductspecssowecangetTARGET_DEVICEandother#variablesthatweneedinordertolocatetheoutp......
  • 前端歌谣的刷题之路-第十四题-设置盒子的一个宽和高
     目录前言题目核心代码总结前言我是歌谣我有个兄弟巅峰的时候排名c站总榜19叫前端小歌谣曾经我花了三年的时间创作了他现在我要用五年的时间超越他今天又是接近兄弟的一天人生难免坎坷大不了从头再来歌谣的意志是永恒的放弃很容易但是坚持一定很酷本题目源自于牛客网......
  • Android官方资料--Reducing OTA Size
    ReducingOTASizeINTHISDOCUMENTThebuilddifftoolChangestoreduceOTAsizeFileOrderBuildDirectoryTimestampsVersionStringsConsistentbuildtoolsAcommonproblemwithAndroidover-the-airupdates(OTAs)isthattheycontainchangedfilesthatdo......
  • Android Recovery UI浅析1——概览
    最近在作一个在recovery中显示文字的工作,所以对这块研究较多,现在把研究的一点新的结果分享出来,如果有什么错误也欢迎大家在下面评论。 Android的Recovery中,利用 boottable/recovery下的minui库作为基础,采用的是直接存取framebuffer的方式,来完成recovery中所需的各种UI的绘制。......
  • Apache IoTDB开发系统整合之Hive TsFile
    TsFile-Hive-Connector用户指南关于TsFile-Hive-ConnectorTsFile-Hive-Connector实现了Hive对Tsfile类型的外部数据源的支持。这使用户能够按Hive操作Tsfile。使用此连接器,您可以将单个TsFile从本地文件系统或hdfs加载到hive中将特定目录中的所有文件(从本地文件系统或......
  • 二级医院信息系统源码(HIS) Angular+Nginx+ Java
    基层医疗云HIS作为基于云计算的B/S构架的HIS系统,为基层医疗机构提供了标准化的、信息化的、可共享的医疗信息管理系统,可有效进行医疗数据共享与交换,解决数据重复采集及信息孤岛等问题,实现对基层医疗数据的分析和挖掘,为基层卫生机构提供科学合理的业务管理服务。可实现“云部署”,即......