fotaapplication/fotaserver/FotaServer/inc/FotaServer.h
branchRCL_3
changeset 26 19bba8228ff0
child 27 5cc2995847ea
equal deleted inserted replaced
25:b183ec05bd8c 26:19bba8228ff0
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Header file for CFotaServer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __FOTASERVER_H__
       
    21 #define __FOTASERVER_H__
       
    22 
       
    23 // INCLUDES
       
    24 #include <AknDoc.h>
       
    25 #include <aknapp.h>
       
    26 #include <AknServerApp.h>
       
    27 #include <coemain.h>
       
    28 #include <s32file.h>
       
    29 #include <DocumentHandler.h>
       
    30 #include <apmstd.h>
       
    31 #include <e32property.h>
       
    32 #include <SyncMLClient.h>
       
    33 #include <SyncMLClientDM.h>
       
    34 #include <hwrmpowerstatesdkpskeys.h>
       
    35 #include <SyncMLNotifier.h>
       
    36 #include <SyncMLNotifierParams.h>
       
    37 #include <SyncMLObservers.h>
       
    38 #include <fotastorage.h>
       
    39 #include <starterclient.h>
       
    40 
       
    41 #include "fotaserverPrivateCRKeys.h"
       
    42 
       
    43 #include "FotaIPCTypes.h"
       
    44 #include "FotaDB.h"
       
    45 #include "fotaConst.h"
       
    46 #include "fotadownload.h"
       
    47 #include "fotaupdate.h" 
       
    48 #include "fmsclient.h"	//The FMS Client header file
       
    49 
       
    50 
       
    51 //Forward declarations
       
    52 class CDevEncController;
       
    53 
       
    54 enum TOmaDmLrgObjDl
       
    55 {
       
    56     EOmaDmLrgObjDlFail = 1,
       
    57     EOmaDmLrgObjDlExec
       
    58 };
       
    59 _LIT (KSWversionFile, "swv.txt");
       
    60 /** Timeout to let cfotadownloader callstack to empty*/
       
    61 const TInt KDownloadFinalizerWaitTime(1000000);
       
    62 
       
    63 /** Time interval between syncml session retry attempts*/
       
    64 const TInt KSyncmlSessionRetryInterval(60000000);
       
    65 
       
    66 /** shutdown timer */
       
    67 const TTimeIntervalMicroSeconds32 KFotaTimeShutDown(10000000);
       
    68 
       
    69 /** How many times generic alert sending should be tried in row. */
       
    70 const TInt KSyncmlAttemptCount = 3;
       
    71 
       
    72 /** This P&S Key is used to notify DM UI on any download event. key=0 for idle and key=1 for download */ 
       
    73 const TUint32 KFotaDownloadState = 0x00000001;
       
    74 
       
    75 /** If download is active this P&S key is set to ETrue, otherwise EFalse. 
       
    76  * The key is owned by omadmappui**/
       
    77 const TUint32 KFotaDownloadActive = 0x00000008;
       
    78 
       
    79 /** The P&S key to say DM UI to perform refresh of UI elements */
       
    80 const TUint32 KFotaDMRefresh = 0x00000009;
       
    81 
       
    82 enum {
       
    83 	ENo=0,
       
    84 	EYes
       
    85 };
       
    86 
       
    87 //Constants used when update happen NSC/DM 
       
    88 enum {
       
    89 		EFotaUpdateNSC=1,
       
    90 		EFotaUpdateNSCBg,
       
    91 		EFotaUpdateDM
       
    92 };
       
    93 
       
    94 _LIT_SECURITY_POLICY_C1( KReadPolicy, ECapabilityReadDeviceData );
       
    95 _LIT_SECURITY_POLICY_C1( KWritePolicy, ECapabilityWriteDeviceData );
       
    96 _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
       
    97 
       
    98 //Constants for Device Encryption operation
       
    99 enum TDEOperations
       
   100     {
       
   101     EIdle = 0,
       
   102     EEncryption,
       
   103     EDecryption,
       
   104     EDecryptionPending
       
   105     };
       
   106 // FORWARD CLASS DECLARATION
       
   107 
       
   108 class CFotaServer;
       
   109 class CFotaDownload;
       
   110 class CFotaUpdate;
       
   111 class CFotaSrvApp;
       
   112 class CFotaNetworkRegStatus;
       
   113 /**
       
   114 * Fota server. Handles client requests. Starts download and/or update.
       
   115  *
       
   116  *  This class is 
       
   117  *
       
   118  *  @lib    fotaserver
       
   119  *  @since  S60 v3.1
       
   120  */
       
   121 NONSHARABLE_CLASS( CFotaServer ) : public CAknAppServer, MSyncMLEventObserver
       
   122 	{
       
   123     friend class  CFotaSrvSession;
       
   124     friend class  CFotaDownload;
       
   125     friend class  CFotaUpdate;
       
   126 
       
   127 public:
       
   128 
       
   129     /**
       
   130     * C++ default constructor.
       
   131     */
       
   132 	CFotaServer();
       
   133     
       
   134     /**
       
   135     * Destructor.
       
   136     */		
       
   137 	virtual ~CFotaServer();
       
   138 
       
   139 public: // New functions
       
   140 
       
   141 
       
   142     /**
       
   143      * Create database
       
   144      *
       
   145      * @since   S60   v3.1
       
   146      * @param   aLargObj    Is it largeobject download (or dlmgr download)
       
   147      * @param   aPkgId      Packageid of the download
       
   148      * @return  none
       
   149      */
       
   150     void UpdatePackageDownloadCompleteL( TBool aLargObj,const TInt aPkgId);
       
   151  
       
   152  
       
   153     /**
       
   154      * Check s/w version with the current version
       
   155      *
       
   156      * @since   S60   v3.2
       
   157      * @param   none
       
   158      * @return  Bool value(matches or not)
       
   159      */
       
   160      TBool CheckSWVersionL();
       
   161      
       
   162     /**
       
   163      * Start download
       
   164      *
       
   165      * @since   S60   v3.1
       
   166      * @param   aParams     Package state params to be save in db
       
   167      * @param   aPkgURL     URL
       
   168      * @return  none
       
   169      */
       
   170     void DownloadL(TDownloadIPCParams aParams,const TDesC8& aPkgURL);
       
   171 
       
   172 
       
   173     /**
       
   174      * Start download which finishes with update
       
   175      *
       
   176      * @since   S60   v3.1
       
   177      * @param   aParams     Package state params to be save in db
       
   178      * @param   aPkgURL     URL
       
   179      * @return  none
       
   180      */
       
   181     void DownloadAndUpdateL(TDownloadIPCParams aParams
       
   182             ,const TDesC8& aPkgURL);
       
   183 
       
   184 
       
   185 
       
   186     /**
       
   187      * Start update
       
   188      *
       
   189      * @since   S60   v3.1
       
   190      * @param   aParams     Package state params to be save in db
       
   191      * @return  none
       
   192      */    
       
   193     void UpdateL( const TDownloadIPCParams& aParams );
       
   194 
       
   195 
       
   196 
       
   197     /**
       
   198      * Update, triggered by scheduler
       
   199      *
       
   200      * @since   S60   v3.1
       
   201      * @param   aUpdate     Update details
       
   202      * @return  none
       
   203      */ 
       
   204     void ScheduledUpdateL( TFotaScheduledUpdate aUpdate );
       
   205 
       
   206     /**
       
   207      * Delete swupd package
       
   208      *
       
   209      * @since   S60   v3.1
       
   210      * @param   aPkgId  Package id
       
   211      * @return  none
       
   212      */    
       
   213     void DeletePackageL ( const TInt aPkgId);
       
   214 
       
   215 
       
   216 
       
   217     /**
       
   218      * Get state of a swupd package
       
   219      *
       
   220      * @since   S60   v3.1
       
   221      * @param   aPkgId  Package id
       
   222      * @return  Package state
       
   223      */       
       
   224     TPackageState GetStateL( const TInt aPkgId);
       
   225 
       
   226 
       
   227     /**
       
   228      * Open a store to save swupd into
       
   229      *
       
   230      * @since   S60   v3.1
       
   231      * @param   aMessage    containing client side chunk handle  
       
   232      * @return  None
       
   233      */       
       
   234     void OpenUpdatePackageStoreL ( const RMessage2& aMessage );
       
   235 
       
   236     /**
       
   237      * Gets the downloaded and complete size of the update package
       
   238      *
       
   239      * @since   S60   v3.2
       
   240      * @param   aPkgId    Package id
       
   241      * @param	aDownloadedSize		size of download package in bytes
       
   242      * @param	aTotalSize	size of the complete package in bytes
       
   243      * @return  None
       
   244      */       
       
   245     void GetDownloadUpdatePackageSizeL (const TInt aPkgId, TInt& aDownloadedSize, TInt& aTotalSize);
       
   246 
       
   247     /**
       
   248      * Tries to resume the download.
       
   249      *
       
   250      * @since   S60   v3.2
       
   251      * @param   aQueryUser	Whether to query user for resume?
       
   252      * @return  None
       
   253      */       
       
   254 	void TryResumeDownloadL(TBool aQueryUser);
       
   255 
       
   256     /**
       
   257      * Invoke Fota Monitory Service when the download gets suspended
       
   258      *
       
   259      * @since   S60   v3.2
       
   260      * @return  None
       
   261      */       
       
   262 	void InvokeFmsL();
       
   263 	
       
   264     /**
       
   265      * Cancels any outstanding request for resume notification
       
   266      *
       
   267      * @since   S60   v3.2
       
   268      * @return  None
       
   269      */       
       
   270 	void CancelFmsL();
       
   271 	
       
   272     /**
       
   273      * Sets the phone's startup reason. This is used by Fota Startup Pluggin to any decision.
       
   274      *
       
   275      * @since   S60   v3.2
       
   276      * @param   aReason		Startup reason, either download interrupted
       
   277      * @return  None
       
   278      */       
       
   279 	void SetStartupReason(TInt aReason);
       
   280 	
       
   281 	/**
       
   282 	 * Shutdown DM UI application
       
   283 	 * @since	S60	 v3.2
       
   284 	 * @return 	None
       
   285 	 */
       
   286 	void ShutApp();
       
   287 	
       
   288 	/**
       
   289 	 * Stops ongoing download, if any.
       
   290 	 * @since	S60	 v3.2
       
   291 	 * @param	aReason		Reason for stopping the download.
       
   292 	 * @return 	None
       
   293 	 */
       
   294 	void StopDownload(TInt aReason);
       
   295 	
       
   296     /**
       
   297      * Read data from chunk
       
   298      *
       
   299      * @since   S60   v3.1
       
   300      * @param   aSize   Size of data
       
   301      * @param   aError error caught while writing data into FS
       
   302      * @return  none
       
   303      */
       
   304     void ReadChunkL ( const TInt aSize ,TInt aError );
       
   305 
       
   306 
       
   307     /**
       
   308      * Check if swupd package fits into store
       
   309      *
       
   310      * @since   S60   v3.1
       
   311      * @param   aSize   Size of swupd
       
   312      * @return  Does it fit?
       
   313      */
       
   314     TBool IsPackageStoreSizeAvailableL ( const TInt aSize );
       
   315 
       
   316 
       
   317     /**
       
   318      * Get ids of present swupd packages
       
   319      *
       
   320      * @since   S60   v3.1
       
   321      * @param   aPackageIdList  On return, ids will be here
       
   322      * @return  None
       
   323      */
       
   324     void  GetUpdatePackageIdsL(TDes16& aPackageIdList);
       
   325 
       
   326 
       
   327     /**
       
   328      * Get time of last update
       
   329      *
       
   330      * @since   S60   v3.1
       
   331      * @param   aTime       On return, time of last update
       
   332      * @return  None
       
   333      */
       
   334     void GetUpdateTimeStampL (TDes16& aTime) ; 
       
   335 
       
   336 
       
   337     /**
       
   338      * Set download to be finalized. 
       
   339      *
       
   340      * @since   S60   v3.1
       
   341      * @param   aDLState    Final state of the download
       
   342      * @return  None
       
   343      */
       
   344     void  FinalizeDownloadL( const TPackageState& aDLState );
       
   345 
       
   346 
       
   347     /**
       
   348      * Set update to be finalized. 
       
   349      *
       
   350      * @since   S60   v3.1
       
   351      * @param   None
       
   352      * @return  None
       
   353      */
       
   354     void  FinalizeUpdateL();
       
   355 
       
   356     /**
       
   357      * Monitors for the battery in case of USB charger
       
   358      *
       
   359      * @since   S60   v3.2.3
       
   360      * @param   aLevel - level of the battery charge to monitor
       
   361      * @return  None
       
   362      */
       
   363     void MonitorBattery(TInt aLevel);
       
   364 
       
   365     /**
       
   366      * Finalize download
       
   367      *
       
   368      * @since   S60   v3.1
       
   369      * @param   None
       
   370      * @return  None
       
   371      */
       
   372     void  DoFinalizeDownloadL();
       
   373 
       
   374 
       
   375     /**
       
   376      * Finalize Update
       
   377      *
       
   378      * @since   S60   v3.1
       
   379      * @param   None
       
   380      * @return  None
       
   381      */
       
   382     void  DoFinalizeUpdateL();
       
   383 
       
   384 
       
   385     /**
       
   386      * Read update result file and report result back to DM server
       
   387      *
       
   388      * @since   S60   v3.1
       
   389      * @param   None
       
   390      * @return  None
       
   391      */
       
   392     void  DoExecuteResultFileL();
       
   393     
       
   394     /**
       
   395      * Deletes the update result file
       
   396      *
       
   397      * @since   S60   v3.2
       
   398      * @param   None
       
   399      * @return  None
       
   400      */
       
   401     void  DoDeleteUpdateResultFileL();
       
   402 
       
   403     /**
       
   404     * Close syncml session
       
   405     *
       
   406     * @since   S60 v3.1
       
   407     * @param none
       
   408     * @return none
       
   409     */
       
   410     void DoCloseSMLSessionL();
       
   411 
       
   412     /**
       
   413      * Shutdown fotaserver, if there's no operations in progress (
       
   414      * download,update)
       
   415      *
       
   416      * @since   S60   v3.1
       
   417      * @param   None
       
   418      * @return  Error
       
   419      */
       
   420     TInt TryToShutDownFotaServer();
       
   421 
       
   422 
       
   423     /**
       
   424      * Get reference to storageplugin. Load it, if not existing
       
   425      *
       
   426      * @since   S60   v3.1
       
   427      * @param   None
       
   428      * @return  Reference to storage
       
   429      */
       
   430     CFotaStorage*   StoragePluginL();
       
   431 
       
   432     
       
   433     /**
       
   434      * Do cleanup for package
       
   435      *
       
   436      * @since   S60   v3.1
       
   437      * @param   aPackageID Packageid
       
   438      * @return  None
       
   439      */
       
   440     void GenericAlertSentL( const TInt aPackageID );
       
   441 
       
   442 
       
   443     /**
       
   444      * Create DM session to DM server (identified by profileid)
       
   445      *
       
   446      * @since   S60   v3.1
       
   447      * @param   aProfileId  DM profile id
       
   448      * @param   aIapid		IAP id. If not kerrnone, will be used instead
       
   449      *						of profiles' IAP id.
       
   450      * @return  none
       
   451      */
       
   452     void CreateDeviceManagementSessionL( TPackageState& aState );
       
   453     
       
   454     
       
   455     /**
       
   456      * Get profiles' data.
       
   457      *
       
   458      * @since   S60   v3.1
       
   459      * @param   aSyncml     syncml session. must be open.
       
   460      * @param   aProf 	    profile id.
       
   461      * @param   aIapid      iapid 
       
   462      * @param   aSrvAA      server alerted action
       
   463      * @param   aUIJob      is current dm job started from ui
       
   464      * @param	aSanVal		the SAN bit set by server for the DM Session
       
   465      * @return  none
       
   466      */    
       
   467     void GetProfileDataL( RSyncMLSession* aSyncml,const TSmlProfileId aProf
       
   468         , TInt& aIapId, TSmlServerAlertedAction& aSrvAA,TBool& aUIJob, TInt& aSanVal);
       
   469 
       
   470 	/**
       
   471 	 * Gets the EikonEnv object
       
   472 	 *
       
   473 	 * @since S60	v3.1
       
   474 	 * @param None
       
   475 	 * @return CEikonEnv
       
   476 	 */ 
       
   477 	CEikonEnv* GetEikEnv();
       
   478 
       
   479 
       
   480 	/**
       
   481 	 * Callback function to notify the network status
       
   482 	 *
       
   483 	 * @since S60	v3.2
       
   484 	 * @param Status of network connection
       
   485 	 * @return None
       
   486 	 */ 
       
   487 	void ReportNetworkStatus(TBool status);
       
   488 
       
   489 
       
   490 
       
   491   /**
       
   492 	 * Get the software version of the device
       
   493 	 * @since S60	v3.2
       
   494 	 * @param s/w version 
       
   495 	 * @return error
       
   496 	 */
       
   497 	TInt GetSoftwareVersion(TDes& aVersion);
       
   498 	
       
   499 	/**
       
   500 	 * Incase of large object download failure
       
   501 	 * Updates the fota database state & reason information
       
   502 	 * @since S60	v3.2
       
   503 	 * @param None
       
   504 	 * @return None
       
   505 	 */
       
   506 	void UpdateDBdataL();
       
   507 
       
   508     /**
       
   509      * stores the client id who triggered the update
       
   510      * @since S60   v3.2
       
   511      * @param aClient, client Id
       
   512      * @return None
       
   513      */ 	
       
   514 	void SetInstallUpdateClientL(TInt aClient);
       
   515 	
       
   516 	/**
       
   517 	 * returns the client id,who triggered the update
       
   518 	 * @since S60   v3.2
       
   519 	 * @param None
       
   520 	 * @return TInt
       
   521 	 */ 
       
   522 	TInt GetInstallUpdateClientL();	
       
   523 	
       
   524 	
       
   525 	/**
       
   526 	 * Checks for IAP Id exists or not in commsdb
       
   527 	 * IAPId used for resuming the paused download
       
   528 	 * @since S60   v5.0
       
   529 	 * @param IapId
       
   530 	 * @return ETrue/EFalse
       
   531 	 */
       
   532 	TBool CheckIapExistsL(TUint32 aIapId);
       
   533 	
       
   534     /**
       
   535      * This method is called to check if dencryption needs to be performed.
       
   536      */
       
   537 	TBool NeedToDecryptL(const TInt &aPkgId, TDriveNumber &aDrive);
       
   538 	
       
   539     /**
       
   540      * This method is called to start the decryption operation.
       
   541      */
       
   542 	void DoStartDecryptionL();
       
   543 	
       
   544     /**
       
   545      * This method is called once the decryption operation is complete.
       
   546      */
       
   547     void HandleDecryptionCompleteL(TInt aResult, TInt aValue = 0);
       
   548     
       
   549     /**
       
   550      * This method is called to check if encryption needs to be performed.
       
   551      */
       
   552     TBool NeedToEncryptL(TDriveNumber &aDrive);
       
   553     
       
   554     /**
       
   555      * This method is called to start the encryption operation.
       
   556      */
       
   557     void DoStartEncryptionL();
       
   558 	
       
   559     /**
       
   560      * This method is called once the encryption operation is complete.
       
   561      */
       
   562 	void HandleEncryptionCompleteL(TInt aResult, TInt aValue = 0);
       
   563 	
       
   564     /**
       
   565      * Gets the device encryption operation
       
   566      */
       
   567 	TInt GetDEOperation();
       
   568 	
       
   569     
       
   570     /**
       
   571      * Is server initialized? Must be public for session to use.
       
   572      */
       
   573     TBool iInitialized;
       
   574 
       
   575     /**
       
   576     * Whether Fota server should close or not
       
   577     */
       
   578     TBool iNeedToClose;
       
   579     
       
   580     /**
       
   581      * handles notifier completion
       
   582      */
       
   583     CFotaDownloadNotifHandler*  iNotifHandler;
       
   584 
       
   585 public: // from  base classes
       
   586 
       
   587     /**
       
   588      * Creator
       
   589      * Not own
       
   590      */
       
   591     CFotaSrvApp* iParentApp;
       
   592 
       
   593     /**
       
   594     * CreateServiceL. Creates session.
       
   595     * @param    aServiceType
       
   596     * @return   CApaAppServiceBase*
       
   597     */
       
   598     CApaAppServiceBase* CreateServiceL( TUid aServiceType ) const;
       
   599     /**
       
   600     * Handle syncml event
       
   601     * @param    aEvent
       
   602     * @param    aIdentifier
       
   603     * @param    aError
       
   604     * @param    aAdditionalData
       
   605     * @return   none
       
   606     */
       
   607     void OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier, TInt aError, TInt aAdditionalData) ;
       
   608 
       
   609     /**
       
   610      * Reference to client side chunk.  Swupd comes this way.
       
   611      */
       
   612     RChunk iChunk;
       
   613 
       
   614 
       
   615     /**
       
   616      * Used for package state saving.
       
   617      */
       
   618     CFotaDB* iDatabase;
       
   619 
       
   620 
       
   621     /**
       
   622      * Used for downloading.
       
   623      */
       
   624     CFotaDownload* iDownloader;
       
   625 
       
   626 
       
   627     /**
       
   628      * Used for starting update of fw.
       
   629      */
       
   630     CFotaUpdate* iUpdater;
       
   631 
       
   632 
       
   633     /**
       
   634      * Used for deleting download.
       
   635      */
       
   636     CPeriodic* iDownloadFinalizer;
       
   637 
       
   638 
       
   639     /**
       
   640      * Used for deleting update.
       
   641      */
       
   642     CPeriodic*          iUpdateFinalizer;
       
   643 
       
   644 
       
   645     /**
       
   646      * Used for reading result file.
       
   647      */
       
   648     CPeriodic*          iTimedExecuteResultFile;
       
   649 
       
   650 
       
   651     /**
       
   652      * Used for closing syncml session
       
   653      */
       
   654     CPeriodic* iTimedSMLSessionClose;
       
   655 
       
   656     /**
       
   657      * ConstructL
       
   658      *
       
   659      * @since   S60   v3.1
       
   660      * @param   aFixedServerName    Name of this app server 
       
   661      * @return  none
       
   662      */    
       
   663     virtual void ConstructL(const TDesC &aFixedServerName);
       
   664 
       
   665 protected: // from base classes
       
   666 
       
   667 
       
   668     /**
       
   669      * DoConnect. 
       
   670      *
       
   671      * @since   S60   v3.1
       
   672      * @param   aMessage    IPC message
       
   673      * @return  none
       
   674      */
       
   675     void DoConnect(const RMessage2& aMessage);
       
   676 
       
   677 
       
   678     /**
       
   679      * When last client disconnects, this is called.
       
   680      *
       
   681      * @since   S60   v3.1
       
   682      * @param   none
       
   683      * @return  none
       
   684      */
       
   685     void HandleAllClientsClosed();
       
   686 
       
   687     
       
   688 private: // new functions
       
   689 
       
   690 
       
   691     /**
       
   692      * Latter part of constructing. It's ensured that parent fotaserver is 
       
   693      * constructed only once, and child fotaserver is not constructed at all.
       
   694      * Client fotaserver has a task of saving swupd as its only task. It should
       
   695      * not update swupd states.
       
   696      *
       
   697      * @since   S60   v3.1
       
   698      * @param   aMessage    Client process details
       
   699      * @return  none
       
   700      */
       
   701     void ClientAwareConstructL( const RMessage2 &aMessage );
       
   702 
       
   703 
       
   704     /**
       
   705      * Loads storage plugin if not loaded.
       
   706      *
       
   707      * @since   S60   v3.1
       
   708      * @param   none
       
   709      * @return  none
       
   710      */
       
   711     void            LoadStoragePluginL ();
       
   712 
       
   713 
       
   714     /**
       
   715      * Unloads storage plugin.
       
   716      *
       
   717      * @since   S60   v3.1
       
   718      * @param   none
       
   719      * @return  none
       
   720      */
       
   721     void            UnLoadStoragePluginL ();
       
   722 
       
   723 
       
   724 
       
   725 /**
       
   726 	 * Resets the fota state
       
   727 	 * @since S60	v3.2
       
   728 	 * @param IPC params
       
   729 	 * @return None
       
   730 	 */
       
   731 	 
       
   732 	void ResetFotaStateL(const TDownloadIPCParams& aParams);
       
   733 	
       
   734 	/**
       
   735 	 * Starts network monitoring operaiton for defined interval and retries
       
   736 	 *
       
   737 	 * @since S60	v3.2
       
   738 	 * @param None
       
   739 	 * @return None
       
   740 	 */ 
       
   741 	void StartNetworkMonitorL();
       
   742 
       
   743 
       
   744 private: // Data
       
   745 
       
   746 
       
   747     /**
       
   748      * The state that iDownloader was in, when it called to be finalized.
       
   749      */
       
   750     TPackageState       iDLFinalizeState;
       
   751 
       
   752     /**
       
   753      * The state before sending generic alert.
       
   754      */
       
   755     TPackageState		iStoredState;
       
   756 
       
   757 
       
   758     /**
       
   759      * Storage class (plugin).
       
   760      */
       
   761     CFotaStorage*       iStorage;
       
   762 
       
   763 
       
   764     /**
       
   765      * Packageid of the swupd being stored. Used only by child fotaserver.
       
   766      */
       
   767     TInt                iStorageDownloadPackageId;
       
   768 
       
   769 
       
   770     /**
       
   771      * Destructor key of the storage plugin.
       
   772      */
       
   773     TUid                iStorageDtorKey;
       
   774 
       
   775 
       
   776     /**
       
   777      * Destructor key of the storage plugin.
       
   778      */
       
   779     RWriteStream*       iStorageStream;
       
   780 
       
   781 
       
   782     /**
       
   783      * File server session
       
   784      */
       
   785     RFs                 iFs;
       
   786 
       
   787 
       
   788     /**
       
   789      * Tries to periodically shut down fotaserver
       
   790      */
       
   791     CPeriodic*          iAppShutter;
       
   792 
       
   793     /**
       
   794      * Syncmlsession for creating dmsession
       
   795      */
       
   796     RSyncMLSession      iSyncMLSession;
       
   797 
       
   798     /**
       
   799      * Class that checks for network availability 
       
   800      * 
       
   801      */
       
   802     CFotaNetworkRegStatus* iMonitor;
       
   803 
       
   804     /**
       
   805      * How many times to try dm session
       
   806      */
       
   807     TInt    iSyncMLAttempts;
       
   808 
       
   809     /**
       
   810      * sync job id
       
   811      */
       
   812     TSmlJobId iSyncJobId;
       
   813 
       
   814     /**
       
   815      * profile
       
   816      */
       
   817     TSmlProfileId iSyncProfile;
       
   818 
       
   819     /**
       
   820      * Reference to eikonenv. Used by other classes
       
   821      * 
       
   822      */
       
   823     CEikonEnv*	iEikEnv;
       
   824 
       
   825     /**
       
   826      * To tell whether Generic Alert sending is being retried or not. This is checked before shutting down fota server
       
   827      * 
       
   828      */
       
   829     TBool iRetryingGASend;
       
   830 
       
   831     /**
       
   832      * To tell whether network is available to send Generic Alert.
       
   833      * 
       
   834      */
       
   835     TBool iNetworkAvailable;
       
   836 
       
   837     /**
       
   838      * The Fota Monitory Client object
       
   839      */
       
   840     RFMSClient	iFMSClient;
       
   841     
       
   842     /**
       
   843      * For sending GA, this will set to fotastate's iapid
       
   844      */
       
   845     TInt iIapId;
       
   846     /**
       
   847      * Tells the session mode.
       
   848      */
       
   849     TInt iSessMode;
       
   850     
       
   851     /**
       
   852      * Tells about who started resume.
       
   853      */
       
   854     TInt iUserResume;
       
   855     
       
   856     /**
       
   857      * Tells which client triggered install update.
       
   858      */
       
   859     TInt iInstallupdClient;
       
   860     
       
   861     /**
       
   862      * The pointer to encryption controller
       
   863      */
       
   864     CDevEncController *iDEController;
       
   865     
       
   866     /**
       
   867      * Holds the storage drive of the package.
       
   868      */
       
   869     TDriveNumber iStorageDrive;
       
   870     
       
   871 	};
       
   872 
       
   873 #endif 
       
   874 
       
   875 // End of File