Fix to send a mount event after encryption is completed 75/125275/1
authorSungbae Yoo <sungbae.yoo@samsung.com>
Fri, 14 Apr 2017 09:18:59 +0000 (18:18 +0900)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Fri, 14 Apr 2017 09:45:56 +0000 (18:45 +0900)
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Change-Id: I636c479a63109c8a339003d4b2fdbab8d6fcc572

server/external-encryption.cpp
server/internal-encryption.cpp

index 6185a21..350ef2b 100644 (file)
@@ -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()));
                }
        };
index e29ddda..5c48016 100644 (file)
@@ -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");