iaupdate/IAD/backgroundchecker/src/iaupdatebgmain.cpp
branchRCL_3
changeset 66 8b7f4e561641
parent 65 7333d7932ef7
--- a/iaupdate/IAD/backgroundchecker/src/iaupdatebgmain.cpp	Tue Aug 31 15:21:33 2010 +0300
+++ b/iaupdate/IAD/backgroundchecker/src/iaupdatebgmain.cpp	Wed Sep 01 12:22:02 2010 +0100
@@ -26,6 +26,7 @@
 // LOCAL FUNCTION PROTOTYPES
 LOCAL_C TInt ThreadStartL();
 LOCAL_C TBool IAUpdateEnabledL();
+LOCAL_C void RemoveExistingSoftNotificationL();
 
 //Const
 _LIT( KBackgroundChecker, "iaupdatebgchecker" );
@@ -69,6 +70,7 @@
     if ( !IAUpdateEnabledL() )
         {
         FLOG("[bgchecker] ThreadStartL() IAUpdate not enabled");
+        RemoveExistingSoftNotificationL();
         return KErrNone;  
         }
     TFullName name;
@@ -108,7 +110,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// IAUpdateEnabledL() 
+// IAUpdateEnabledL()
 // ---------------------------------------------------------------------------
 //
 LOCAL_C TBool IAUpdateEnabledL() 
@@ -136,5 +138,24 @@
     return enabled;        
     }
 
+// ---------------------------------------------------------------------------
+// RemoveExistingSoftNotificationL()
+// ---------------------------------------------------------------------------
+//
+LOCAL_C void RemoveExistingSoftNotificationL() 
+    {
+    FLOG("[bgchecker] RemoveExistingSoftNotificationL() begin");
+    
+    CIAUpdateBGInternalFileHandler* internalFile = CIAUpdateBGInternalFileHandler::NewLC();
+    CIAUpdateBGSoftNotification* softNotification = CIAUpdateBGSoftNotification::NewL( NULL, internalFile );
+    CleanupStack::PushL( softNotification );
+    softNotification->RemoveSoftNotificationL( softNotification->Id() );
+    CleanupStack::PopAndDestroy( softNotification );
+    CleanupStack::PopAndDestroy( internalFile );
+    
+    FLOG("[bgchecker] RemoveExistingSoftNotificationL() end");
+    return;        
+    }
+
 //EOF