DO NOT MERGE. Block adoptable storage when using FBE.

For adoptable storage and FBE to coexist we need a new dm-biocrypt
kernel feature which isn't ready yet.  So for now, prevent devices
from being adopted on FBE devices.

Bug: 30770036
Test: none
Change-Id: I51d54d2a8976ed02a03b107545aa094cf68df5d0
(cherry picked from commit 3b7f4b69b7)
This commit is contained in:
Jeff Sharkey
2016-08-23 13:53:53 -06:00
committed by Jeff Sharkey
parent a5e0fedbb3
commit 6ed7418228

View File

@@ -1056,6 +1056,10 @@ class MountService extends IMountService.Stub
|| mForceAdoptable) {
flags |= DiskInfo.FLAG_ADOPTABLE;
}
// Adoptable storage isn't currently supported on FBE devices
if (StorageManager.isFileEncryptedNativeOnly()) {
flags &= ~DiskInfo.FLAG_ADOPTABLE;
}
mDisks.put(id, new DiskInfo(id, flags));
break;
}
@@ -1985,6 +1989,11 @@ class MountService extends IMountService.Stub
}
if ((mask & StorageManager.DEBUG_FORCE_ADOPTABLE) != 0) {
if (StorageManager.isFileEncryptedNativeOnly()) {
throw new IllegalStateException(
"Adoptable storage not available on device with native FBE");
}
synchronized (mLock) {
mForceAdoptable = (flags & StorageManager.DEBUG_FORCE_ADOPTABLE) != 0;