From: Sungbae Yoo Date: Fri, 14 Apr 2017 09:18:59 +0000 (+0900) Subject: Fix to send a mount event after encryption is completed X-Git-Tag: submit/tizen/20170418.055622~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7148c01bc785fa227b20c2ee0a29caf684eced6f;p=platform%2Fcore%2Fsecurity%2Fode.git Fix to send a mount event after encryption is completed Signed-off-by: Sungbae Yoo Change-Id: I636c479a63109c8a339003d4b2fdbab8d6fcc572 --- diff --git a/server/external-encryption.cpp b/server/external-encryption.cpp index 6185a21..350ef2b 100644 --- a/server/external-encryption.cpp +++ b/server/external-encryption.cpp @@ -261,14 +261,15 @@ int ExternalEncryption::encrypt(const std::string &password, unsigned int option INFO("Close all applications using external storage..."); killDependedApplications(); INFO("Encryption started..."); - ::vconf_set_str(EXTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); engine->encrypt(MasterKey, options); setOptions(options & getSupportedOptions()); INFO("Sync disk..."); sync(); INFO("Encryption completed"); ::vconf_set_str(EXTERNAL_STATE_VCONF_KEY, "encrypted"); + context.notify("ExternalEncryption::mount"); } catch (runtime::Exception &e) { + ::vconf_set_str(EXTERNAL_STATE_VCONF_KEY, "error_partially_encrypted"); ERROR("Encryption failed - " + std::string(e.what())); } }; diff --git a/server/internal-encryption.cpp b/server/internal-encryption.cpp index e29ddda..5c48016 100644 --- a/server/internal-encryption.cpp +++ b/server/internal-encryption.cpp @@ -316,6 +316,7 @@ int InternalEncryption::encrypt(const std::string& password, unsigned int option INFO("Encryption completed"); ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "encrypted"); + context.notify("InternalEncryption::mount"); ::reboot(RB_AUTOBOOT); } catch (runtime::Exception &e) { ::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "error_partially_encrypted");