iaupdate/IAD/backgroundchecker/src/iaupdatebgmain.cpp
branchRCL_3
changeset 25 7333d7932ef7
parent 5 aba6b8104af3
child 26 8b7f4e561641
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
    24 #include "iaupdatebgsoftnotification.h"
    24 #include "iaupdatebgsoftnotification.h"
    25 #include "iaupdatebglogger.h"
    25 #include "iaupdatebglogger.h"
    26 // LOCAL FUNCTION PROTOTYPES
    26 // LOCAL FUNCTION PROTOTYPES
    27 LOCAL_C TInt ThreadStartL();
    27 LOCAL_C TInt ThreadStartL();
    28 LOCAL_C TBool IAUpdateEnabledL();
    28 LOCAL_C TBool IAUpdateEnabledL();
    29 LOCAL_C void RemoveExistingSoftNotificationL();
       
    30 
    29 
    31 //Const
    30 //Const
    32 _LIT( KBackgroundChecker, "iaupdatebgchecker" );
    31 _LIT( KBackgroundChecker, "iaupdatebgchecker" );
    33 
    32 
    34 // ---------------------------------------------------------------------------
    33 // ---------------------------------------------------------------------------
    68 LOCAL_C TInt ThreadStartL()
    67 LOCAL_C TInt ThreadStartL()
    69     {
    68     {
    70     if ( !IAUpdateEnabledL() )
    69     if ( !IAUpdateEnabledL() )
    71         {
    70         {
    72         FLOG("[bgchecker] ThreadStartL() IAUpdate not enabled");
    71         FLOG("[bgchecker] ThreadStartL() IAUpdate not enabled");
    73         RemoveExistingSoftNotificationL();
       
    74         return KErrNone;  
    72         return KErrNone;  
    75         }
    73         }
    76     TFullName name;
    74     TFullName name;
    77     TFindProcess  iaupdatebgFinder(_L("*iaupdatebgchecker*"));
    75     TFindProcess  iaupdatebgFinder(_L("*iaupdatebgchecker*"));
    78 
    76 
   108     
   106     
   109     return KErrNone;
   107     return KErrNone;
   110     }
   108     }
   111 
   109 
   112 // ---------------------------------------------------------------------------
   110 // ---------------------------------------------------------------------------
   113 // IAUpdateEnabledL()
   111 // IAUpdateEnabledL() 
   114 // ---------------------------------------------------------------------------
   112 // ---------------------------------------------------------------------------
   115 //
   113 //
   116 LOCAL_C TBool IAUpdateEnabledL() 
   114 LOCAL_C TBool IAUpdateEnabledL() 
   117     {
   115     {
   118     FLOG("[bgchecker] IAUpdateEnabledL() begin");
   116     FLOG("[bgchecker] IAUpdateEnabledL() begin");
   136     featureControl.Close(); 
   134     featureControl.Close(); 
   137     FLOG_NUM("[bgchecker] IAUpdateEnabledL() enabled: %d", enabled );
   135     FLOG_NUM("[bgchecker] IAUpdateEnabledL() enabled: %d", enabled );
   138     return enabled;        
   136     return enabled;        
   139     }
   137     }
   140 
   138 
   141 // ---------------------------------------------------------------------------
       
   142 // RemoveExistingSoftNotificationL()
       
   143 // ---------------------------------------------------------------------------
       
   144 //
       
   145 LOCAL_C void RemoveExistingSoftNotificationL() 
       
   146     {
       
   147     FLOG("[bgchecker] RemoveExistingSoftNotificationL() begin");
       
   148     
       
   149     CIAUpdateBGInternalFileHandler* internalFile = CIAUpdateBGInternalFileHandler::NewLC();
       
   150     CIAUpdateBGSoftNotification* softNotification = CIAUpdateBGSoftNotification::NewL( NULL, internalFile );
       
   151     CleanupStack::PushL( softNotification );
       
   152     softNotification->RemoveSoftNotificationL( softNotification->Id() );
       
   153     CleanupStack::PopAndDestroy( softNotification );
       
   154     CleanupStack::PopAndDestroy( internalFile );
       
   155     
       
   156     FLOG("[bgchecker] RemoveExistingSoftNotificationL() end");
       
   157     return;        
       
   158     }
       
   159 
       
   160 //EOF  
   139 //EOF  
   161 
   140