Revert "Removing dependency of ode package." 65/296965/1
authorShivam Varshney <shivam.v2@samsung.com>
Tue, 8 Aug 2023 05:33:23 +0000 (05:33 +0000)
committerShivam Varshney <shivam.v2@samsung.com>
Tue, 8 Aug 2023 05:33:23 +0000 (05:33 +0000)
This reverts commit 7512ebfc9575468de53f4c2b8f6f3ef2561ed2c7.

Reason for revert: Update required on previous commit

Change-Id: I673eea80ff516cc9214b47b50b1e5d7dbc31eed2

CMakeLists.txt
include/mobile/starter.h
packaging/starter.spec
src/mobile/lock_mgr.c
src/mobile/starter.c

index 48deb9a..8323923 100644 (file)
@@ -88,6 +88,7 @@ pkg_check_modules(pkgs REQUIRED
        capi-message-port
        efl-extension
        libsystemd
+       ode
 )
 
 ELSEIF("${TIZEN_PROFILE_NAME}" STREQUAL "WEARABLE")
index 2c04cbc..b973b9d 100644 (file)
@@ -24,10 +24,10 @@ struct appdata {
        int lcd_status;
 };
 
-// enum ODE_PROCESS {
-       // BEFORE_LOCKSCREEN = 0,
-       // AFTER_LOCKSCREEN,
-// };
+enum ODE_PROCESS {
+       BEFORE_LOCKSCREEN = 0,
+       AFTER_LOCKSCREEN,
+};
 
 int starter_execute_ode_process(int booting_state);
 
index bd987ae..306f38f 100644 (file)
@@ -26,6 +26,7 @@ BuildRequires:  pkgconfig(capi-telephony)
 BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(efl-extension)
 BuildRequires:  pkgconfig(libsystemd)
+BuildRequires:  pkgconfig(ode)
 
 BuildRequires:  pkgconfig(rua)
 BuildRequires:  pkgconfig(feedback)
index b7385c6..cc82b3e 100644 (file)
@@ -31,7 +31,7 @@
 #include <system_settings.h>
 #include <system_info.h>
 #include <telephony.h>
-//#include <ode/internal-encryption.h>
+#include <ode/internal-encryption.h>
 
 #include "lock_mgr.h"
 #include "package_mgr.h"
@@ -247,23 +247,23 @@ static void _other_lockscreen_unlock(void)
 void lock_mgr_unlock(void)
 {
        int ret = 0;
-       //int booting_completed = 0;
+       int booting_completed = 0;
        int lock_type = status_active_get()->setappl_screen_lock_type_int;
        _D("lock type(%d)", lock_type);
 
-       // ret = vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &booting_completed);
-       // if (ret != 0) {
-               // _E("Failed to get VCONFKEY STARTER SEQUENCE");
-               // return;
-       // }
-
-       // if (!booting_completed) {
-               // ret = starter_execute_ode_process(AFTER_LOCKSCREEN);
-               // if (!ret) {
-                       // _E("Failed to execute ode process");
-                       // return;
-               // }
-       // }
+       ret = vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &booting_completed);
+       if (ret != 0) {
+               _E("Failed to get VCONFKEY STARTER SEQUENCE");
+               return;
+       }
+
+       if (!booting_completed) {
+               ret = starter_execute_ode_process(AFTER_LOCKSCREEN);
+               if (!ret) {
+                       _E("Failed to execute ode process");
+                       return;
+               }
+       }
 
        lock_mgr_idle_lock_state_set(VCONFKEY_IDLE_UNLOCK);
        lock_mgr_sound_play(LOCK_SOUND_UNLOCK);
index 2ff0ea8..8b166f8 100755 (executable)
@@ -27,7 +27,7 @@
 
 #include <E_DBus.h>
 #include <systemd/sd-daemon.h>
-//#include <ode/internal-encryption.h>
+#include <ode/internal-encryption.h>
 
 #include <aul.h>
 #include <vconf.h>
@@ -242,10 +242,10 @@ static void _init(void)
         */
        _set_starter_sequence(0);
 
-       // ret = starter_execute_ode_process(BEFORE_LOCKSCREEN);
-       // if (!ret) {
-               // _E("Failed to execute ode process");
-       // }
+       ret = starter_execute_ode_process(BEFORE_LOCKSCREEN);
+       if (!ret) {
+               _E("Failed to execute ode process");
+       }
 
        aul_listen_app_dead_signal(_check_dead_signal, NULL);
 }
@@ -328,47 +328,47 @@ static void _mount_complete_cb(void *user_data)
 
 
 
-// int starter_execute_ode_process(int booting_state)
-// {
-       // _D("This call is before or after Lockscreen: %d", booting_state);
-       // int ret = ODE_ERROR_NONE;
-       // int ode_state = 0;
-
-       // ret = ode_internal_encryption_get_state(&ode_state);
-       // if (ret != ODE_ERROR_NONE) {
-               // _E("Failed to get ODE state, ret: %d", ret);
-               // return 0;
-       // }
-
-       // if (booting_state == BEFORE_LOCKSCREEN) {
-               // if (ode_state == ODE_STATE_ENCRYPTED) {
-                       // lock_mgr_init();
-
-                       // ret = ode_internal_encryption_set_mount_event_cb(_mount_complete_cb, NULL);
-                       // if (ret != ODE_ERROR_NONE) {
-                               // _E("Failed to set mount event cb");
-                       // }
-               // } else {
-                       // _launch_apps();
-               // }
-       // } else if (booting_state == AFTER_LOCKSCREEN) {
-               // if (ode_state == ODE_STATE_ENCRYPTED) {
-                       // _D("ODE state is: %d, and we should mount at this time", ode_state);
-
-                       // ret = ode_internal_encryption_mount();
-                       // if (ret != ODE_ERROR_NONE) {
-                               // _E("Failed to mount");
-                               // return 0;
-                       // }
-
-                       // sd_notify(0, "READY=1");
-                       // home_mgr_init(NULL);
-
-                       // vconf_set_int(VCONFKEY_STARTER_SEQUENCE, 1);
-               // } else {
-                       // _D("ODE state is: %d, Do nothing", ode_state);
-               // }
-       // }
-
-       // return 1;
-// }
+int starter_execute_ode_process(int booting_state)
+{
+       _D("This call is before or after Lockscreen: %d", booting_state);
+       int ret = ODE_ERROR_NONE;
+       int ode_state = 0;
+
+       ret = ode_internal_encryption_get_state(&ode_state);
+       if (ret != ODE_ERROR_NONE) {
+               _E("Failed to get ODE state, ret: %d", ret);
+               return 0;
+       }
+
+       if (booting_state == BEFORE_LOCKSCREEN) {
+               if (ode_state == ODE_STATE_ENCRYPTED) {
+                       lock_mgr_init();
+
+                       ret = ode_internal_encryption_set_mount_event_cb(_mount_complete_cb, NULL);
+                       if (ret != ODE_ERROR_NONE) {
+                               _E("Failed to set mount event cb");
+                       }
+               } else {
+                       _launch_apps();
+               }
+       } else if (booting_state == AFTER_LOCKSCREEN) {
+               if (ode_state == ODE_STATE_ENCRYPTED) {
+                       _D("ODE state is: %d, and we should mount at this time", ode_state);
+
+                       ret = ode_internal_encryption_mount();
+                       if (ret != ODE_ERROR_NONE) {
+                               _E("Failed to mount");
+                               return 0;
+                       }
+
+                       sd_notify(0, "READY=1");
+                       home_mgr_init(NULL);
+
+                       vconf_set_int(VCONFKEY_STARTER_SEQUENCE, 1);
+               } else {
+                       _D("ODE state is: %d, Do nothing", ode_state);
+               }
+       }
+
+       return 1;
+}