More accurately validate the prerequisites for using emmc_optimized
The emmc_optimized encryption setting is allowed only when the inline
crypto hardware supports only 32-bit DUNs; see CDD 9.9.3.1 [C-1-15].
vold tries to validate this setting accordingly, but previously it did
not have access to the actual DUN length, so instead it checked the
storage type to determine whether a 32-bit DUN limit *might* exist. In
android14-5.15 and later kernels, the DUN length is exposed via a file
in the disk's queue directory in sysfs, which allows doing this check
properly. Therefore, update vold to use this file when possible.
Bug: 207390665
Test: Set emmc_optimized on (a) a device using UFS storage, and (b) a
device using virtio storage with no inline crypto support passed
through. Both with PRODUCT_SHIPPING_API_LEVEL = 35. Verified
that the devices failed to boot and the log showed the expected
reasons. (I did not have a device actually using eMMC at hand.)
Change-Id: Ib2f1cab313aa57e8d5aabe4ebfcc2d08909fcc89
1 file changed