FP3: Disable adoptable storage
Description
Android 6.0 introduced the ability to adopt external storage media to act like internal storage. On devices running Android 7.0-8.1, file-based encryption (FBE) can't be used together with adoptable storage. On devices using FBE, new storage media (such as an SD card) must be used as traditional storage. Devices running Android 9 and higher can use adoptable storage and FBE.
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 uses GPT and therefore has file storage limit of ~9ZB.
Which is why disabling encryptable=footer
in fstab is enough to disable adoptable storage .
Issue(s)
Test environment
Require sdcard for testing the issue https://gitlab.e.foundation/e/priv/os/build/-/pipelines/125959
Test procedures
- Setup sdcard as internal storage, sideload new build with Adoptable storage disable change. Check for any data loss
- After sideload test the option to set sdcard as internal storage, expected result is the option is gone .