_ServiceAppImpl::_ServiceAppImpl(ServiceApp* pServiceApp)
: __pAppImpl(_AppImpl::GetInstance())
, __pServiceApp(pServiceApp)
- , __pAppTerminatingInternalEventListener(null)
+ , __pLifeDurationEventListener(null)
, __pLifeDurationTimer(null)
, __lifeDuration(0)
- , __pauseLifeDurationTimer(false)
{
__pServiceAppImpl = this;
SysTryReturnVoidResult(NID_APP, __pAppImpl, E_INVALID_STATE, "[E_INVALID_STATE] Getting internal instance failed.");
free(pOperation);
}
- if( __lifeDuration > 0 && __pauseLifeDurationTimer == false)
+ if( __lifeDuration > 0)
{
SetLifeDurationTimer(__lifeDuration);
}
_ServiceAppImpl::OnServiceAppImplTerminating(bool forcedTermination)
{
SysTryReturn(NID_APP, __pServiceApp != null, false, E_INVALID_STATE, "[E_INVALID_STATE] Getting ServiceApp instance failed.");
-
- if( __pAppTerminatingInternalEventListener)
- {
- __pAppTerminatingInternalEventListener->OnApplicationTerminated(L"", 0);
- }
return __pServiceApp->OnAppTerminating(*(AppRegistry::GetInstance()), forcedTermination);
}
__pLifeDurationTimer->Cancel();
SysLog(NID_APP, "Life duration timer is cancelled.", lifeDuration );
}
-
- if( __pauseLifeDurationTimer == false)
- {
- __pLifeDurationTimer->Start(lifeDuration);
- SysLog(NID_APP, "Life duration timer is started with timeout.(%d)", lifeDuration );
- }
+ __pLifeDurationTimer->Start(__lifeDuration);
+ SysLog(NID_APP, "Life duration timer is started with timeout.(%d)", lifeDuration );
}
void
{
SysLog(NID_APP, "Life duration timer is expired, so terminating the application.");
timer.Cancel();
- App::GetInstance()->Terminate();
-}
-
-void
-_ServiceAppImpl::SetAppTerminatingInternalEventListener(_IAppEventListener* pListener)
-{
- __pAppTerminatingInternalEventListener = pListener;
-}
-
-void
-_ServiceAppImpl::PauseLifeDurationTimer(void)
-{
- __pauseLifeDurationTimer = true;
- if( __pLifeDurationTimer)
+ if( __pLifeDurationEventListener)
{
- __pLifeDurationTimer->Cancel();
- SysLog(NID_APP, "Life duration timer is paused." );
+ __pLifeDurationEventListener->OnApplicationTerminated(L"", 0);
}
+ App::GetInstance()->Terminate();
}
void
-_ServiceAppImpl::ResumeLifeDurationTimer(void)
+_ServiceAppImpl::SetLifeDurationEventListener(_IAppEventListener* pListener)
{
- __pauseLifeDurationTimer = false;
-// SetLifeDurationTimer(__lifeDuration);
- SysLog(NID_APP, "Life duration timer will be resumed." );
+ __pLifeDurationEventListener = pListener;
}
} } //Tizen::App