Move a ode app from device-policy-manager 67/104067/1
authoryeji01kim <yeji01.kim@samsung.com>
Mon, 12 Dec 2016 08:14:34 +0000 (17:14 +0900)
committeryeji01kim <yeji01.kim@samsung.com>
Mon, 12 Dec 2016 08:14:34 +0000 (17:14 +0900)
Change-Id: Iafcccd507467eadbfaf7e08f870bce3509f1c2d1
Signed-off-by: yeji01kim <yeji01.kim@samsung.com>
26 files changed:
packaging/ode.spec [changed mode: 0644->0755]
tools/apps/CMakeLists.txt
tools/apps/ode-gui/CMakeLists.txt [new file with mode: 0644]
tools/apps/ode-gui/include/ode.h [moved from tools/apps/ode/include/ode.h with 100% similarity]
tools/apps/ode-gui/include/text.h [moved from tools/apps/ode/include/text.h with 100% similarity]
tools/apps/ode-gui/include/widget.h [moved from tools/apps/ode/include/widget.h with 100% similarity]
tools/apps/ode-gui/org.tizen.ode-gui.manifest [moved from tools/apps/ode/org.tizen.ode-gui.manifest with 100% similarity]
tools/apps/ode-gui/org.tizen.ode-gui.xml [moved from tools/apps/ode/org.tizen.ode-gui.xml with 100% similarity]
tools/apps/ode-gui/res/edje/org.tizen.ode-gui.edc [moved from tools/apps/ode/res/edje/org.tizen.ode-gui.edc with 100% similarity]
tools/apps/ode-gui/res/edje/progress.edc [moved from tools/apps/ode/res/edje/progress.edc with 100% similarity]
tools/apps/ode-gui/res/images/icon.png [moved from tools/apps/ode/res/images/icon.png with 100% similarity]
tools/apps/ode-gui/src/main.c [moved from tools/apps/ode/src/main.c with 100% similarity]
tools/apps/ode-gui/src/ui.c [moved from tools/apps/ode/src/ui.c with 100% similarity]
tools/apps/ode-gui/src/widget.c [moved from tools/apps/ode/src/widget.c with 100% similarity]
tools/apps/ode/CMakeLists.txt [changed mode: 0644->0755]
tools/apps/ode/include/ode-app-widget.h [new file with mode: 0755]
tools/apps/ode/include/ode-app.h [new file with mode: 0755]
tools/apps/ode/org.tizen.ode.xml [new file with mode: 0755]
tools/apps/ode/res/edc_resource/encryption_device.edc [new file with mode: 0755]
tools/apps/ode/res/images/icon_encrypt_bar.png [new file with mode: 0755]
tools/apps/ode/res/images/icon_encrypt_check.png [new file with mode: 0755]
tools/apps/ode/res/org.tizen.ode.edc [new file with mode: 0755]
tools/apps/ode/src/ode-app-confirm.c [new file with mode: 0755]
tools/apps/ode/src/ode-app-main.c [new file with mode: 0755]
tools/apps/ode/src/ode-app-widget.c [new file with mode: 0755]
tools/apps/ode/src/ode-app.c [new file with mode: 0755]

old mode 100644 (file)
new mode 100755 (executable)
index 30b3323..4fab609
@@ -131,13 +131,41 @@ BuildRequires: pkgconfig(capi-appfw-application)
 %description -n org.tizen.ode-gui
 Tizen ODE User Interface for device policy management
 
-%define odeapp_home %{TZ_SYS_RO_APP}/org.tizen.ode-gui
+%define odeguiapp_home %{TZ_SYS_RO_APP}/org.tizen.ode-gui
 
 %post -n org.tizen.ode-gui
-ln -sf %{odeapp_home}/bin/org.tizen.ode-gui /usr/bin/ode-gui
+ln -sf %{odeguiapp_home}/bin/org.tizen.ode-gui /usr/bin/ode-gui
 
 %files -n org.tizen.ode-gui
 %defattr(-,root,root,-)
+%{odeguiapp_home}/bin/*
+%{odeguiapp_home}/res/*
+%{TZ_SYS_RO_PACKAGES}/org.tizen.ode-gui.xml
+
+## ODE App package ################################################
+%package -n org.tizen.ode
+Summary: Tizen ODE User Interface
+Group: Security/Other
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(efl-extension)
+BuildRequires: pkgconfig(libxml-2.0)
+BuildRequires: pkgconfig(evas)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(capi-appfw-app-control)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-system-runtime-info)
+BuildRequires: pkgconfig(capi-system-device)
+BuildRequires: pkgconfig(capi-system-system-settings)
+
+%description -n org.tizen.ode
+Tizen ODE User Interface for device policy management
+
+%define odeapp_home %{TZ_SYS_RO_APP}/org.tizen.ode
+
+%files -n org.tizen.ode
+%defattr(-,root,root,-)
 %{odeapp_home}/bin/*
 %{odeapp_home}/res/*
-%{TZ_SYS_RO_PACKAGES}/org.tizen.ode-gui.xml
+%{TZ_SYS_RO_PACKAGES}/org.tizen.ode.xml
index 041c9ca..a1531b8 100755 (executable)
@@ -27,5 +27,7 @@ PKG_CHECK_MODULES(EFL_APP REQUIRED
 )
 
 SET(ODE_APPS_ODE       ${ODE_APPS}/ode)
+SET(ODE_GUI_APPS_ODE ${ODE_APPS}/ode-gui)
 
 ADD_SUBDIRECTORY(${ODE_APPS_ODE})
+ADD_SUBDIRECTORY(${ODE_GUI_APPS_ODE})
diff --git a/tools/apps/ode-gui/CMakeLists.txt b/tools/apps/ode-gui/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c5d8aa1
--- /dev/null
@@ -0,0 +1,30 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(org.tizen.ode-gui C)
+
+INCLUDE_DIRECTORIES(${EFL_APP_INCLUDE_DIRS} ${ODE_LIB} include)
+LINK_DIRECTORIES(${EFL_APP_LIBRARY_DIRS})
+
+SET(APP_SRCS
+       src/main.c
+       src/ui.c
+       src/widget.c
+)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${APP_SRCS})
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${APP_INSTALL_PREFIX}/${PROJECT_NAME}/bin)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${EFL_APP_LIBRARIES} ode)
+
+ADD_CUSTOM_TARGET(${PROJECT_NAME}.edj
+       COMMAND edje_cc -no-save -id ${CMAKE_CURRENT_SOURCE_DIR}/res/images
+       ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/${PROJECT_NAME}.edc
+       ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.edj
+       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/${PROJECT_NAME}.edc)
+
+ADD_DEPENDENCIES(${PROJECT_NAME} ${PROJECT_NAME}.edj)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.edj DESTINATION ${APP_INSTALL_PREFIX}/${PROJECT_NAME}/res)
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.xml DESTINATION ${APP_SHARE_PACKAGES_DIR})
old mode 100644 (file)
new mode 100755 (executable)
index c5d8aa1..0c1a2f9
@@ -1,30 +1,51 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(org.tizen.ode-gui C)
+SET(ODE_TARGET org.tizen.ode)
+
+INCLUDE_DIRECTORIES(./include)
+
+FIND_PACKAGE(PkgConfig REQUIRED)
+PKG_CHECK_MODULES(tools_pkgs REQUIRED
+               glib-2.0
+               elementary
+               dlog
+               efl-extension
+               libxml-2.0
+               evas
+               vconf
+               capi-appfw-app-control
+               capi-appfw-application
+               capi-system-runtime-info
+               capi-system-device
+               capi-system-system-settings
+)
 
-INCLUDE_DIRECTORIES(${EFL_APP_INCLUDE_DIRS} ${ODE_LIB} include)
-LINK_DIRECTORIES(${EFL_APP_LIBRARY_DIRS})
+INCLUDE_DIRECTORIES(${tools_pkgs_INCLUDE_DIRS})
+LINK_DIRECTORIES(${tools_pkgs_LIBRARY_DIRS})
 
-SET(APP_SRCS
-       src/main.c
-       src/ui.c
-       src/widget.c
-)
+SET(PKG_NAME "${ODE_TARGET}")
+SET(PKG_SRC ./src/ode-app.c
+                       ./src/ode-app-widget.c
+                       ./src/ode-app-main.c
+                       ./src/ode-app-confirm.c)
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE")
 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
 
-ADD_EXECUTABLE(${PROJECT_NAME} ${APP_SRCS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${APP_INSTALL_PREFIX}/${PROJECT_NAME}/bin)
+ADD_EXECUTABLE(${PKG_NAME} ${PKG_SRC})
+INSTALL(TARGETS ${PKG_NAME} DESTINATION ${APP_INSTALL_PREFIX}/${PKG_NAME}/bin)
 
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${EFL_APP_LIBRARIES} ode)
+TARGET_LINK_LIBRARIES(${PKG_NAME} ${tools_pkgs_LIBRARIES})
 
-ADD_CUSTOM_TARGET(${PROJECT_NAME}.edj
-       COMMAND edje_cc -no-save -id ${CMAKE_CURRENT_SOURCE_DIR}/res/images
-       ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/${PROJECT_NAME}.edc
-       ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.edj
-       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/edje/${PROJECT_NAME}.edc)
+#Create edj file
+ADD_CUSTOM_TARGET(org.tizen.ode.edj
+    COMMAND edje_cc -no-save -id ${CMAKE_CURRENT_SOURCE_DIR}/res/images
+    ${CMAKE_CURRENT_SOURCE_DIR}/res/org.tizen.ode.edc
+    ${CMAKE_BINARY_DIR}/org.tizen.ode.edj
+    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/org.tizen.ode.edc)
 
-ADD_DEPENDENCIES(${PROJECT_NAME} ${PROJECT_NAME}.edj)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.edj DESTINATION ${APP_INSTALL_PREFIX}/${PROJECT_NAME}/res)
+ADD_DEPENDENCIES(${PROJECT_NAME} org.tizen.ode.edj)
+INSTALL(FILES ${CMAKE_BINARY_DIR}/org.tizen.ode.edj DESTINATION ${APP_INSTALL_PREFIX}/${PKG_NAME}/res)
 
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.xml DESTINATION ${APP_SHARE_PACKAGES_DIR})
+#Install app data
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/res/images/icon_encrypt_bar.png DESTINATION ${APP_INSTALL_PREFIX}/${PKG_NAME}/res/images)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/res/images/icon_encrypt_check.png DESTINATION ${APP_INSTALL_PREFIX}/${PKG_NAME}/res/images)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PKG_NAME}.xml DESTINATION ${APP_SHARE_PACKAGES_DIR})
diff --git a/tools/apps/ode/include/ode-app-widget.h b/tools/apps/ode/include/ode-app-widget.h
new file mode 100755 (executable)
index 0000000..fbdcbda
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ODE_APP_WIDGET_H__
+#define __ODE_APP_WIDGET_H__
+
+#include "ode-app.h"
+
+Evas_Object* dpm_encryption_create_layout(Evas_Object* parent, const char* file, const char* group);
+Evas_Object* dpm_encryption_create_navigation(Evas_Object* parent);
+Evas_Object* dpm_encryption_create_button(Evas_Object* parent, const char* text, const char* style);
+Evas_Object* dpm_encryption_create_textblock(Evas_Object *parent, const char *text, Evas_Textblock_Style *style);
+
+#endif /* __ODE_APP_WIDGET_H__ */
diff --git a/tools/apps/ode/include/ode-app.h b/tools/apps/ode/include/ode-app.h
new file mode 100755 (executable)
index 0000000..bb4b0c9
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * Tizen ODE application
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: SeolHeui Kim <s414.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __ODE_H__
+#define __ODE_H__
+
+#include <stdio.h>
+
+#include <app.h>
+#include <app_control.h>
+#include <dlog.h>
+#include <efl_extension.h>
+#include <Elementary.h>
+#include <system_settings.h>
+#include <limits.h>
+#include <device/battery.h>
+#include <device/callback.h>
+#include <runtime_info.h>
+#include <vconf.h>
+#include <gio/gio.h>
+#include <app_control.h>
+#include <aul.h>
+#include <bundle.h>
+
+#include "ode-app-widget.h"
+
+#ifdef  LOG_TAG
+#undef  LOG_TAG
+#endif
+#define LOG_TAG "ode"
+
+#if !defined(PACKAGE)
+#define PACKAGE "org.tizen.ode"
+#endif
+
+typedef struct dpm_encryption_info {
+       int battery_status;
+       int charger_status;
+       int locktype_status;
+
+       int sdcard_status;
+       int sdcard_pw_status;
+
+       Evas_Object *next_button;
+} dpm_encryption_info_s;
+
+typedef enum {
+       ENCRYPT_DEVICE,
+       DECRYPT_DEVICE,
+       ENCRYPT_SD_CARD,
+       DECRYPT_SD_CARD,
+} dpm_encryption_viewtype;
+
+typedef enum {
+       ICON_CHECK,
+       ICON_BAR,
+} dpm_encryption_icontype;
+
+typedef struct appdata {
+       Evas_Object* win;
+       Evas_Object* conform;
+       Evas_Object* nf;
+       Evas_Object* base;
+       Evas_Object* navi_bar;
+       Evas_Object* dpm_encryption_layout;
+       dpm_encryption_info_s device_info;
+
+       char* edj_path;
+       char* icon_check_path;
+       char* icon_bar_path;
+       int view_type;
+} appdata_s;
+
+#define MSG_TEXT_STYLE "DEFAULT='font=Tizen:style=Regular font_size=30 color=#000000 wrap=mixed align=left'"
+#define NEEDED_BATTERY_PERCENT 80
+
+/* for Encrypt device */
+#define IDS_ST_HEADER_ENCRYPTION "Encryption"
+#define IDS_ST_MBODY_ENCRYPT_DEVICE "Encrypt device"
+#define IDS_ST_MBODY_DECRYPT_DEVICE "Decrypt device"
+#define IDS_ST_SBODY_DEVICE_NOT_ENCRYPTED_M_STATUS "Device not encrypted."
+#define IDS_ST_SBODY_DEVICE_ENCRYPTED_M_STATUS "Device encrypted."
+
+#define IDS_ST_MBODY_ENCRYPT_SD_CARD_ABB "Encrypt SD card"
+#define IDS_ST_MBODY_DECRYPT_SD_CARD "Decrypt SD card"
+#define IDS_ST_SBODY_SD_CARD_NOT_INSERTED_M_STATUS "SD card not inserted"
+#define IDS_ST_SBODY_SD_CARD_NOT_ENCRYPTED_M_STATUS_SBODY "SD card not encrypted"
+#define IDS_ST_SBODY_SD_CARD_ENCRYPTED_M_STATUS "SD card encrypted"
+#define IDS_ST_SBODY_ENCRYPTING_ING_M_STATUS "Encrypting..."
+#define IDS_ST_SBODY_DECRYPTING_ING_M_STATUS "Decrypting..."
+#define IDS_ST_SBODY_FAILED_TO_ENCRYPT_SD_CARD_TAP_HERE_TO_TRY_AGAIN "Failed to encrypt SD card. Tap here to try again."
+#define IDS_ST_SBODY_FAILED_TO_DECRYPT_SD_CARD_TAP_HERE_TO_TRY_AGAIN "Failed to decrypt SD card. Tap here to try again."
+#define IDS_ST_SBODY_TAP_HERE_TO_ENTER_PW_FOR_SD_CARD_ABB "Tap here to enter PW for SD card."
+
+#define IDS_ST_HEADER_ENCRYPT_DEVICE "Encrypt device"
+#define IDS_ST_BODY_ENCRYPTING_MSG_1 "Encrypting your device will secure the apps, data, and other content on your device. To decrypt your device once it has been encrypted, you will need to unlock the screen whenever the device is powered on."
+#define IDS_ST_BODY_ENCRYPTING_MSG_2 "The encryption process may take a long time<br>depending on the amount of data that is encrypted. Interrupting this process may cause data loss, so make sure you have time for it to finish before you start."
+#define IDS_ST_BODY_TO_ENCRYPTION_YOUR_DEVICE_C_ABB "To encrypt your device:"
+#define IDS_ST_BODY_CHARGE_THE_BATTERY_TO_AT_LEAST_PDP "Charge the battery to at least 80%."
+#define IDS_ST_BODY_CONNECT_THE_DEVICE_TO_A_CHARGER "Connect the device to a charger."
+#define IDS_ST_BODY_SET_THE_SCREEN_LOCK_TYPE_AS_PATTERN_PIN_OR_PASSWORD "Set the screen lock type as pattern, PIN, or password."
+#define IDS_ST_BUTTON_SCREEN_LOCK_TYPE_ABB "Screen lock type"
+#define IDS_ST_BUTTON_NEXT "Next"
+
+/* for Decrypt device */
+#define IDS_ST_HEADER_DECRYPT_DEVICE "Decrypt device"
+#define IDS_ST_BODY_DECRYPTING_MSG_1 "Decrypting your device will decrypt the apps, data, and other content on your device."
+#define IDS_ST_BODY_DECRYPTING_MSG_2 "This may take a long time depending on the amount of data. Interrupting this process may cause data loss, so make sure you have time for it to finish before you start."
+#define IDS_ST_HEADER_TO_DECRYPT_YOUR_DEVICE_C_ABB "To decrypt your device:"
+
+/* for Encrypt SD card */
+#define IDS_ST_HEADER_ENCRYPT_SD_CARD "Encrypt SD card"
+#define IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_1 "Encrypting your SD card will protect its data if it's lost or stolen. SD cards encrypted on this device can't be used on any other device."
+#define IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_2 "Once the SD card is encrypted, a password is required to use it. The same password must be used for all encrypted SD cards. If you enter an incorrect password 15 times in a row, you will no longer be able to use any of the SD cards encrypted by this device."
+#define IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_3 "The encryption process may take a long time depending on the amount of data that is encrypted. Interrupting this process may cause data loss, so make sure you have time for it to finish before you start."
+#define IDS_ST_BODY_TO_ENCRYPT_YOUR_SD_CARD_C "To encrypt your SD card :"
+#define IDS_ST_BODY_INSERT_THE_SD_CARD_ABB "Insert the SD card to encrypt."
+#define IDS_ST_BODY_CREATE_AN_SD_CARD_PASSWORD "Create an SD card password."
+#define IDS_ST_BUTTON_CREATE_PASSWORD "Create password"
+#define IDS_ST_BUTTON_CHANGE_PW_ABB "Change PW"
+#define IDS_ST_BUTTON_DELETE_PW_ABB "Delete PW"
+
+/* for Decrypt SD card */
+#define IDS_ST_HEADER_DECRYPT_SD_CARD "Decrypt SD card"
+#define IDS_ST_BODY_SD_CARD_DECRYPTION_MSG "The decryption process may take a long time depending on the amount of data that is decrypted. Interrupting this process may cause data loss, so make sure you have time for it to finish before you start."
+#define IDS_ST_BUTTON_CHANGE_PASSWORD_ABB2 "Change password"
+
+/* for Encrypt Device Confirm */
+#define IDS_ST_HEADER_CONFIRM_ENCRYPTION "Confirm encryption"
+#define IDS_ST_BODY_CONFIRM_ENCRYPT_DEVICE_MSG_1 "Tap Encrypt device to start the encryption process."
+#define IDS_ST_BODY_CONFIRM_ENCRYPT_DEVICE_MSG_2 "The encryption can't be cancelled and data will be lost if the process is interrupted. During the encryption process, your device can't be used. After the encryption, your device will restart."
+#define IDS_ST_HEADER_ENCRYPTION_OPTIONS_ABB "Encryption options"
+#define IDS_ST_MBODY_FAST_ENCRYPTION "Fast Encryption"
+#define IDS_ST_SBODY_ENCRYPT_USED_DEVICE_STORAGE_ONLY "Encrypt used device storage only."
+#define IDS_ST_BUTTON_ENCRYPT_DEVICE "Encrypt device"
+
+/* for Decrypt Device Confirm */
+#define IDS_ST_HEADER_CONFIRM_DECRYPTION "Confirm decryption"
+#define IDS_ST_BODY_CONFIRM_DECRYPT_DEVICE_MSG_1 "Tap Decrypt device to start the decryption process."
+#define IDS_ST_BODY_CONFIRM_DECRYPT_DEVICE_MSG_2 "The decryption can't be cancelled and data will be lost if the process is interrupted. During the decryption process, your device can't be used. After the decryption, your device will restart."
+#define IDS_ST_BUTTON_DECRYPT_DEVICE "Decrypt device"
+
+/* for Encrypt SD card Confirm */
+#define IDS_ST_BODY_CONFIRM_ENCRYPT_SD_CARD_MSG_1 "Tap Encrypt SD card to start the encryption process. All open files on SD card will be closed."
+#define IDS_ST_BODY_CONFIRM_ENCRYPT_SD_CARD_MSG_2 "The encryption can't be cancelled and data will be lost if the process is interrupted. During the encryption process, your SD card can't be used. After the encryption, your SD card will be mounted again."
+#define IDS_ST_MBODY_ENCRYPT_NEW_FILES "Encrypt all files"
+#define IDS_ST_BODY_ENCRYPT_NEW_FILES_MSG "Encrypt all files saved on the SD card. New files will also be encrypted."
+#define IDS_ST_MBODY_ENCRYPT_ALL_FILES "Encrypt new files"
+#define IDS_ST_BODY_ENCRYPT_ALL_FILES_MSG "Encrypt all new files created using this device. Existing files will not be encrypted."
+#define IDS_ST_BUTTON_ENCRYPT_SD_CARD_ABB "Encrypt SD card"
+
+/* for Decrypt SD Card Confirm */
+#define IDS_ST_BODY_CONFIRM_DECRYPT_SD_CARD_MSG_1 "Tap Decrypt SD card to start the decryption process. All open files on SD card will be closed."
+#define IDS_ST_BODY_CONFIRM_DECRYPT_SD_CARD_MSG_2 "The decryption can't be cancelled and data will be lost if the process is interrupted. During the decryption process, your SD card can't be used. After the decryption, your SD card will be mounted again."
+#define IDS_ST_BUTTON_DECRYPT_SD_CARD_ABB3 "Decrypt SD card"
+
+void dpm_encryption_create_view(appdata_s* ad);
+void dpm_decryption_create_view(appdata_s* ad);
+void dpm_encryption_sd_card_create_view(appdata_s* ad);
+void dpm_decryption_sd_card_create_view(appdata_s* ad);
+
+void dpm_encryption_device_confirm_create_view(appdata_s* ad);
+void dpm_decryption_device_confirm_create_view(appdata_s* ad);
+void dpm_encryption_sd_card_confirm_create_view(appdata_s* ad);
+void dpm_decryption_sd_card_confirm_create_view(appdata_s* ad);
+
+void locktype_status_changed_cb(keynode_t* node, void* data);
+void sdcard_status_changed_cb(keynode_t* node, void* data);
+void battery_changed_cb(device_callback_e type, void* value, void* user_data);
+
+#endif                                                 /* __ODE_H__ */
diff --git a/tools/apps/ode/org.tizen.ode.xml b/tools/apps/ode/org.tizen.ode.xml
new file mode 100755 (executable)
index 0000000..9220af8
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.ode" version="1.0.0">
+    <profile name="mobile"/>
+    <privileges>
+        <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+    </privileges>
+    <ui-application appid="org.tizen.ode" exec="/usr/apps/org.tizen.ode/bin/org.tizen.ode" multiple="false" nodisplay="true" taskmanage="true" type="capp">
+        <label>ODE</label>
+        <icon>org.tizen.ode</icon>
+    </ui-application>
+</manifest>
diff --git a/tools/apps/ode/res/edc_resource/encryption_device.edc b/tools/apps/ode/res/edc_resource/encryption_device.edc
new file mode 100755 (executable)
index 0000000..a4c35ce
--- /dev/null
@@ -0,0 +1,618 @@
+/*
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+group { name: "base_layout";
+       parts {
+               part { name: "base";
+                       type: RECT;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative : 0.0 0.0;}
+                               rel2 { relative : 1.0 1.0;}
+                       }
+               }
+               part { name: "content_layout";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; to: "base";}
+                               rel2 { relative: 1.0 0.0; to: "bottom_layout";}
+                       }
+               }
+               part { name: "bottom_layout";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "base"; offset: 0 -150;}
+                               rel2 { relative: 1.0 1.0; to: "base";}
+                       }
+               }
+       }
+}
+
+group { name: "next_button_layout";
+       parts {
+               part { name: "base";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 1.0 1.0; }
+                       }
+               }
+               part { name: "left_padding";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; to: "base"; }
+                               rel2 { relative: 0.0 1.0; to: "base"; offset: 120 0;}
+                       }
+               }
+               part { name: "next_button";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.0; to: "left_padding"; }
+                               rel2 { relative: 0.0 1.0; to: "right_padding"; }
+                       }
+               }
+               part { name: "right_padding";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.0; to: "base"; offset: -120 0; }
+                               rel2 { relative: 1.0 1.0; to: "base"; }
+                       }
+               }
+       }
+}
+
+group { name: "locktype_button_layout";
+       parts {
+               part { name: "base";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 1.0 1.0; }
+                       }
+               }
+               part { name: "top_padding";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; to: "base"; }
+                               rel2 { relative: 1.0 0.0; to: "base"; offset: 0 20; }
+                       }
+               }
+               part { name: "locktype_button";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "top_padding"; }
+                               rel2 { relative: 1.0 0.0; to: "bottom_padding"; }
+                       }
+               }
+               part { name: "bottom_padding";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "base"; offset: 0 -20; }
+                               rel2 { relative: 1.0 1.0; to: "base"; }
+                       }
+               }
+       }
+}
+
+group { name: "sdcard_pw_button_layout";
+       parts {
+               part { name: "base";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 1.0 1.0; }
+                       }
+               }
+               part { name: "left_padding";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; to: "base"; }
+                               rel2 { relative: 0.0 1.0; to: "base"; offset: 15 0; }
+                               }
+               }
+               part { name: "change_pw_button";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.0; to: "left_padding"; }
+                               rel2 { relative: 0.0 1.0; to: "delete_pw_button"; }
+                               visible: 0;
+                       }
+                       description { state: "default_show" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 1;
+                       }
+               }
+               part { name: "delete_pw_button";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.0; to: "change_pw_button"; offset: 15 0; }
+                               rel2 { relative: 0.0 1.0; to: "right_padding"; }
+                               visible: 0;
+                       }
+                       description { state: "default_show" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 1;
+                       }
+               }
+               part { name: "create_pw_button";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.0; to: "left_padding"; offset: 80 0;}
+                               rel2 { relative: 0.0 1.0; to: "right_padding"; offset: -80 0;}
+                               visible: 0;
+                       }
+                       description { state: "default_show" 0.0;
+                               inherit: "default" 0.0;
+                               visible: 1;
+                       }
+               }
+               part { name: "right_padding";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.0; to: "base"; offset: -15 0; }
+                               rel2 { relative: 1.0 1.0; to: "base"; }
+                       }
+               }
+       }
+       programs {
+               program { name: "show,btn,createpw";
+                       signal: "show,btn,createpw";
+                       action: STATE_SET "default_show" 0.0;
+                       target: "create_pw_button";
+               }
+               program { name: "hide,btn,createpw";
+                       signal: "hide,btn,createpw";
+                       action: STATE_SET "default" 0.0;
+                       target: "create_pw_button";
+               }
+               program { name: "show,btn,changepw";
+                       signal: "show,btn,changepw";
+                       action: STATE_SET "default_show" 0.0;
+                       target: "change_pw_button";
+               }
+               program { name: "hide,btn,changepw";
+                       signal: "hide,btn,changepw";
+                       action: STATE_SET "default_show" 0.0;
+                       target: "change_pw_button";
+               }
+               program { name: "show,btn,deletepw";
+                       signal: "show,btn,deletepw";
+                       action: STATE_SET "default_show" 0.0;
+                       target: "delete_pw_button";
+               }
+               program { name: "hide,btn,deletepw";
+                       signal: "show,btn,deletepw";
+                       action: STATE_SET "default" 0.0;
+                       target: "delete_pw_button";
+               }
+       }
+}
+
+group { name: "Encrypt_device_layout";
+       parts {
+               part { name: "base";
+                       type: RECT;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               color: 255 255 255 255;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 1.0 1.0; }
+                       }
+               }
+               part { name: "msg_content_1";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.05 0.04; to: "base"; }
+                               rel2 { relative: 0.95 0.25; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "msg_content_2";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content_1"; offset: 0 20; }
+                               rel2 { relative: 0.95 0.50; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "msg_content_3";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content_2"; }
+                               rel2 { relative: 0.95 0.57; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "top_padding";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content_3";}
+                               rel2 { relative: 1.0 1.0; to: "msg_content_3"; offset: 0 10;}
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "battery_icon";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "top_padding"; }
+                               rel2 { relative: 0.0 1.0; to: "top_padding"; offset: 100 100; }
+                               min: 95 95;
+                               max: 95 95;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "battery_text";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.3; to: "battery_icon"; }
+                               rel2 { relative: 1.0 1.0; to_x: "top_padding"; to_y: "battery_icon";}
+                               align: 0.0 1.0;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "charge_icon";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "battery_icon"; }
+                               rel2 { relative: 1.0 1.0; to: "battery_icon"; offset: 0 100; }
+                               min: 95 95;
+                               max: 95 95;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "charge_text";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.3; to: "charge_icon"; }
+                               rel2 { relative: 1.0 1.0; to_x: "top_padding"; to_y: "charge_icon";}
+                               align: 0.0 1.0;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "locktype_icon";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "charge_icon"; }
+                               rel2 { relative: 1.0 1.0; to: "charge_icon"; offset: 0 100; }
+                               min: 95 95;
+                               max: 95 95;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "locktype_text";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.2; to: "locktype_icon"; }
+                               rel2 { relative: 1.0 1.0; to_x: "top_padding"; to_y: "locktype_icon";}
+                               align: 0.0 1.0;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "locktype_button_content";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0 0;
+                               rel1 { relative: 0.4 0.6; to: "locktype_text";}
+                               rel2 { relative: 1.0 0.6; to: "locktype_text"; offset: 0 100;}
+                               fixed: 1 1;
+                       }
+               }
+       }
+}
+
+group { name: "Decrypt_device_layout";
+       parts {
+               part { name: "base";
+                       type: RECT;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               color: 255 255 255 255;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 1.0 1.0; }
+                       }
+               }
+               part { name: "msg_content_1";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.05 0.04; to: "base"; }
+                               rel2 { relative: 0.95 0.15; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "msg_content_2";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content_1";}
+                               rel2 { relative: 0.95 0.30; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "msg_content_3";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content_2"; offset: 0 30;}
+                               rel2 { relative: 0.95 0.37; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "top_padding";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content_3"; }
+                               rel2 { relative: 1.0 1.0; to: "msg_content_3"; offset: 0 20; }
+                       }
+               }
+               part { name: "battery_icon";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "top_padding"; }
+                               rel2 { relative: 0.0 1.0; to: "top_padding"; offset: 100 100; }
+                               min: 95 95;
+                               max: 95 95;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "battery_text";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.3; to: "battery_icon"; }
+                               rel2 { relative: 1.0 1.0; to_x: "top_padding"; to_y: "battery_icon";}
+                               align: 0.0 1.0;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "charge_icon";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "battery_icon"; }
+                               rel2 { relative: 1.0 1.0; to: "battery_icon"; offset: 0 100; }
+                               min: 95 95;
+                               max: 95 95;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "charge_text";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.3; to: "charge_icon"; }
+                               rel2 { relative: 1.0 1.0; to_x: "top_padding"; to_y: "charge_icon"; }
+                               align: 0.0 1.0;
+                               fixed: 1 1;
+                       }
+               }
+       }
+}
+
+group { name: "Encrypt_sd_card_layout";
+       parts {
+               part { name: "base";
+                       type: RECT;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               color: 255 255 255 255;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 1.0 1.0; }
+                       }
+               }
+               part { name: "msg_content_1";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.05 0.04; to: "base"; }
+                               rel2 { relative: 0.95 0.17; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "msg_content_2";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content_1"; offset: 0 10; }
+                               rel2 { relative: 0.95 0.42; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "msg_content_3";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content_2"; offset: 0 10; }
+                               rel2 { relative: 0.95 0.62; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "msg_content_4";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content_3"; offset: 0 35; }
+                               rel2 { relative: 0.95 0.70; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "top_padding";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content_4"; }
+                               rel2 { relative: 1.0 1.0; to: "msg_content_4"; offset: 0 10; }
+                       }
+               }
+               part { name: "sd_card_icon";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "top_padding"; }
+                               rel2 { relative: 0.0 1.0; to: "top_padding"; offset: 100 100; }
+                               min: 95 95;
+                               max: 95 95;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "sd_card_text";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.3; to: "sd_card_icon";  }
+                               rel2 { relative: 1.0 1.0; to_x: "top_padding"; to_y: "sd_card_icon"; }
+                               align: 0.0 0.5;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "sd_card_pw_icon";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "sd_card_icon"; }
+                               rel2 { relative: 1.0 1.0; to: "sd_card_icon"; offset: 0 100; }
+                               min: 95 95;
+                               max: 95 95;
+                               visible: 0;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "sd_card_pw_icon_txt";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 1.0 0.3; to: "sd_card_pw_icon"; }
+                               rel2 { relative: 1.0 1.0; to_x: "top_padding"; to_y: "sd_card_pw_icon"; }
+                               align: 0.0 0.5;
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "sd_card_pw_btn";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "sd_card_pw_icon"; }
+                               rel2 { relative: 1.0 0.95; to: "base"; }
+                               align: 0.5 0.5;
+                               fixed: 1 1;
+                       }
+               }
+       }
+}
+
+group { name: "Decrypt_sd_card_layout";
+       parts {
+               part { name: "base";
+                       type: RECT;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               color: 255 255 255 255;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 1.0 1.0; }
+                       }
+               }
+               part { name: "msg_content";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.05 0.04; to: "base"; }
+                               rel2 { relative: 0.95 0.30; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "top_padding";
+                       type: SPACER;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content"; }
+                               rel2 { relative: 1.0 1.0; to: "msg_content"; offset: 0 15; }
+                       }
+               }
+               part { name: "change_pw_btn";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "top_padding"; }
+                               rel2 { relative: 1.0 0.95; to: "base"; }
+                               align: 0.5 0.5;
+                               visible: 0;
+                               fixed: 1 1;
+                       }
+               }
+       }
+}
+
+group { name: "confirm_layout";
+       parts {
+               part { name: "base";
+                       type: RECT;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               color: 255 255 255 255;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 1.0 1.0; }
+                       }
+               }
+               part { name: "msg_content_1";
+                       type: SWALLOW;
+                       scale: 1;
+                       description { state: "default" 0.0;
+                               rel1 { relative: 0.05 0.04; to: "base"; }
+                               rel2 { relative: 0.95 0.15; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+               part { name: "msg_content_2";
+                       type: SWALLOW;
+                       scale: 1;
+                               description { state: "default" 0.0;
+                               rel1 { relative: 0.0 1.0; to: "msg_content_1"; offset: 0 15; }
+                               rel2 { relative: 0.95 0.40; to: "base"; }
+                               fixed: 1 1;
+                       }
+               }
+       }
+}
diff --git a/tools/apps/ode/res/images/icon_encrypt_bar.png b/tools/apps/ode/res/images/icon_encrypt_bar.png
new file mode 100755 (executable)
index 0000000..3d47caa
Binary files /dev/null and b/tools/apps/ode/res/images/icon_encrypt_bar.png differ
diff --git a/tools/apps/ode/res/images/icon_encrypt_check.png b/tools/apps/ode/res/images/icon_encrypt_check.png
new file mode 100755 (executable)
index 0000000..a944ea1
Binary files /dev/null and b/tools/apps/ode/res/images/icon_encrypt_check.png differ
diff --git a/tools/apps/ode/res/org.tizen.ode.edc b/tools/apps/ode/res/org.tizen.ode.edc
new file mode 100755 (executable)
index 0000000..19d5dc2
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+collections {
+       base_scale: 1.8;
+       #include "./edc_resource/encryption_device.edc"
+}
diff --git a/tools/apps/ode/src/ode-app-confirm.c b/tools/apps/ode/src/ode-app-confirm.c
new file mode 100755 (executable)
index 0000000..abee81f
--- /dev/null
@@ -0,0 +1,195 @@
+/*
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "ode-app.h"
+
+static void _confirm_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
+{
+       appdata_s* ad = (appdata_s*) data;
+       dlog_print(DLOG_DEBUG, LOG_TAG, "_confirm_btn_clicked_cb start");
+
+       switch (ad->view_type) {
+       case ENCRYPT_DEVICE:
+               dlog_print(DLOG_DEBUG, LOG_TAG, "encrypt device confirm");
+               break;
+       case DECRYPT_DEVICE:
+               dlog_print(DLOG_DEBUG, LOG_TAG, "decrypt device confirm");
+               break;
+       case ENCRYPT_SD_CARD:
+               dlog_print(DLOG_DEBUG, LOG_TAG, "encrypt sd card confrim");
+               break;
+       case DECRYPT_SD_CARD:
+               dlog_print(DLOG_DEBUG, LOG_TAG, "decrypt sd card confrim");
+               break;
+       }
+
+       ui_app_exit();
+}
+
+static void set_confirm_next_btn_layout(Evas_Object* layout, appdata_s* ad, const char* btn_text)
+{
+       Evas_Object* btn_layout;
+       Evas_Object* next_btn;
+
+       btn_layout = dpm_encryption_create_layout(layout, ad->edj_path, "next_button_layout");
+
+       next_btn = dpm_encryption_create_button(btn_layout, btn_text, "bottom");
+       elm_object_part_content_set(btn_layout, "next_button", next_btn);
+
+       evas_object_smart_callback_add(next_btn, "clicked", _confirm_btn_clicked_cb, ad);
+
+       elm_object_part_content_set(layout, "bottom_layout", btn_layout);
+       return;
+}
+
+void dpm_encryption_device_confirm_create_view(appdata_s* ad)
+{
+       Evas_Object* naviframe = ad->navi_bar;
+       Evas_Object* base_layout = NULL;
+       Evas_Object* confirm_msg1, *confirm_msg2 = NULL;
+       Evas_Object* confirm_layout = NULL;
+       Evas_Textblock_Style* text_st;
+
+       dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_encryption_device_confirm_create_view");
+
+       if (naviframe == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "naviframe is null");
+               return;
+       }
+
+       base_layout = dpm_encryption_create_layout(naviframe, ad->edj_path, "base_layout");
+       confirm_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "confirm_layout");
+       text_st = evas_textblock_style_new();
+       evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
+
+       confirm_msg1 = dpm_encryption_create_textblock(confirm_layout, IDS_ST_BODY_CONFIRM_ENCRYPT_DEVICE_MSG_1, text_st);
+       elm_object_part_content_set(confirm_layout, "msg_content_1", confirm_msg1);
+       confirm_msg2 = dpm_encryption_create_textblock(confirm_layout, IDS_ST_BODY_CONFIRM_ENCRYPT_DEVICE_MSG_2, text_st);
+       elm_object_part_content_set(confirm_layout, "msg_content_2", confirm_msg2);
+       evas_textblock_style_free(text_st);
+
+       elm_object_part_content_set(base_layout, "content_layout", confirm_layout);
+       set_confirm_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_ENCRYPT_DEVICE);
+
+       elm_naviframe_item_push(naviframe, IDS_ST_HEADER_CONFIRM_ENCRYPTION, NULL, NULL, base_layout, NULL);
+}
+
+void dpm_decryption_device_confirm_create_view(appdata_s* ad)
+{
+       Evas_Object* naviframe = ad->navi_bar;
+       Evas_Object* base_layout = NULL;
+       Evas_Object* confirm_msg1, *confirm_msg2 = NULL;
+       Evas_Object* confirm_layout = NULL;
+       Evas_Textblock_Style* text_st;
+
+       dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_encryption_device_confirm_create_view");
+
+       if (naviframe == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "naviframe is null");
+               return;
+       }
+
+       base_layout = dpm_encryption_create_layout(naviframe, ad->edj_path, "base_layout");
+       confirm_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "confirm_layout");
+
+       text_st = evas_textblock_style_new();
+       evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
+
+       confirm_msg1 = dpm_encryption_create_textblock(confirm_layout, IDS_ST_BODY_CONFIRM_DECRYPT_DEVICE_MSG_1, text_st);
+       elm_object_part_content_set(confirm_layout, "msg_content_1", confirm_msg1);
+       confirm_msg2 = dpm_encryption_create_textblock(confirm_layout, IDS_ST_BODY_CONFIRM_DECRYPT_DEVICE_MSG_2, text_st);
+       elm_object_part_content_set(confirm_layout, "msg_content_2", confirm_msg2);
+
+       evas_textblock_style_free(text_st);
+
+       elm_object_part_content_set(base_layout, "content_layout", confirm_layout);
+
+       set_confirm_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_DECRYPT_DEVICE);
+
+       elm_naviframe_item_push(naviframe, IDS_ST_HEADER_CONFIRM_DECRYPTION, NULL, NULL, base_layout, NULL);
+}
+
+void dpm_encryption_sd_card_confirm_create_view(appdata_s* ad)
+{
+       Evas_Object* naviframe = ad->navi_bar;
+       Evas_Object* base_layout = NULL;
+       Evas_Object* confirm_msg1, *confirm_msg2 = NULL;
+       Evas_Object* confirm_layout = NULL;
+       Evas_Textblock_Style* text_st;
+
+       dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_encryption_device_confirm_create_view");
+
+       if (naviframe == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "naviframe is null");
+               return;
+       }
+
+       base_layout = dpm_encryption_create_layout(naviframe, ad->edj_path, "base_layout");
+       confirm_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "confirm_layout");
+
+       text_st = evas_textblock_style_new();
+       evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
+
+       confirm_msg1 = dpm_encryption_create_textblock(confirm_layout, IDS_ST_BODY_CONFIRM_ENCRYPT_SD_CARD_MSG_1, text_st);
+       elm_object_part_content_set(confirm_layout, "msg_content_1", confirm_msg1);
+       confirm_msg2 = dpm_encryption_create_textblock(confirm_layout, IDS_ST_BODY_CONFIRM_ENCRYPT_SD_CARD_MSG_2, text_st);
+       elm_object_part_content_set(confirm_layout, "msg_content_2", confirm_msg2);
+
+       evas_textblock_style_free(text_st);
+
+       elm_object_part_content_set(base_layout, "content_layout", confirm_layout);
+
+       set_confirm_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_ENCRYPT_SD_CARD_ABB);
+
+       elm_naviframe_item_push(naviframe, IDS_ST_HEADER_CONFIRM_ENCRYPTION, NULL, NULL, base_layout, NULL);
+}
+
+void dpm_decryption_sd_card_confirm_create_view(appdata_s* ad)
+{
+       Evas_Object* naviframe = ad->navi_bar;
+       Evas_Object* base_layout = NULL;
+       Evas_Object* confirm_msg1, *confirm_msg2 = NULL;
+       Evas_Object* confirm_layout = NULL;
+       Evas_Textblock_Style* text_st;
+
+       dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_encryption_device_confirm_create_view");
+
+       if (naviframe == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "naviframe is null");
+               return;
+       }
+
+       base_layout = dpm_encryption_create_layout(naviframe, ad->edj_path, "base_layout");
+       confirm_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "confirm_layout");
+
+       text_st = evas_textblock_style_new();
+       evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
+
+       confirm_msg1 = dpm_encryption_create_textblock(confirm_layout, IDS_ST_BODY_CONFIRM_DECRYPT_SD_CARD_MSG_1, text_st);
+       elm_object_part_content_set(confirm_layout, "msg_content_1", confirm_msg1);
+       confirm_msg2 = dpm_encryption_create_textblock(confirm_layout, IDS_ST_BODY_CONFIRM_DECRYPT_SD_CARD_MSG_2, text_st);
+       elm_object_part_content_set(confirm_layout, "msg_content_2", confirm_msg2);
+
+       evas_textblock_style_free(text_st);
+
+       elm_object_part_content_set(base_layout, "content_layout", confirm_layout);
+
+       set_confirm_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_DECRYPT_SD_CARD_ABB3);
+
+       elm_naviframe_item_push(naviframe, IDS_ST_HEADER_CONFIRM_DECRYPTION, NULL, NULL, base_layout, NULL);
+}
diff --git a/tools/apps/ode/src/ode-app-main.c b/tools/apps/ode/src/ode-app-main.c
new file mode 100755 (executable)
index 0000000..341447b
--- /dev/null
@@ -0,0 +1,675 @@
+/*
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "ode-app.h"
+
+#define APP_SETTING_LOCKTYPE "org.tizen.setting-locktype"
+#define APP_SETTING_PASSWORD "org.tizen.setting-password"
+
+static void update_next_button_status(appdata_s* ad)
+{
+       dlog_print(DLOG_DEBUG, LOG_TAG, "update_next_button_status start");
+       if (ad->device_info.next_button == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "[Encrypt Device] next button is null");
+               return;
+       }
+
+       if (ad->view_type == ENCRYPT_DEVICE) {
+               if (ad->device_info.battery_status && ad->device_info.charger_status && ad->device_info.locktype_status) {
+                       elm_object_disabled_set(ad->device_info.next_button, EINA_FALSE);
+               } else {
+                       elm_object_disabled_set(ad->device_info.next_button, EINA_TRUE);
+               }
+       } else if (ad->view_type == DECRYPT_DEVICE) {
+               if (ad->device_info.battery_status && ad->device_info.charger_status) {
+                       elm_object_disabled_set(ad->device_info.next_button, EINA_FALSE);
+               } else {
+                       elm_object_disabled_set(ad->device_info.next_button, EINA_TRUE);
+               }
+       } else if (ad->view_type == ENCRYPT_SD_CARD) {
+               if (ad->device_info.sdcard_status) {
+                       elm_object_disabled_set(ad->device_info.next_button, EINA_FALSE);
+               } else {
+                       elm_object_disabled_set(ad->device_info.next_button, EINA_TRUE);
+               }
+       }
+}
+
+static void _next_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
+{
+       dlog_print(DLOG_DEBUG, LOG_TAG, "_next_btn_clicked_cb start");
+
+       appdata_s* ad = (appdata_s*) data;
+
+       switch (ad->view_type) {
+       case ENCRYPT_DEVICE:
+               dpm_encryption_device_confirm_create_view(ad);
+               break;
+       case DECRYPT_DEVICE:
+               dpm_decryption_device_confirm_create_view(ad);
+               break;
+       case ENCRYPT_SD_CARD:
+               dpm_encryption_sd_card_confirm_create_view(ad);
+               break;
+       case DECRYPT_SD_CARD:
+               dpm_decryption_sd_card_confirm_create_view(ad);
+               break;
+       }
+}
+
+static void set_next_btn_layout(Evas_Object* layout, appdata_s* ad, const char* btn_text)
+{
+       Evas_Object* btn_layout;
+       Evas_Object* next_btn;
+
+       btn_layout = dpm_encryption_create_layout(layout, ad->edj_path, "next_button_layout");
+
+       next_btn = dpm_encryption_create_button(btn_layout, btn_text, "bottom");
+       ad->device_info.next_button = next_btn;
+       elm_object_part_content_set(btn_layout, "next_button", next_btn);
+
+       update_next_button_status(ad);
+       evas_object_smart_callback_add(next_btn, "clicked", _next_btn_clicked_cb, ad);
+
+       elm_object_part_content_set(layout, "bottom_layout", btn_layout);
+       return;
+}
+
+static void _launch_password_ug_cb(app_control_h ug, app_control_h reply, app_control_result_e result, void* data)
+{
+       if (!result) {
+               char* string_result = NULL;
+               char* current = NULL;
+               app_control_get_extra_data(reply, "result", &string_result);
+               if (string_result == NULL)
+                       return;
+
+               int ret_int = 0;
+               if (strcmp(string_result, "Cancel") == 0)
+                       ret_int = 0;
+               else if (strcmp(string_result, "SETTING_PW_TYPE_ENTER_LOCK_TYPE") == 0 || strcmp(string_result, "SETTING_PW_TYPE_VERIFY_FP_ALT_PASSWORD") == 0)
+                       ret_int = 1;
+
+               free(string_result);
+
+               if (ret_int == 1) {
+                       app_control_h app_ctl;
+                       if (app_control_create(&app_ctl)) {
+                               dlog_print(DLOG_ERROR, LOG_TAG, "app_control_create failed");
+                               return;
+                       }
+                       app_control_get_extra_data(reply, "current", &current);
+                       if (current) {
+                               app_control_add_extra_data(app_ctl, "current", current);
+                               free(current);
+                       }
+                       app_control_set_app_id(app_ctl, APP_SETTING_LOCKTYPE);
+                       app_control_set_launch_mode(app_ctl, APP_CONTROL_LAUNCH_MODE_GROUP);
+                       app_control_send_launch_request(app_ctl, NULL, NULL);
+                       app_control_destroy(app_ctl);
+               }
+       }
+}
+
+static void _locktype_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
+{
+       /* launch lock type menu */
+       dlog_print(DLOG_DEBUG, LOG_TAG, "locktype button clicked");
+       appdata_s*ad = (appdata_s*) data;
+
+       app_control_h app_ctl = NULL;
+       int ret;
+       int lock_type = 0;
+
+       ret = app_control_create(&app_ctl);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_DEBUG, LOG_TAG, "app_control_create failed");
+               return;
+       }
+
+       vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &lock_type);
+
+       if (lock_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD || lock_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) {
+               app_control_add_extra_data(app_ctl, "viewtype", "SETTING_PW_TYPE_ENTER_LOCK_TYPE");
+               app_control_set_app_id(app_ctl, APP_SETTING_PASSWORD);
+               app_control_set_launch_mode(app_ctl, APP_CONTROL_LAUNCH_MODE_GROUP);
+               app_control_send_launch_request(app_ctl, _launch_password_ug_cb, NULL);
+               app_control_destroy(app_ctl);
+
+       } else {
+               app_control_set_app_id(app_ctl, APP_SETTING_LOCKTYPE);
+               app_control_set_launch_mode(app_ctl, APP_CONTROL_LAUNCH_MODE_GROUP);
+               app_control_send_launch_request(app_ctl, NULL, NULL);
+               app_control_destroy(app_ctl);
+       }
+
+       update_next_button_status(ad);
+}
+
+static void _sdcardpw_create_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
+{
+       dlog_print(DLOG_ERROR, LOG_TAG, "sdcardpw create btn cb start");
+}
+
+static void _sdcardpw_change_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
+{
+       dlog_print(DLOG_ERROR, LOG_TAG, "sdcardpw change btn cb start");
+}
+
+static void _sdcardpw_delete_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
+{
+       dlog_print(DLOG_ERROR, LOG_TAG, "sdcardpw delete btn cb start");
+}
+
+static void set_locktype_btn_layout(Evas_Object* layout, appdata_s* ad, const char* btn_text)
+{
+       Evas_Object* btn_layout;
+       Evas_Object* locktype_btn;
+
+       btn_layout = dpm_encryption_create_layout(layout, ad->edj_path, "locktype_button_layout");
+
+       locktype_btn = dpm_encryption_create_button(btn_layout, btn_text, "default");
+       elm_object_part_content_set(btn_layout, "locktype_button", locktype_btn);
+       evas_object_smart_callback_add(locktype_btn, "clicked", _locktype_btn_clicked_cb, ad);
+
+       elm_object_part_content_set(layout, "locktype_button_content", btn_layout);
+       return;
+}
+
+static void set_sdcard_pw_btn_layout(Evas_Object* layout, appdata_s* ad)
+{
+       Evas_Object* btn_layout;
+       Evas_Object* createpw_btn, *changepw_btn, *deletepw_btn;
+
+       btn_layout = dpm_encryption_create_layout(layout, ad->edj_path, "sdcard_pw_button_layout");
+
+       createpw_btn = dpm_encryption_create_button(btn_layout, IDS_ST_BUTTON_CREATE_PASSWORD, "default");
+       changepw_btn = dpm_encryption_create_button(btn_layout, IDS_ST_BUTTON_CHANGE_PW_ABB, "default");
+       deletepw_btn = dpm_encryption_create_button(btn_layout, IDS_ST_BUTTON_DELETE_PW_ABB, "default");
+
+       elm_object_part_content_set(btn_layout, "create_pw_button", btn_layout);
+       elm_object_part_content_set(btn_layout, "change_pw_button", btn_layout);
+       elm_object_part_content_set(btn_layout, "delete_pw_button", btn_layout);
+
+       evas_object_smart_callback_add(createpw_btn, "clicked", _sdcardpw_create_btn_clicked_cb, NULL);
+       evas_object_smart_callback_add(changepw_btn, "clicked", _sdcardpw_change_btn_clicked_cb, NULL);
+       evas_object_smart_callback_add(deletepw_btn, "clicked", _sdcardpw_delete_btn_clicked_cb, NULL);
+
+       elm_object_part_content_set(layout, "sd_card_btn", btn_layout);
+       return;
+}
+
+static void set_icon(appdata_s* ad, int type, char* part)
+{
+       Evas_Object* icon_check, *icon_bar = NULL;
+       int ret;
+       if (ad->dpm_encryption_layout == NULL || ad->icon_check_path == NULL || ad->icon_bar_path == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "invalid parameter");
+               return;
+       }
+       if (type == ICON_CHECK) {
+               icon_check = elm_image_add(ad->dpm_encryption_layout);
+               if (icon_check == NULL) {
+                       dlog_print(DLOG_ERROR, LOG_TAG, "elm_image_add failed");
+                       return;
+               }
+               elm_image_file_set(icon_check, ad->icon_check_path, NULL);
+               evas_object_color_set(icon_check, 153, 153, 153, 255);
+               evas_object_size_hint_align_set(icon_check, EVAS_HINT_FILL, EVAS_HINT_FILL);
+               evas_object_size_hint_weight_set(icon_check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+               ret = elm_layout_content_set(ad->dpm_encryption_layout, part, icon_check);
+               if (!ret) {
+                       dlog_print(DLOG_ERROR, LOG_TAG, "elm_layout_content_set failed");
+                       return;
+               }
+               evas_object_show(icon_check);
+       } else if (type == ICON_BAR) {
+               icon_bar = elm_image_add(ad->dpm_encryption_layout);
+               if (icon_bar == NULL) {
+                       dlog_print(DLOG_ERROR, LOG_TAG, "elm_image_add failed");
+                       return;
+               }
+               elm_image_file_set(icon_bar, ad->icon_bar_path, NULL);
+               evas_object_color_set(icon_bar, 0, 0, 0, 255);
+               evas_object_size_hint_align_set(icon_bar, EVAS_HINT_FILL, EVAS_HINT_FILL);
+               evas_object_size_hint_weight_set(icon_bar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+               ret = elm_layout_content_set(ad->dpm_encryption_layout, part, icon_bar);
+               if (!ret) {
+                       dlog_print(DLOG_ERROR, LOG_TAG, "elm_layout_content_set failed");
+                       return;
+               }
+               evas_object_show(icon_bar);
+       }
+}
+
+static int battery_status_update(appdata_s* ad)
+{
+       bool connected;
+       int battery_pct, ret;
+       dlog_print(DLOG_DEBUG, LOG_TAG, "battery_status_update start ");
+
+       if (ad->dpm_encryption_layout == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "encrypt layout is null");
+               return -1;
+       }
+
+       /* get battery percent info */
+       ret = device_battery_get_percent(&battery_pct);
+       if (ret != DEVICE_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "device_battery_get_percent failed %d", ret);
+               return -1;
+       }
+
+       if (battery_pct > NEEDED_BATTERY_PERCENT) {
+               set_icon(ad, ICON_CHECK, "battery_icon");
+               ad->device_info.battery_status = 1;
+       } else {
+               set_icon(ad, ICON_BAR, "battery_icon");
+               ad->device_info.battery_status = 0;
+       }
+
+       /* get charger connected info */
+       ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_CHARGER_CONNECTED, &connected);
+       if (ret != RUNTIME_INFO_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "get runtime info fail");
+               return -1;
+       }
+       if (connected) {
+               set_icon(ad, ICON_CHECK, "charge_icon");
+               ad->device_info.charger_status = 1;
+       } else {
+               set_icon(ad, ICON_BAR, "charge_icon");
+               ad->device_info.charger_status = 0;
+       }
+
+       update_next_button_status(ad);
+       return 0;
+}
+
+static int sdcard_status_update(appdata_s* ad)
+{
+       int sdcard_status;
+
+       if (ad->dpm_encryption_layout == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "encrypt layout is null");
+               return -1;
+       }
+
+       vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &sdcard_status);
+       if (sdcard_status != VCONFKEY_SYSMAN_MMC_MOUNTED) {
+               set_icon(ad, ICON_BAR, "sd_card_icon");
+               ad->device_info.sdcard_status = 0;
+       } else {
+               /* available */
+               set_icon(ad, ICON_CHECK, "sd_card_icon");
+               ad->device_info.sdcard_status = 1;
+       }
+
+       update_next_button_status(ad);
+       return 0;
+}
+
+static int locktype_status_update(appdata_s* ad)
+{
+       int lock_type;
+
+       if (ad->dpm_encryption_layout == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "encrypt layout is null");
+               return -1;
+       }
+
+       vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &lock_type);
+       if (lock_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD || lock_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD) {
+               /* available */
+               set_icon(ad, ICON_CHECK, "locktype_icon");
+               ad->device_info.locktype_status = 1;
+       } else {
+               /* unavailable */
+               set_icon(ad, ICON_BAR, "locktype_icon");
+               ad->device_info.locktype_status = 0;
+       }
+       update_next_button_status(ad);
+       return 0;
+}
+
+static void battery_charger_changed_cb(runtime_info_key_e key, void* data)
+{
+       appdata_s* ad = (appdata_s*) data;
+       if (key == RUNTIME_INFO_KEY_CHARGER_CONNECTED)
+               battery_status_update(ad);
+}
+
+void battery_changed_cb(device_callback_e type, void* value, void* user_data)
+{
+       appdata_s* ad = (appdata_s*) user_data;
+       if (type == DEVICE_CALLBACK_BATTERY_CAPACITY)
+               battery_status_update(ad);
+}
+
+void sdcard_status_changed_cb(keynode_t* node, void* data)
+{
+       appdata_s* ad = (appdata_s*) data;
+       sdcard_status_update(ad);
+}
+
+void locktype_status_changed_cb(keynode_t* node, void* data)
+{
+       appdata_s* ad = (appdata_s*) data;
+       locktype_status_update(ad);
+}
+
+static int battery_cb_register(appdata_s* ad)
+{
+       int ret;
+
+       /* register runtime callback : connected charger */
+       ret = runtime_info_set_changed_cb(RUNTIME_INFO_KEY_CHARGER_CONNECTED, battery_charger_changed_cb, ad);
+       if (ret != RUNTIME_INFO_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "runtime_info_set_changed_cb failed: %d", ret);
+               return -1;
+       }
+
+       /* register runtime callback : battery percent */
+       ret = device_add_callback(DEVICE_CALLBACK_BATTERY_CAPACITY, battery_changed_cb, ad);
+       if (ret != DEVICE_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "device_add_callback failed: %d", ret);
+               return -1;
+       }
+
+       return 0;
+}
+
+static int locktype_cb_register(appdata_s* ad)
+{
+       int ret;
+
+       /* register vconf notify for locktype */
+       ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, locktype_status_changed_cb, ad);
+       if (ret != 0) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "runtime_info_set_changed_cb failed: %d", ret);
+               return -1;
+       }
+
+       return 0;
+}
+
+void _back_btn_clicked_cb(void* data, Evas_Object* obj, void* event_info)
+{
+       ui_app_exit();
+}
+
+static Eina_Bool _pop_cb(void* data, Elm_Object_Item* it)
+{
+       ui_app_exit();
+       return EINA_FALSE;
+}
+
+void sw_back_btn_set(Evas_Object* obj, const char* title_label, Evas_Object* content)
+{
+       Evas_Object* back_btn = NULL;
+
+       back_btn = elm_button_add(obj);
+       elm_object_style_set(back_btn, "naviframe/back_btn/default");
+       evas_object_smart_callback_add(back_btn, "clicked", _back_btn_clicked_cb, obj);
+
+       Elm_Object_Item *nf_it = elm_naviframe_item_push(obj, title_label, back_btn, NULL, content, NULL);
+       elm_naviframe_item_pop_cb_set(nf_it, _pop_cb, NULL);
+}
+
+void dpm_encryption_create_view(appdata_s* ad)
+{
+       Evas_Object* navi_bar = ad->navi_bar;
+       Evas_Object* base_layout = NULL;
+       Evas_Object* encrypt_msg1, *encrypt_msg2, *encrypt_msg3 = NULL;
+       Evas_Object* battery_txt, *charge_txt, *locktype_txt = NULL;
+       Evas_Object* encryption_layout = NULL;
+       Evas_Textblock_Style* text_st;
+
+       int ret;
+
+       dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_encryption_create_view");
+
+       if (navi_bar == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "navi_bar is null");
+               return;
+       }
+
+       base_layout = dpm_encryption_create_layout(navi_bar, ad->edj_path, "base_layout");
+       encryption_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "Encrypt_device_layout");
+       ad->dpm_encryption_layout = encryption_layout;
+
+       text_st = evas_textblock_style_new();
+       evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
+
+       encrypt_msg1 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_ENCRYPTING_MSG_1, text_st);
+       elm_object_part_content_set(encryption_layout, "msg_content_1", encrypt_msg1);
+       encrypt_msg2 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_ENCRYPTING_MSG_2, text_st);
+       elm_object_part_content_set(encryption_layout, "msg_content_2", encrypt_msg2);
+       encrypt_msg3 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_TO_ENCRYPTION_YOUR_DEVICE_C_ABB, text_st);
+       elm_object_part_content_set(encryption_layout, "msg_content_3", encrypt_msg3);
+
+       set_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_NEXT);
+
+       /* get battery info */
+       ret = battery_status_update(ad);
+       if (ret != 0) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "battery_status_update failed");
+               return;
+       }
+
+       ret = battery_cb_register(ad);
+       if (ret != 0) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "battery_cb_register failed");
+               return;
+       }
+
+       /* get locktype */
+       ret = locktype_status_update(ad);
+       if (ret != 0) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "locktype_status_update failed");
+               return;
+       }
+
+       ret = locktype_cb_register(ad);
+       if (ret != 0) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "locktype_cb_register failed");
+               return;
+       }
+
+       /* set layout text */
+       battery_txt = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_CHARGE_THE_BATTERY_TO_AT_LEAST_PDP, text_st);
+       elm_object_part_content_set(encryption_layout, "battery_text", battery_txt);
+       charge_txt = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_CONNECT_THE_DEVICE_TO_A_CHARGER, text_st);
+       evas_object_size_hint_weight_set(charge_txt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_part_content_set(encryption_layout, "charge_text", charge_txt);
+       locktype_txt = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_SET_THE_SCREEN_LOCK_TYPE_AS_PATTERN_PIN_OR_PASSWORD, text_st);
+       elm_object_part_content_set(encryption_layout, "locktype_text", locktype_txt);
+
+       evas_textblock_style_free(text_st);
+
+       set_locktype_btn_layout(encryption_layout, ad, IDS_ST_BUTTON_SCREEN_LOCK_TYPE_ABB);
+
+       elm_object_part_content_set(base_layout, "content_layout", encryption_layout);
+
+       sw_back_btn_set(navi_bar, IDS_ST_HEADER_ENCRYPT_DEVICE, base_layout);
+}
+
+void dpm_decryption_create_view(appdata_s* ad)
+{
+       Evas_Object* navi_bar = ad->navi_bar;
+       Evas_Object* base_layout = NULL;
+       Evas_Object* decrypt_msg1, *decrypt_msg2, *decrypt_msg3 = NULL;
+       Evas_Object* battery_txt, *charge_txt = NULL;
+       Evas_Object* decryption_layout = NULL;
+       Evas_Textblock_Style* text_st;
+
+       int ret;
+
+       dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_decryption_create_view");
+
+       if (navi_bar == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "navi_bar is null");
+               return;
+       }
+
+       base_layout = dpm_encryption_create_layout(navi_bar, ad->edj_path, "base_layout");
+       decryption_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "Decrypt_device_layout");
+       ad->dpm_encryption_layout = decryption_layout;
+
+       text_st = evas_textblock_style_new();
+       evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
+
+       decrypt_msg1 = dpm_encryption_create_textblock(decryption_layout, IDS_ST_BODY_DECRYPTING_MSG_1, text_st);
+       elm_object_part_content_set(decryption_layout, "msg_content_1", decrypt_msg1);
+       decrypt_msg2 = dpm_encryption_create_textblock(decryption_layout, IDS_ST_BODY_DECRYPTING_MSG_2, text_st);
+       elm_object_part_content_set(decryption_layout, "msg_content_2", decrypt_msg2);
+       decrypt_msg3 = dpm_encryption_create_textblock(decryption_layout, IDS_ST_HEADER_TO_DECRYPT_YOUR_DEVICE_C_ABB, text_st);
+       elm_object_part_content_set(decryption_layout, "msg_content_3", decrypt_msg3);
+
+       set_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_NEXT);
+
+       /* get battery info */
+       ret = battery_status_update(ad);
+       if (ret != 0) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "battery_status_update failed");
+               return;
+       }
+
+       ret = battery_cb_register(ad);
+       if (ret != 0) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "battery_cb_register failed");
+               return;
+       }
+
+       /* set layout text */
+       battery_txt = dpm_encryption_create_textblock(decryption_layout, IDS_ST_BODY_CHARGE_THE_BATTERY_TO_AT_LEAST_PDP, text_st);
+       elm_object_part_content_set(decryption_layout, "battery_text", battery_txt);
+       charge_txt = dpm_encryption_create_textblock(decryption_layout, IDS_ST_BODY_CONNECT_THE_DEVICE_TO_A_CHARGER, text_st);
+       elm_object_part_content_set(decryption_layout, "charge_text", charge_txt);
+
+       evas_textblock_style_free(text_st);
+
+       elm_object_part_content_set(base_layout, "content_layout", decryption_layout);
+
+       sw_back_btn_set(navi_bar, IDS_ST_HEADER_DECRYPT_DEVICE, base_layout);
+}
+
+void dpm_encryption_sd_card_create_view(appdata_s* ad)
+{
+       Evas_Object* navi_bar = ad->navi_bar;
+       Evas_Object* base_layout = NULL;
+       Evas_Object* encrypt_msg1, *encrypt_msg2, *encrypt_msg3, *encrypt_msg4 = NULL;
+       Evas_Object* sdcard_txt = NULL;
+       /* Evas_Object* password_txt = NULL; */
+       Evas_Object* encryption_layout = NULL;
+       Evas_Textblock_Style* text_st;
+
+       int ret;
+
+       dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_encryption_create_view");
+
+       if (navi_bar == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "navi_bar is null");
+               return;
+       }
+
+       base_layout = dpm_encryption_create_layout(navi_bar, ad->edj_path, "base_layout");
+       encryption_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "Encrypt_sd_card_layout");
+       ad->dpm_encryption_layout = encryption_layout;
+
+       text_st = evas_textblock_style_new();
+       evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
+
+       encrypt_msg1 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_1, text_st);
+       elm_object_part_content_set(encryption_layout, "msg_content_1", encrypt_msg1);
+       encrypt_msg2 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_2, text_st);
+       elm_object_part_content_set(encryption_layout, "msg_content_2", encrypt_msg2);
+       encrypt_msg3 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_SD_CARD_ENCRYPTING_MSG_3, text_st);
+       elm_object_part_content_set(encryption_layout, "msg_content_3", encrypt_msg3);
+       encrypt_msg4 = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_TO_ENCRYPT_YOUR_SD_CARD_C, text_st);
+       elm_object_part_content_set(encryption_layout, "msg_content_4", encrypt_msg4);
+
+       set_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_NEXT);
+
+       /* get sdcard info */
+       ret = sdcard_status_update(ad);
+       if (ret != 0) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "sdcard_status_update failed");
+               return;
+       }
+
+       /* register vconf notify callback : sdcard status */
+       ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, sdcard_status_changed_cb, ad);
+       if (ret != 0) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "runtime_info_set_changed_cb failed: %d", ret);
+               return;
+       }
+
+       /* set layout text */
+       sdcard_txt = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_INSERT_THE_SD_CARD_ABB, text_st);
+       elm_object_part_content_set(encryption_layout, "sd_card_text", sdcard_txt);
+       /*password_txt = dpm_encryption_create_textblock(encryption_layout, IDS_ST_BODY_CREATE_AN_SD_CARD_PASSWORD, text_st);
+          elm_object_part_content_set(encryption_layout, "charge_text", password_txt); */
+
+       evas_textblock_style_free(text_st);
+
+       set_sdcard_pw_btn_layout(encryption_layout, ad);
+
+       /* to do : set password button */
+
+       elm_object_part_content_set(base_layout, "content_layout", encryption_layout);
+
+       sw_back_btn_set(navi_bar, IDS_ST_HEADER_ENCRYPT_SD_CARD, base_layout);
+}
+
+void dpm_decryption_sd_card_create_view(appdata_s* ad)
+{
+       Evas_Object* navi_bar = ad->navi_bar;
+       Evas_Object* base_layout = NULL;
+       Evas_Object* decrypt_msg = NULL;
+       Evas_Object* decryption_layout = NULL;
+       Evas_Textblock_Style* text_st;
+
+       dlog_print(DLOG_DEBUG, LOG_TAG, "start dpm_decryption_sd_card_create_view");
+
+       if (navi_bar == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "navi_bar is null");
+               return;
+       }
+
+       base_layout = dpm_encryption_create_layout(navi_bar, ad->edj_path, "base_layout");
+       decryption_layout = dpm_encryption_create_layout(base_layout, ad->edj_path, "Decrypt_sd_card_layout");
+       ad->dpm_encryption_layout = decryption_layout;
+
+       text_st = evas_textblock_style_new();
+       evas_textblock_style_set(text_st, MSG_TEXT_STYLE);
+
+       decrypt_msg = dpm_encryption_create_textblock(decryption_layout, IDS_ST_BODY_SD_CARD_DECRYPTION_MSG, text_st);
+       elm_object_part_content_set(decryption_layout, "msg_content", decrypt_msg);
+
+       evas_textblock_style_free(text_st);
+
+       /* to do : set change password button */
+
+       elm_object_part_content_set(base_layout, "content_layout", decryption_layout);
+
+       set_next_btn_layout(base_layout, ad, IDS_ST_BUTTON_NEXT);
+       sw_back_btn_set(navi_bar, IDS_ST_HEADER_ENCRYPT_SD_CARD, base_layout);
+}
diff --git a/tools/apps/ode/src/ode-app-widget.c b/tools/apps/ode/src/ode-app-widget.c
new file mode 100755 (executable)
index 0000000..29616ab
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "ode-app.h"
+
+Evas_Object* dpm_encryption_create_layout(Evas_Object* parent, const char* file, const char* group)
+{
+       Evas_Object* layout = NULL;
+
+       if (parent == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "parent is null");
+               return NULL;
+       }
+
+       layout = elm_layout_add(parent);
+       if (layout == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "Cannot add layout");
+               return NULL;
+       }
+
+       if ((file != NULL) && (group != NULL))
+               elm_layout_file_set(layout, file, group);
+       else
+               elm_layout_theme_set(layout, "layout", "application", "default");
+
+       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_show(layout);
+
+       return layout;
+}
+
+Evas_Object* dpm_encryption_create_navigation(Evas_Object* parent)
+{
+       Evas_Object* navi_bar = NULL;
+
+       if (parent == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "parent is null");
+               return NULL;
+       }
+
+       navi_bar = elm_naviframe_add(parent);
+       eext_object_event_callback_add(navi_bar, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
+       elm_object_part_content_set(parent, "elm.swallow.content", navi_bar);
+       evas_object_show(navi_bar);
+
+       return navi_bar;
+}
+
+Evas_Object* dpm_encryption_create_button(Evas_Object* parent, const char* text, const char* style)
+{
+       Evas_Object* btn = elm_button_add(parent);
+
+       evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_text_set(btn, text);
+
+       if (style != NULL)
+               elm_object_style_set(btn, style);
+
+       evas_object_show(btn);
+
+       return btn;
+}
+
+Evas_Object* dpm_encryption_create_textblock(Evas_Object* parent, const char* text, Evas_Textblock_Style* style)
+{
+       Evas_Object* txt = evas_object_textblock_add(parent);
+
+       if (style != NULL)
+               evas_object_textblock_style_set(txt, style);
+       evas_object_textblock_text_markup_set(txt, text);
+       evas_object_show(txt);
+
+       return txt;
+
+}
diff --git a/tools/apps/ode/src/ode-app.c b/tools/apps/ode/src/ode-app.c
new file mode 100755 (executable)
index 0000000..c4fe97f
--- /dev/null
@@ -0,0 +1,259 @@
+/*
+ * Tizen ODE application
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Contact: SeolHeui Kim <s414.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "ode-app.h"
+
+static Evas_Object* create_mainview(appdata_s* ad)
+{
+       Evas_Object* base_layout = NULL;
+       Evas_Object* navi_bar = NULL;
+
+       base_layout = dpm_encryption_create_layout(ad->conform, NULL, NULL);
+
+       navi_bar = dpm_encryption_create_navigation(base_layout);
+       elm_naviframe_prev_btn_auto_pushed_set(navi_bar, EINA_TRUE);
+       ad->navi_bar = navi_bar;
+
+       switch (ad->view_type) {
+       case ENCRYPT_DEVICE:
+               dpm_encryption_create_view(ad);
+               break;
+       case DECRYPT_DEVICE:
+               dpm_decryption_create_view(ad);
+               break;
+       case ENCRYPT_SD_CARD:
+               dpm_encryption_sd_card_create_view(ad);
+               break;
+       case DECRYPT_SD_CARD:
+               dpm_decryption_sd_card_create_view(ad);
+               break;
+       }
+       return base_layout;
+}
+
+static void win_delete_request_cb(void* data, Evas_Object* obj, void* event_info)
+{
+       ui_app_exit();
+}
+
+static Eina_Bool _home_key_cb(void *data, int type, void *event)
+{
+       Evas_Event_Key_Down *ev = event;
+       if (!strcmp(ev->keyname, "XF86Home"))
+               ui_app_exit();
+       return EINA_TRUE;
+}
+
+static int create_base_gui(appdata_s* ad)
+{
+       dlog_print(DLOG_DEBUG, LOG_TAG, "### create base gui start  ###");
+       char* res_path = NULL;
+       char edj_path[PATH_MAX], icon_check_path[PATH_MAX], icon_bar_path[PATH_MAX] = "\0";
+
+       /* get EDJ & icon path */
+       res_path = app_get_resource_path();
+       if (res_path == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "failed get resource path");
+               ui_app_exit();
+               return 1;
+       }
+       snprintf(edj_path, PATH_MAX, "%s%s", res_path, "org.tizen.ode.edj");
+       ad->edj_path = strdup(edj_path);
+       snprintf(icon_check_path, PATH_MAX, "%s%s", res_path, "images/icon_encrypt_check.png");
+       ad->icon_check_path = strdup(icon_check_path);
+       snprintf(icon_bar_path, PATH_MAX, "%s%s", res_path, "images/icon_encrypt_bar.png");
+       ad->icon_bar_path = strdup(icon_bar_path);
+       free(res_path);
+
+       /* Window */
+       ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
+       elm_win_conformant_set(ad->win, EINA_TRUE);
+       elm_win_autodel_set(ad->win, EINA_TRUE);
+       evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
+
+       /* Conformant */
+       ad->conform = elm_conformant_add(ad->win);
+       evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_win_resize_object_add(ad->win, ad->conform);
+       evas_object_show(ad->conform);
+
+       /* Indicator */
+       elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
+       elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_TRANSPARENT);
+
+       ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _home_key_cb, NULL);
+
+       ad->base = create_mainview(ad);
+       elm_object_content_set(ad->conform, ad->base);
+       evas_object_show(ad->win);
+
+       return 0;
+}
+
+static bool app_create(void* data)
+{
+       return true;
+}
+
+static void app_control(app_control_h app_control, void* data)
+{
+       /* Handle the launch request. */
+       appdata_s* ad = (appdata_s*)data;
+       int ret;
+       char *viewtype = NULL;
+
+       ret = app_control_get_extra_data(app_control, "viewtype", &viewtype);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "failed to get viewtype");
+               ui_app_exit();
+       }
+
+       dlog_print(DLOG_DEBUG, LOG_TAG, "viewtype is %s", viewtype);
+       if (!strcmp(viewtype, "ENCRYPT_DEVICE"))
+               ad->view_type = ENCRYPT_DEVICE;
+       else if (!strcmp(viewtype, "DECRYPT_DEVICE"))
+               ad->view_type = DECRYPT_DEVICE;
+       else if (!strcmp(viewtype, "ENCRYPT_SD_CARD"))
+               ad->view_type = ENCRYPT_SD_CARD;
+       else if (!strcmp(viewtype, "DECRYPT_SD_CARD"))
+               ad->view_type = DECRYPT_SD_CARD;
+
+       if (viewtype) {
+               free(viewtype);
+       }
+
+       elm_app_base_scale_set(1.8);
+
+       if (create_base_gui(ad) != 0) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "### create base gui fail ###");
+               return;
+       }
+}
+
+static void app_pause(void* data)
+{
+       /* Take necessary actions when application becomes invisible. */
+}
+
+static void app_resume(void* data)
+{
+       /* Take necessary actions when application becomes visible. */
+       dlog_print(DLOG_DEBUG, LOG_TAG, "### app_resume ###");
+}
+
+static void app_terminate(void* data)
+{
+       /* unregister vconf notify callback */
+       int ret;
+       appdata_s* ad = (appdata_s*)data;
+
+       switch (ad->view_type) {
+       case ENCRYPT_DEVICE:
+               ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, locktype_status_changed_cb);
+               if (ret != 0)
+                       dlog_print(DLOG_ERROR, LOG_TAG, "Failed to unregister lockscreen type callback");
+               /* unregister runtime info callback */
+               ret = runtime_info_unset_changed_cb(RUNTIME_INFO_KEY_CHARGER_CONNECTED);
+               if (ret != 0)
+                       dlog_print(DLOG_ERROR, LOG_TAG, "Failed to unregister runtime info callback");
+               /* unregister battery percent callback */
+               ret = device_remove_callback(DEVICE_CALLBACK_BATTERY_CAPACITY, battery_changed_cb);
+               if (ret != 0)
+                       dlog_print(DLOG_ERROR, LOG_TAG, "Failed to unregister battery capacity callback");
+               break;
+       case DECRYPT_DEVICE:
+               /* unregister runtime info callback */
+               ret = runtime_info_unset_changed_cb(RUNTIME_INFO_KEY_CHARGER_CONNECTED);
+               if (ret != 0)
+                       dlog_print(DLOG_ERROR, LOG_TAG, "Failed to unregister runtime info callback");
+               /* unregister battery percent callback */
+               ret = device_remove_callback(DEVICE_CALLBACK_BATTERY_CAPACITY, battery_changed_cb);
+               if (ret != 0)
+                       dlog_print(DLOG_ERROR, LOG_TAG, "Failed to unregister battery capacity callback");
+               break;
+       case ENCRYPT_SD_CARD:
+               ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, sdcard_status_changed_cb);
+               if (ret != 0)
+                       dlog_print(DLOG_ERROR, LOG_TAG, "Failed to unregister sdcard callback");
+               break;
+       }
+}
+
+static void ui_app_lang_changed(app_event_info_h event_info, void* user_data)
+{
+       /* APP_EVENT_LANGUAGE_CHANGED */
+       char* locale = NULL;
+
+       system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
+       elm_language_set(locale);
+       free(locale);
+
+       return;
+}
+
+static void ui_app_orient_changed(app_event_info_h event_info, void* user_data)
+{
+       /*APP_EVENT_DEVICE_ORIENTATION_CHANGED */
+       return;
+}
+
+static void ui_app_region_changed(app_event_info_h event_info, void* user_data)
+{
+       /*APP_EVENT_REGION_FORMAT_CHANGED */
+}
+
+static void ui_app_low_battery(app_event_info_h event_info, void* user_data)
+{
+       /*APP_EVENT_LOW_BATTERY */
+}
+
+static void ui_app_low_memory(app_event_info_h event_info, void* user_data)
+{
+       /*APP_EVENT_LOW_MEMORY */
+}
+
+int main(int argc, char* argv[])
+{
+       appdata_s ad = {0, };
+       int ret = 0;
+
+       ui_app_lifecycle_callback_s event_callback = { 0, };
+       app_event_handler_h handlers[5] = { NULL, };
+
+       event_callback.create = app_create;
+       event_callback.terminate = app_terminate;
+       event_callback.pause = app_pause;
+       event_callback.resume = app_resume;
+       event_callback.app_control = app_control;
+
+       ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
+       ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
+       ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
+       ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
+       ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
+       ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
+
+       ret = ui_app_main(argc, argv, &event_callback, &ad);
+       if (ret != APP_ERROR_NONE)
+               dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main is failed. err = %d", ret);
+       return ret;
+
+}