From c3ab27307162388b336a2fa7344713916284c228 Mon Sep 17 00:00:00 2001 From: "jungmin76.park" Date: Thu, 16 May 2013 17:19:39 +0900 Subject: [PATCH] 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 --- src/app/FApp_ServiceAppImpl.cpp | 25 ++++++++++++++++--------- src/app/inc/FApp_ServiceAppImpl.h | 2 ++ 2 files changed, 18 insertions(+), 9 deletions(-) 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. -- 2.7.4