From: jungmin76.park Date: Thu, 16 May 2013 08:19:39 +0000 (+0900) Subject: enable LifeDuration for ServiceApp other than AppWidget provider app(1800000 will... X-Git-Tag: accepted/tizen/20130520.101503~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3ab27307162388b336a2fa7344713916284c228;p=platform%2Fframework%2Fnative%2Fappfw.git enable LifeDuration for ServiceApp other than AppWidget provider app(1800000 will be ignored for workaround). add _ServiceAppImpl::ResetLifeDurationTimer() Change-Id: I380e5f0b27040b1e3e9763999da38bca9acf07e3 Signed-off-by: jungmin76.park --- diff --git a/src/app/FApp_ServiceAppImpl.cpp b/src/app/FApp_ServiceAppImpl.cpp index eddb2c0..899503e 100644 --- a/src/app/FApp_ServiceAppImpl.cpp +++ b/src/app/FApp_ServiceAppImpl.cpp @@ -254,8 +254,7 @@ _ServiceAppImpl::OnAppInitializing(void) r = Integer::Parse(val, __lifeDuration); if( r == E_SUCCESS ) { - __lifeDuration = ( __lifeDuration > LIFE_DURATION_MSEC_MAX ) ? LIFE_DURATION_MSEC_MAX : __lifeDuration; - SysLog(NID_APP, "LifeDuration is (%d)", __lifeDuration); + SysLog(NID_APP, "LifeDuration is (%d) millis.", __lifeDuration); } } @@ -303,26 +302,29 @@ _ServiceAppImpl::SetLifeDurationTimer(int lifeDuration) else { __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 ); + int timeout = ( __lifeDuration > LIFE_DURATION_MSEC_MAX ) ? LIFE_DURATION_MSEC_MAX : __lifeDuration; + __pLifeDurationTimer->Start(timeout); + SysLog(NID_APP, "Life duration timer is started (%d millis)", timeout ); } } void _ServiceAppImpl::OnTimerExpired(Timer& timer) { - SysLog(NID_APP, "Life duration timer is expired, so terminating the application."); timer.Cancel(); - - if( __pAppTerminatingInternalEventListener) //Fixme: Remove this workaround code after all LifeDuration value of pre-loaded apps are fixed. + if( __pAppTerminatingInternalEventListener || __lifeDuration != 1800000 ) //Fixme: Remove this workaround code after all LifeDuration value of pre-loaded apps are fixed. { + SysLog(NID_APP, "Life duration timer is expired, so terminating the application."); App::GetInstance()->Terminate(); } + else + { + SysLog(NID_APP, "Life duration timer is ignored."); + } } void @@ -346,8 +348,13 @@ void _ServiceAppImpl::ResumeLifeDurationTimer(void) { __pauseLifeDurationTimer = false; -// SetLifeDurationTimer(__lifeDuration); SysLog(NID_APP, "Life duration timer will be resumed." ); } +void +_ServiceAppImpl::ResetLifeDurationTimer(void) +{ + SetLifeDurationTimer(__lifeDuration); +} + } } //Tizen::App diff --git a/src/app/inc/FApp_ServiceAppImpl.h b/src/app/inc/FApp_ServiceAppImpl.h index 53f6eee..0b55195 100644 --- a/src/app/inc/FApp_ServiceAppImpl.h +++ b/src/app/inc/FApp_ServiceAppImpl.h @@ -188,6 +188,8 @@ public: void ResumeLifeDurationTimer(void); + void ResetLifeDurationTimer(void); + private: /** * This is the default constructor for this class.