From: Krzysztof Jackiewicz Date: Fri, 5 Jul 2019 15:20:33 +0000 (+0200) Subject: Make ode-external-lock a user service X-Git-Tag: submit/tizen/20190816.084956^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4cce31470078cd8999121386fdcde1c048f304e5;p=platform%2Fcore%2Fsecurity%2Fode-ui.git Make ode-external-lock a user service The ode-external-lock service is made a user service so that it's launched when UI is ready. It is path activated. Use aul API (user session only) to detect the fact of homescreen being active. Change-Id: I8f67ad05abca341e491ae88ed00f488fc93fcc1b --- diff --git a/ode/CMakeLists.txt b/ode/CMakeLists.txt index 6dfec3e..ed30044 100755 --- a/ode/CMakeLists.txt +++ b/ode/CMakeLists.txt @@ -8,6 +8,7 @@ PKG_CHECK_MODULES(ode_pkgs REQUIRED capi-system-runtime-info capi-system-device capi-system-system-settings + aul ) INCLUDE_DIRECTORIES(${EFL_APP_INCLUDE_DIRS} ${ode_pkgs_INCLUDE_DIRS} ${ODE_LIB}) @@ -85,6 +86,6 @@ CONFIGURE_FILE(service/ode-progress-ui@.service.in service/ode-progress-ui@.serv INSTALL(FILES service/ode-progress-ui@.service DESTINATION ${SYSTEMD_UNIT_DIR}) CONFIGURE_FILE(service/ode-external-lock.service.in service/ode-external-lock.service) -INSTALL(FILES service/ode-external-lock.service DESTINATION ${SYSTEMD_UNIT_DIR}) +INSTALL(FILES service/ode-external-lock.service service/ode-external-lock.path DESTINATION ${SYSTEMD_UNIT_DIR_USER}) ADD_SUBDIRECTORY(po) diff --git a/ode/service/ode-external-lock.path b/ode/service/ode-external-lock.path new file mode 100644 index 0000000..8d40285 --- /dev/null +++ b/ode/service/ode-external-lock.path @@ -0,0 +1,6 @@ +[Unit] +Description=Path activator used to launch encrypted sdcard UI + +[Path] +PathModified=/run/ode-booting-with-encrypted-sdcard +PathExists=/run/ode-booting-with-encrypted-sdcard diff --git a/ode/service/ode-external-lock.service.in b/ode/service/ode-external-lock.service.in index b05bcb4..7649cfb 100644 --- a/ode/service/ode-external-lock.service.in +++ b/ode/service/ode-external-lock.service.in @@ -1,10 +1,8 @@ [Unit] Description=ODE external storage lock interface +DefaultDependencies=no [Service] -User=application -Group=application -SmackProcessLabel=System EnvironmentFile=/run/tizen-system-env EnvironmentFile=/run/xdg-root-env ExecStart=/usr/bin/ode lock diff --git a/ode/src/ode.cpp b/ode/src/ode.cpp index d99048e..dd37d4f 100644 --- a/ode/src/ode.cpp +++ b/ode/src/ode.cpp @@ -17,6 +17,10 @@ */ #include "ode.h" +#include + +#include + ODELaunchPad::ODELaunchPad() : Application("org.tizen.ode"), viewtype(""), mode(0), interface(nullptr) { @@ -131,6 +135,20 @@ void ODEStandAlone::createProgressInterface(const std::string &type, const std:: void ODEStandAlone::createPasswordInterface() { + char *homescreenApp = ::vconf_get_str(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME); + if (homescreenApp) + { + int status; + for(;;) { + status = ::aul_app_get_status(homescreenApp); + if (status == STATUS_VISIBLE || status == STATUS_FOCUS) + break; + sleep(1); + } + + free(homescreenApp); + } + interface.reset(new PasswordSDCard{}); if (interface) diff --git a/packaging/ode-ui.spec b/packaging/ode-ui.spec index e7fd1a6..0f2a0ef 100755 --- a/packaging/ode-ui.spec +++ b/packaging/ode-ui.spec @@ -36,6 +36,7 @@ The ode-ui package provides reference applications which are responsible for enc -DCMAKE_BUILD_TYPE=%{build_type} \ -DBIN_DIR=%{TZ_SYS_BIN} \ -DSYSTEMD_UNIT_DIR=%{_unitdir} \ + -DSYSTEMD_UNIT_DIR_USER=%{_unitdir_user} \ -DAPP_INSTALL_PREFIX="%{TZ_SYS_RO_APP}" \ -DAPP_SHARE_PACKAGES_DIR="%{TZ_SYS_RO_PACKAGES}" @@ -46,6 +47,10 @@ make %{?jobs:-j%jobs} %find_lang secure-erase %find_lang ode + +mkdir -p %{buildroot}/%{_unitdir_user}/default.target.wants +ln -s ../ode-external-lock.path %{buildroot}/%{_unitdir_user}/default.target.wants/ode-external-lock.path + %clean rm -rf %{buildroot} @@ -86,7 +91,9 @@ ln -sf %{odeapp_home}/bin/org.tizen.ode /usr/bin/ode %{odeapp_home}/res/* %{TZ_SYS_RO_PACKAGES}/org.tizen.ode.xml %{_unitdir}/ode-progress-ui@.service -%{_unitdir}/ode-external-lock.service +%{_unitdir_user}/ode-external-lock.service +%{_unitdir_user}/ode-external-lock.path +%{_unitdir_user}/default.target.wants/ode-external-lock.path ## Secure Erase Application Package ################################ %package -n org.tizen.secure-erase