Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50c294f2 authored by Andy Stadler's avatar Andy Stadler
Browse files

Clarify rules about encryption of emulated storage.

Bug: 3351426
Change-Id: I3a8fcd369862f3eab1781699108e29fe7ab474a0
parent ff23352e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1150,8 +1150,12 @@ public class DevicePolicyManager {
     * fail (most commonly returning {@link #ENCRYPTION_STATUS_ACTIVE}).
     *
     * <p>This policy controls encryption of the secure (application data) storage area.  Data
     * written to other areas (e.g. the directory returned by
     * {@link android.os.Environment#getExternalStorageDirectory()} may or may not be encrypted.
     * written to other storage areas may or may not be encrypted, and this policy does not require
     * or control the encryption of any other storage areas.
     * There is one exception:  If {@link android.os.Environment#isExternalStorageEmulated()} is
     * {@code true}, then the directory returned by
     * {@link android.os.Environment#getExternalStorageDirectory()} must be written to disk
     * within the encrypted storage area.
     *
     * <p>Important Note:  On some devices, it is possible to encrypt storage without requiring
     * the user to create a device PIN or Password.  In this case, the storage is encrypted, but
+9 −2
Original line number Diff line number Diff line
@@ -423,9 +423,16 @@ public class Environment {

    /**
     * Returns whether the device has an external storage device which is
     * emulated. If true, the device does not have real external storage
     * and certain system services such as the package manager use this
     * emulated. If true, the device does not have real external storage, and the directory
     * returned by {@link #getExternalStorageDirectory()} will be allocated using a portion of
     * the internal storage system.
     *
     * <p>Certain system services, such as the package manager, use this
     * to determine where to install an application.
     *
     * <p>Emulated external storage may also be encrypted - see
     * {@link android.app.admin.DevicePolicyManager#setStorageEncryption(
     * android.content.ComponentName, boolean)} for additional details.
     */
    public static boolean isExternalStorageEmulated() {
        if (mIsExternalStorageEmulated == null) {