Revert "add PauseLifeDurationTimer internal API for AppWidgetPopup"
authorJungmin, Park <jungmin76.park@samsung.com>
Mon, 22 Apr 2013 14:04:57 +0000 (23:04 +0900)
committerGerrit Code Review <gerrit2@kim11>
Mon, 22 Apr 2013 14:04:57 +0000 (23:04 +0900)
This reverts commit 89da94792c4a09df29d9b3b6e1d20772886d61b9

src/app/FApp_ServiceAppImpl.cpp
src/app/inc/FApp_ServiceAppImpl.h

index 6095ad0..48f19bf 100644 (file)
@@ -62,10 +62,9 @@ _ServiceAppImpl* _ServiceAppImpl::__pServiceAppImpl = null;
 _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.");
@@ -148,7 +147,7 @@ _ServiceAppImpl::OnService(service_s* service, bool initial)
                free(pOperation);
        }
 
-       if( __lifeDuration > 0 && __pauseLifeDurationTimer == false)
+       if( __lifeDuration > 0)
        {
                SetLifeDurationTimer(__lifeDuration);
        }
@@ -279,11 +278,6 @@ bool
 _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);
 }
 
@@ -306,12 +300,8 @@ _ServiceAppImpl::SetLifeDurationTimer(int lifeDuration)
                __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
@@ -319,32 +309,17 @@ _ServiceAppImpl::OnTimerExpired(Timer& timer)
 {
        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
index 6b04a91..ec817c2 100644 (file)
@@ -183,11 +183,7 @@ public:
        result Execute(void);
 
 
-       void SetAppTerminatingInternalEventListener(_IAppEventListener* pListener);
-
-       void PauseLifeDurationTimer(void);
-
-       void ResumeLifeDurationTimer(void);
+       void SetLifeDurationEventListener(_IAppEventListener* pListener);
 
 private:
        /**
@@ -233,14 +229,12 @@ private:
 
        ServiceApp* __pServiceApp;
 
-       _IAppEventListener* __pAppTerminatingInternalEventListener;
+       _IAppEventListener* __pLifeDurationEventListener;
 
        Tizen::Base::Runtime::Timer* __pLifeDurationTimer;
 
        int __lifeDuration;
 
-       bool __pauseLifeDurationTimer;
-
        friend class ServiceApp;
 
 }; // _ServiceAppImpl