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 |
364 FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 3 " ) ); |
378 FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 3 " ) ); |
365 if( !tentry.ReadOnly() && preAuthenticated != iMessage->Authenticated() ) |
379 if( !tentry.ReadOnly() && preAuthenticated != iMessage->Authenticated() ) |
366 { |
380 { |
367 // If the entry can be written to, get its edit store and save |
381 // If the entry can be written to, get its edit store and save |
368 // authentication flag. Failing is not dangerous, as the only |
382 // authentication flag. Failing is not dangerous, as the only |
373 } |
387 } |
374 |
388 |
375 FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 5 " ) ); |
389 FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 5 " ) ); |
376 iEngine->PopulateL(); |
390 iEngine->PopulateL(); |
377 FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 6 " ) ); |
391 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 |
378 // Empty messages are not supported |
402 // Empty messages are not supported |
379 if( iEngine->ItemCount() == 0 ) |
403 if( iEngine->ItemCount() == 0 ) |
380 { |
404 { |
381 FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 7 " ) ); |
405 FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL 7 " ) ); |
382 User::Leave( KErrMsgBioMessageNotValid ); |
406 User::Leave( KErrMsgBioMessageNotValid ); |
394 } |
418 } |
395 else |
419 else |
396 { |
420 { |
397 iEngine->SetCurrentContextL( KWPMgrUidNoContext ); |
421 iEngine->SetCurrentContextL( KWPMgrUidNoContext ); |
398 } |
422 } |
399 |
423 |
400 CleanupStack::PopAndDestroy(2); // orig16, entry |
424 CleanupStack::PopAndDestroy(2); // orig16, entry |
401 FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL done" ) ); |
425 FLOG( _L( "[ProvisioningBC] CWPBioControl::RestoreMsgL done" ) ); |
402 } |
426 } |
403 |
427 |
404 // ---------------------------------------------------------------------------- |
428 // ---------------------------------------------------------------------------- |