Fix check for whether metadata encryption is enabled

metadata_key_dir controls whether metadata encryption is enabled, not
metadata_encryption which is just the encryption options and can be
empty if the default options are sufficient.

Bug: 198405417
Fixes: 156d9d2293 ("Pre-create userdata metadata encryption device.")
Change-Id: I98ee253c7e5e738ee087ec07ed60f4a376ca7cee
This commit is contained in:
Eric Biggers 2022-03-17 23:06:45 +00:00
parent e7dbc48584
commit f14f8627bb

View file

@ -251,7 +251,7 @@ static int process_config(VolumeManager* vm, VoldConfigs* configs) {
PLOG(FATAL) << "could not find logical partition " << entry.blk_device;
}
if (entry.mount_point == "/data" && !entry.metadata_encryption.empty()) {
if (entry.mount_point == "/data" && !entry.metadata_key_dir.empty()) {
// Pre-populate userdata dm-devices since the uevents are asynchronous (b/198405417).
android::vold::defaultkey_precreate_dm_device();
}