filemanager/schbkup/src/filemanagerschbackuptask.cpp
branchRCL_3
changeset 14 efe289f793e7
parent 0 6a9f87576119
--- a/filemanager/schbkup/src/filemanagerschbackuptask.cpp	Tue May 11 16:01:48 2010 +0300
+++ b/filemanager/schbkup/src/filemanagerschbackuptask.cpp	Tue May 25 12:28:34 2010 +0300
@@ -126,6 +126,7 @@
 
     delete iSubscriber;
     delete iCenRep;
+    delete iSystemStateMonitor;
     Cancel();
     }
 
@@ -198,6 +199,9 @@
         parse.Assign( data );
         User::LeaveIfError( parse.Val( iDay ) );
         }
+    
+    // Get pointer to system state monitor
+    iSystemStateMonitor = CFmSystemStateMonitor::NewL( *this );
 
     Retry();
     }
@@ -246,6 +250,15 @@
 //
 TBool CFileManagerSchBackupTask::CheckPhoneStateL()
     {
+    
+    // Check phone is normal state or not
+    if ( !iSystemStateMonitor->IsSystemStateNormal() )
+       {
+        INFO_LOG( "CFileManagerSchBackupTask::CheckPhoneStateL()-System State is not normal" )
+        iSystemStateMonitor->StartMonitor( ESsmNormal );
+        return EFalse;
+       }
+    
     // Check call state
     TInt callState( 0 );
     RProperty::Get(
@@ -471,4 +484,16 @@
         }
     }
 
+// ---------------------------------------------------------------------------
+// CFileManagerSchBackupTask::SystemStateChangedEvent
+// ---------------------------------------------------------------------------
+//
+void CFileManagerSchBackupTask::SystemStateChangedEvent()
+    {
+    FUNC_LOG
+    
+    // Backup was not started, try starting it again
+    Retry();
+    }
+
 // End of file