partitionmanager: signal when Mount_To_Decrypt partitions are mounted
Enable a property when mounting partitions required for decryption, and disable when they are unmounted. This helps init scripts to react to such an event appropriately, for example by starting services critical for decryption that reside on said partitions. Change-Id: Ib6fa1e5c903d9c800fb145d582ced6cc7e0ab5b9
This commit is contained in:
@@ -1608,6 +1608,7 @@ int TWPartitionManager::Decrypt_Device(string Password) {
|
||||
(*iter)->Mount(true);
|
||||
}
|
||||
}
|
||||
property_set("twrp.mount_to_decrypt", "1");
|
||||
|
||||
property_get("ro.crypto.state", crypto_state, "error");
|
||||
if (strcmp(crypto_state, "error") == 0) {
|
||||
@@ -1677,6 +1678,7 @@ int TWPartitionManager::Decrypt_Device(string Password) {
|
||||
(*iter)->UnMount(false);
|
||||
}
|
||||
}
|
||||
property_set("twrp.mount_to_decrypt", "0");
|
||||
|
||||
if (pwret != 0) {
|
||||
gui_err("fail_decrypt=Failed to decrypt data.");
|
||||
|
||||
Reference in New Issue
Block a user