_ActiveEventListener::OnActiveAppChanged(const Tizen::App::AppId& appId)
{
int ret = 0;
+ SysLog(NID_SYS, "Active App is %ls.", appId.GetPointer());
+
if(appId == _AppInfo::GetApplicationId())
{
_activeApp = true;
if(_InitPowerManager == false)
{
__powerEventList.Construct();
+ pActiveEventListener = new (std::nothrow) _ActiveEventListener();
+ _AppManagerImpl* pAppManager = _AppManagerImpl::GetInstance();
+ pAppManager->AddActiveAppEventListener(*pActiveEventListener);
_InitPowerManager = true;
}
}
{
if(_InitPowerManager == true)
{
+ _AppManagerImpl* pAppManager = _AppManagerImpl::GetInstance();
+ pAppManager->RemoveActiveAppEventListener(*pActiveEventListener);
+ delete(pActiveEventListener);
+ pActiveEventListener = null;
+
_InitPowerManager = false;
}
}
{
int ret = -1;
unsigned int state = LCD_DIM;
+ _PowerManagerImpl::Init();
if (keepOn == true && IsActive() == true)
{
_PowerManagerImpl::KeepCpuAwake(bool enable)
{
int ret = 0;
+ _PowerManagerImpl::Init();
+
if (enable)
{
ret = power_lock_state(POWER_STATE_SCREEN_OFF, 0);