iaupdate/IAD/firmwareupdate/src/iaupdatefwupdatehandler.cpp
changeset 29 26b6f0522fd8
parent 0 ba25891c3a9e
child 44 329d304c1aa1
child 53 ae54820ef82c
equal deleted inserted replaced
25:98b66e4fb0be 29:26b6f0522fd8
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    13 *
    13 *
    14 * Description:            
    14 * Description:            
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 #include <e32base.h>
    19 #include <iaupdate.rsg>
       
    20 #include <StringLoader.h> 
       
    21 #include <aknmessagequerydialog.h>
       
    22 #include <aknnotewrappers.h>
       
    23 #include <DevManInternalCRKeys.h>
    19 #include <DevManInternalCRKeys.h>
       
    20 #include <centralrepository.h>
    24 #include <e32property.h>
    21 #include <e32property.h>
    25 
    22 
    26 #include "iaupdatefwupdatehandler.h"
    23 #include "iaupdatefwupdatehandler.h"
    27 #include "iaupdatefwfotamodel.h"
    24 #include "iaupdatefwfotamodel.h"
    28 #include "iaupdatefwsyncprofile.h"
    25 #include "iaupdatefwsyncprofile.h"
   137     {
   134     {
   138     switch ( iRequest )
   135     switch ( iRequest )
   139         {
   136         {
   140         case ENSU:
   137         case ENSU:
   141             {          
   138             {          
   142             HBufC* text1 = StringLoader::LoadLC( R_IAUPDATE_INFO_NSU_1 );  
   139             /*HBufC* text1 = StringLoader::LoadLC( R_IAUPDATE_INFO_NSU_1 );  
   143             HBufC* text2 = StringLoader::LoadLC( R_IAUPDATE_INFO_NSU_2 );
   140             HBufC* text2 = StringLoader::LoadLC( R_IAUPDATE_INFO_NSU_2 );
   144             
   141             
   145             HBufC* text = HBufC::NewLC( text1->Length() +
   142             HBufC* text = HBufC::NewLC( text1->Length() +
   146                                         text2->Length() );
   143                                         text2->Length() );
   147                 
   144                 
   153             ShowDialogL( *text, *heading );
   150             ShowDialogL( *text, *heading );
   154             
   151             
   155             CleanupStack::PopAndDestroy( heading ); //text, heading
   152             CleanupStack::PopAndDestroy( heading ); //text, heading
   156             CleanupStack::PopAndDestroy( text );
   153             CleanupStack::PopAndDestroy( text );
   157             CleanupStack::PopAndDestroy( text2 );
   154             CleanupStack::PopAndDestroy( text2 );
   158             CleanupStack::PopAndDestroy( text1 );
   155             CleanupStack::PopAndDestroy( text1 );*/
   159           
   156           
   160             break;
   157             break;
   161             }
   158             }
   162         case EFOTA:
   159         case EFOTA:
   163             {
   160             {
   172                 { 
   169                 { 
   173                 //if status is downloadcomplete or startingupdate
   170                 //if status is downloadcomplete or startingupdate
   174                 //still allow user to continue
   171                 //still allow user to continue
   175                 if ( ( fotamodelstate != RFotaEngineSession::EDownloadComplete ) && ( fotamodelstate != RFotaEngineSession::EStartingUpdate ) )
   172                 if ( ( fotamodelstate != RFotaEngineSession::EDownloadComplete ) && ( fotamodelstate != RFotaEngineSession::EStartingUpdate ) )
   176                     {
   173                     {
       
   174 		                //if download is suspended, try to resume it.
       
   175 		                if ( fotamodelstate == RFotaEngineSession::EDownloadProgressingWithResume)
       
   176 		                    {
       
   177 		                    TInt result = iFotaModel->TryResumeFwUpdDownload();
       
   178 						            FLOG_NUM( "[IAUPDATEFW] TryResumeFwUpdDownload result  = %d", result );   
       
   179 		                    }
       
   180                     //anyway, DM is in use
   177                     isDmActive = ETrue;
   181                     isDmActive = ETrue;
   178                     }
   182                     }
   179                 }
   183                 }
   180                      
   184                      
   181             if ( isDmActive )
   185             if ( isDmActive )
   221 
   225 
   222 // -----------------------------------------------------------------------------
   226 // -----------------------------------------------------------------------------
   223 //  CIAUpdateFWUpdateHandler::ShowDialogL()
   227 //  CIAUpdateFWUpdateHandler::ShowDialogL()
   224 // -----------------------------------------------------------------------------
   228 // -----------------------------------------------------------------------------
   225 //
   229 //
   226 void CIAUpdateFWUpdateHandler::ShowDialogL(TDesC& aText, TDesC& aHeading )
   230 void CIAUpdateFWUpdateHandler::ShowDialogL(TDesC& /*aText*/, TDesC& /*aHeading*/ )
   227     {  
   231     {  
   228     CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL( aText );
   232     //CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL( aText );
   229 
   233 
   230     dlg->PrepareLC( R_IAUPDATE_MESSAGE_QUERY );
   234     //dlg->PrepareLC( R_IAUPDATE_MESSAGE_QUERY );
   231 
   235 
   232     CAknPopupHeadingPane* headingPane = dlg->Heading();
   236     //CAknPopupHeadingPane* headingPane = dlg->Heading();
   233     headingPane->SetTextL( aHeading );
   237     //headingPane->SetTextL( aHeading );
   234 	    
   238 	    
   235     TInt ret = dlg->RunLD();
   239     //TInt ret = dlg->RunLD();
   236     }
   240     }
   237         
   241         
   238 
   242 
   239 // -----------------------------------------------------------------------------
   243 // -----------------------------------------------------------------------------
   240 //  CIAUpdateFWUpdateHandler::StartSyncL()
   244 //  CIAUpdateFWUpdateHandler::StartSyncL()
   276                                            aUseFotaProgressNote ) );
   280                                            aUseFotaProgressNote ) );
   277 
   281 
   278     if (error != KErrNone)
   282     if (error != KErrNone)
   279         {
   283         {
   280 
   284 
   281         CAknInformationNote* queryDialog = new (ELeave) CAknInformationNote;
   285         //CAknInformationNote* queryDialog = new (ELeave) CAknInformationNote;
   282         
   286         
   283         HBufC* error = HBufC::NewL(20);
   287         //HBufC* error = HBufC::NewL(20);
   284                   TPtr ptrerror = error->Des();
   288         //          TPtr ptrerror = error->Des();
   285                   ptrerror.Copy(_L("sync problem")); 
   289         //          ptrerror.Copy(_L("sync problem")); 
   286         queryDialog->ExecuteLD( *error  );
   290         //queryDialog->ExecuteLD( *error  );
   287         }
   291         }
   288     }
   292     }
   289 
   293 
   290 //EOF
   294 //EOF
   291 
   295