#endif
bool _activeApp = false;
+unsigned int _dimmingFlag = GOTO_STATE_NOW;
+unsigned int _screenOnState = LCD_DIM;
bool _deviceCpuPowerOn = false;
bool _keepCpuAwake = false;
bool _keepScreenOnState = false;
_ActiveEventListener::OnActiveAppChanged(const Tizen::App::AppId& appId)
{
int ret = 0;
- SysLog(NID_SYS, "Active App is %ls.", appId.GetPointer());
+ SysLog(NID_SYS, "Active App is %ls. GetApp id %ls", appId.GetPointer(), _AppInfo::GetApplicationId().GetPointer());
if(appId == _AppInfo::GetApplicationId())
{
_activeApp = true;
+ if (_keepScreenOnState == true)
+ {
+ int ret = -1;
+ ret = pm_lock_state(_screenOnState, _dimmingFlag, 0);
+ SysTryReturnVoidResult(NID_SYS, ret == 0,E_SYSTEM, "[E_SYSTEM] It failed to lock the screen state. error code [%d]", ret);
+ SysLog(NID_SYS, "Screen on state is recoveryed.");
+ }
}
else
{
{
ret = pm_unlock_state(LCD_NORMAL, GOTO_STATE_NOW);
SysTryReturnVoidResult(NID_SYS, ret == 0, E_SYSTEM, "[E_SYSTEM] It failed to unlock the power state");
- _keepScreenOnState = false;
}
if (_keepCpuAwake == true || _deviceCpuPowerOn == true) //In case of CPU power control, it has to be keep despite of deactive state.
{
state = LCD_NORMAL;
}
+ _dimmingFlag = flag;
+ _screenOnState = state;
ret = pm_lock_state(state, flag, 0);
SysTryReturnResult(NID_SYS, ret == 0, E_SYSTEM, "[E_SYSTEM] It failed to lock the screen state");
_keepScreenOnState = true;