omaprovisioning/provisioning/ProvisioningBC/Src/CWPBioControl.cpp
branchRCL_3
changeset 76 3cdbd92ee07b
parent 65 5cc2995847ea
equal deleted inserted replaced
69:a082c848c9a9 76:3cdbd92ee07b
   359     
   359     
   360     FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 2 " ) );
   360     FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 2 " ) );
   361     TBool preAuthenticated( iMessage->Authenticated() );
   361     TBool preAuthenticated( iMessage->Authenticated() );
   362     // If the message was not authenticated, give a warning
   362     // If the message was not authenticated, give a warning
   363     AuthenticateL( *iMessage );
   363     AuthenticateL( *iMessage );
   364     
       
   365     // Identify the authentication type
       
   366     TInt type = (entry->Entry()).MtmData2();
       
   367     if(type == 1)
       
   368     {    
       
   369     CRepository* repository = CRepository::NewLC( KOMAProvAuthenticationLV );	
       
   370     TInt err = repository->Set(KOMAProvMessageOpen, type);  
       
   371     if(err != KErrNone)
       
   372     	{
       
   373     		FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL Set KOMAProvMessageOpen failed" ) );
       
   374     	}    
       
   375     CleanupStack::PopAndDestroy(); // repository 
       
   376     }
       
   377     	
       
   378     FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 3 " ) );
   364     FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 3 " ) );
   379     if( !tentry.ReadOnly() && preAuthenticated != iMessage->Authenticated() )
   365     if( !tentry.ReadOnly() && preAuthenticated != iMessage->Authenticated() )
   380         {
   366         {
   381         // If the entry can be written to, get its edit store and save
   367         // If the entry can be written to, get its edit store and save
   382         // authentication flag. Failing is not dangerous, as the only
   368         // authentication flag. Failing is not dangerous, as the only
   387         }
   373         }
   388     
   374     
   389     FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 5 " ) );
   375     FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 5 " ) );
   390     iEngine->PopulateL();
   376     iEngine->PopulateL();
   391     FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 6 " ) );
   377     FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 6 " ) );
   392     
       
   393     //Reset the cenrep so it can used for next message.		
       
   394 	 CRepository* repository = CRepository::NewLC( KOMAProvAuthenticationLV );	
       
   395     TInt err = repository->Set(KOMAProvMessageOpen, 0); 
       
   396     if(err != KErrNone)
       
   397     	{
       
   398     		FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL Set KOMAProvMessageOpen failed" ) );
       
   399     	} 	     
       
   400     CleanupStack::PopAndDestroy();
       
   401     	
       
   402     // Empty messages are not supported
   378     // Empty messages are not supported
   403     if( iEngine->ItemCount() == 0 )
   379     if( iEngine->ItemCount() == 0 )
   404         {
   380         {
   405         FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 7 " ) );
   381         FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 7 " ) );
   406         User::Leave( KErrMsgBioMessageNotValid );
   382         User::Leave( KErrMsgBioMessageNotValid );
   418         }
   394         }
   419     else
   395     else
   420         {
   396         {
   421         iEngine->SetCurrentContextL( KWPMgrUidNoContext );
   397         iEngine->SetCurrentContextL( KWPMgrUidNoContext );
   422         }
   398         }
   423 	
   399 
   424     CleanupStack::PopAndDestroy(2); // orig16, entry
   400     CleanupStack::PopAndDestroy(2); // orig16, entry
   425     FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL done" ) );
   401     FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL done" ) );
   426     }
   402     }
   427 
   403 
   428 // ----------------------------------------------------------------------------
   404 // ----------------------------------------------------------------------------