From e4640c5cee1cc448de2f7237822639c64115acda Mon Sep 17 00:00:00 2001 From: Woochanlee Date: Wed, 7 Jul 2021 19:06:24 +0900 Subject: [PATCH] bootstrap: Code and logic clean up when display off state there is no need to call device_power_wakeup(), if display already on Change-Id: Ic42d9625cf04b0a1ffec79652c4c8a5fb0d363e3 --- .../src/Commands/PreCommand.cc | 24 +++++++++++++--------- packaging/aurum.spec | 5 +++++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/org.tizen.aurum-bootstrap/src/Commands/PreCommand.cc b/org.tizen.aurum-bootstrap/src/Commands/PreCommand.cc index b291289..82d10d5 100644 --- a/org.tizen.aurum-bootstrap/src/Commands/PreCommand.cc +++ b/org.tizen.aurum-bootstrap/src/Commands/PreCommand.cc @@ -15,22 +15,26 @@ PreCommand::PreCommand(Command *cmd) : mCommand{cmd} {} ::grpc::Status PreCommand::execute() { - { - LOGI("PreCommand --------------- "); - display_state_e state; - if (device_display_get_state(&state) != DEVICE_ERROR_NONE) { - LOGI("getting display state has failed"); - } +#ifndef TIZEN_TV + display_state_e state; + if (device_display_get_state(&state) != DEVICE_ERROR_NONE) { + LOGE("getting display state has failed"); + return grpc::Status::CANCELLED; + } - bool isDisplayOn = DISPLAY_STATE_SCREEN_OFF != state; + bool isDisplayOn = DISPLAY_STATE_SCREEN_OFF != state; + if (!isDisplayOn) { + LOGI("Display off state try to wake up"); if (device_power_wakeup(false) != DEVICE_ERROR_NONE) { - LOGI("turning on display has failed"); + LOGE("turning on display has failed"); + return grpc::Status::CANCELLED; } - if (!isDisplayOn) - std::this_thread::sleep_for(std::chrono::milliseconds{INTV_TURNON_MARGIN}); + std::this_thread::sleep_for(std::chrono::milliseconds{INTV_TURNON_MARGIN}); } +#endif /* TIZEN_TV */ + mCommand->executePre(); return mCommand->execute(); } diff --git a/packaging/aurum.spec b/packaging/aurum.spec index 21e21fc..f002269 100644 --- a/packaging/aurum.spec +++ b/packaging/aurum.spec @@ -131,6 +131,11 @@ meson \ -e 's%^.*: warning: .*$%\x1b[30;43m&\x1b[m%' %build + +%if "%{tizen_profile_name}" == "tv" + CFLAGS+=" -DTIZEN_TV";export CFLAGS +%endif + ninja \ -C gbsbuild \ -j %(echo "`/usr/bin/getconf _NPROCESSORS_ONLN`") \ -- 2.7.4