if get_option('tizen') == true
bootstrap_svr_dep += [
dependency('capi-appfw-app-control'),
+ dependency('capi-system-device'),
dependency('capi-appfw-app-manager'),
dependency('capi-appfw-package-manager'),
dependency('capi-appfw-service-application'),
#include <atspi/atspi.h>
#include <loguru.hpp>
+#include <thread>
+#include <chrono>
+
+#include <Ecore.h>
+#include <device/power.h>
+#include <device/display.h>
+#include <device/callback.h>
+
PreCommand::PreCommand() : PreCommand(nullptr) {}
PreCommand::PreCommand(Command *cmd) : mCommand{cmd} {}
{
{
LOG_SCOPE_F(INFO, "PreCommand --------------- ");
+
+ bool isDisplayOn = (bool)ecore_main_loop_thread_safe_call_sync([](void *data)->void*{
+ display_state_e state;
+ if(device_display_get_state(&state) == DEVICE_ERROR_NONE) {
+ return (void*)(state);
+ }
+ return NULL;
+ }, NULL) != (display_state_e)DISPLAY_STATE_SCREEN_OFF;
+
+ if (!isDisplayOn)
+ {
+ LOG_F(INFO, "display state : SCREEN_OFF, turn display on");
+ ecore_main_loop_thread_safe_call_sync([](void *data)->void*{
+ if (device_power_wakeup(false) != DEVICE_ERROR_NONE) {
+ LOG_F(INFO, "turning display up has failed");
+ return NULL;
+ }
+ if (device_power_request_lock(POWER_LOCK_DISPLAY, 10*1000) != DEVICE_ERROR_NONE) {
+ LOG_F(INFO, "request lock device has failed");
+ return NULL;
+ }
+ return NULL;
+ }, NULL); //FIXME : extract ecore dep from here
+
+ // sleep for display on effect
+ std::this_thread::sleep_for(std::chrono::milliseconds{5*1000});
+ } else {
+ LOG_F(INFO, "display state : SCREEN_ON, lock display on");
+ ecore_main_loop_thread_safe_call_sync([](void *data)->void*{
+ if (device_power_request_lock(POWER_LOCK_DISPLAY, 10*1000) != DEVICE_ERROR_NONE) {
+ LOG_F(INFO, "request lock device has failed");
+ return NULL;
+ }
+ return NULL;
+ }, NULL); //FIXME : extract ecore dep from here
+ }
+
AtspiAccessible *n = atspi_get_desktop(0);
if (n) {
char *name = atspi_accessible_get_name(n, NULL);
::grpc::Status PreCommand::executePost()
{
return mCommand->executePost();
-}
\ No newline at end of file
+}
BuildRequires: pkgconfig(capi-appfw-app-control)
BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(capi-appfw-service-application)
+BuildRequires: pkgconfig(capi-system-device)
BuildRequires: pkgconfig(libtzplatform-config)
%if "%{?profile}" == "tv"