diff options
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index 00ffbc3d2..921ea9428 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -501,6 +501,23 @@ static int queue_fs_event(int code) { // Although encrypted, we have device key, so we do not need to // do anything different from the nonencrypted case. ActionManager::GetInstance().QueueEventTrigger("nonencrypted"); + } else if (code == FS_MGR_MNTALL_DEV_IS_METADATA_ENCRYPTED) { + if (e4crypt_install_keyring()) { + return -1; + } + property_set("ro.crypto.state", "encrypted"); + property_set("ro.crypto.type", "file"); + + // defaultcrypto detects file/block encryption. init flow is same for each. + ActionManager::GetInstance().QueueEventTrigger("defaultcrypto"); + } else if (code == FS_MGR_MNTALL_DEV_NEEDS_METADATA_ENCRYPTION) { + if (e4crypt_install_keyring()) { + return -1; + } + property_set("ro.crypto.type", "file"); + + // encrypt detects file/block encryption. init flow is same for each. + ActionManager::GetInstance().QueueEventTrigger("encrypt"); } else if (code > 0) { PLOG(ERROR) << "fs_mgr_mount_all returned unexpected error " << code; } |