For permanent lock of display power on encryption 26/190626/2 submit/tizen_4.0/20181008.064024
authorseolheui, kim <s414.kim@samsung.com>
Thu, 4 Oct 2018 07:40:04 +0000 (16:40 +0900)
committerseolheui, kim <s414.kim@samsung.com>
Mon, 8 Oct 2018 01:39:13 +0000 (10:39 +0900)
Change-Id: Ifb4cd48de0fb2da25d78e5717c117dc22fd6dee8
Signed-off-by: seolheui, kim <s414.kim@samsung.com>
packaging/ode.spec
server/CMakeLists.txt
server/internal-encryption.cpp

index db0d397..3560243 100755 (executable)
@@ -18,6 +18,7 @@ BuildRequires: pkgconfig(cynara-client)
 BuildRequires: pkgconfig(libcrypto)
 BuildRequires: pkgconfig(libsmack)
 BuildRequires: pkgconfig(blkid)
+BuildRequires: pkgconfig(capi-system-device)
 Requires: cryptsetup
 
 %global key_storage_plugin_dir %{_libdir}/ode-key-storage-plugin/
index 78c105b..533d606 100644 (file)
@@ -47,6 +47,7 @@ SET(DEPENDENCY        klay
                                cynara-client
                                libcrypto
                                libsmack
+                               capi-system-device
 )
 
 SET(SERVER_NAME ${PROJECT_NAME}d)
index d913667..0e1cad2 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <vconf.h>
 #include <tzplatform_config.h>
+#include <device/power.h>
 #include <klay/process.h>
 #include <klay/file-user.h>
 #include <klay/filesystem.h>
@@ -501,6 +502,9 @@ int InternalEncryptionServer::encrypt(const std::string& password, unsigned int
 
        auto encryptWorker = [masterKey, options, this]() {
                try {
+                       if (::device_power_request_lock(POWER_LOCK_DISPLAY, 0) != 0)
+                               ERROR(SINK, "Failed to request to lock display");
+
                        showProgressUI("encrypt");
                        ::sleep(1);
 
@@ -567,6 +571,9 @@ int InternalEncryptionServer::decrypt(const std::string& password)
 
        auto decryptWorker = [masterKey, this]() {
                try {
+                       if (::device_power_request_lock(POWER_LOCK_DISPLAY, 0) != 0)
+                               ERROR(SINK, "Failed to request to lock display");
+
                        showProgressUI("decrypt");
                        ::sleep(1);