imagehandlingutilities/thumbnailmanager/tmcommon/src/tmactivitymanager.cpp
branchRCL_3
changeset 16 85a88bc05e45
parent 11 dea39715fc05
child 24 f0aa341a25bf
--- a/imagehandlingutilities/thumbnailmanager/tmcommon/src/tmactivitymanager.cpp	Wed Apr 14 16:16:51 2010 +0300
+++ b/imagehandlingutilities/thumbnailmanager/tmcommon/src/tmactivitymanager.cpp	Tue Apr 27 16:57:55 2010 +0300
@@ -66,6 +66,7 @@
     {
     TN_DEBUG1( "CTMActivityManager::ConstructL()");
     iTimer.CreateLocal();
+    iWatch = ENone;
     }
 
 // ---------------------------------------------------------------------------
@@ -112,8 +113,6 @@
     {
     TN_DEBUG1( "CTMActivityManager::Start()");
     
-    iFirstRound = ETrue;
-    
 #ifdef MONITOR_LIGHTS
     if(!iLight)
         {
@@ -121,11 +120,16 @@
         }
 #endif
     
-    if( !IsActive() )
+    if ( iWatch == ENone )
         {
-        SetActive();
-        TRequestStatus* statusPtr = &iStatus;
-        User::RequestComplete( statusPtr, KErrNone );
+        iFirstRound = ETrue;
+        
+        if( !IsActive() )
+            {
+            SetActive();
+            TRequestStatus* statusPtr = &iStatus;
+            User::RequestComplete( statusPtr, KErrNone );
+            }
         }
     }
 
@@ -161,12 +165,12 @@
                 TN_DEBUG1( "CTMActivityManager::RunL() inactive");
                 NotifyObserver();
 
-            if (!IsActive()) //observer might have called a Reset()
-                {
-                iTimer.Inactivity(iStatus,0);
-                iWatch = EWaitingForActivity;
+                if (!IsActive()) //observer might have called a Reset()
+                    {
+                    iTimer.Inactivity(iStatus,0);
+                    iWatch = EWaitingForActivity;
+                    }
                 }
-            }
             else
                 {
                 iTimer.Inactivity(iStatus,iTimeout);
@@ -174,8 +178,8 @@
             }
         else if (iWatch == EWaitingForActivity)
             {
-                TN_DEBUG1( "CTMActivityManager::RunL() active");
-                NotifyObserver();
+            TN_DEBUG1( "CTMActivityManager::RunL() active");
+            NotifyObserver();
              
             if (!IsActive()) //observer might have called a Reset()
                 {