From a82a754bbeb49b2d44fa25d5abd64a3c3f4e9ae0 Mon Sep 17 00:00:00 2001 From: oshmoun Date: Tue, 10 Apr 2018 17:45:55 +0200 Subject: 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 --- partitionmanager.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'partitionmanager.cpp') diff --git a/partitionmanager.cpp b/partitionmanager.cpp index 7adcc9f46..87849685c 100644 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -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."); -- cgit v1.2.3