--- a/omaprovisioning/provisioning/ProvisioningHandler/Src/CWPMessage.cpp Wed Sep 15 13:08:27 2010 +0300
+++ b/omaprovisioning/provisioning/ProvisioningHandler/Src/CWPMessage.cpp Wed Oct 13 15:30:06 2010 +0300
@@ -154,25 +154,7 @@
}
FLOG( _L( "CWPMessage::ProcessL: Creating engine" ) );
-
-
- TInt value( 0 );
- CRepository* rep = CRepository::NewLC( KOMAProvAuthenticationLV );
-
- TInt error = rep->Set(KOMAProvIsUserPin, value);
- if(error != KErrNone)
- {
- FLOG( _L( "CWPMessage::ProcessL: set KOMAProvIsUserPin Failed" ) );
- }
-
- error = rep->Set(KOMAProvCriticalAdapterSettingCount, value);
- if(error != KErrNone)
- {
- FLOG( _L( "CWPMessage::ProcessL: set KOMAProvCriticalAdapterSettingCount Failed" ) );
- }
-
- CleanupStack::PopAndDestroy(); // rep
-
+
// Read the message into the engine
CWPEngine* engine = CWPEngine::NewLC(); // on CS
@@ -180,7 +162,6 @@
engine->ImportDocumentL( iMessage->Body() );
FLOG( _L( "CWPMessage::ProcessL: Populating adapters" ) );
-
engine->PopulateL();
FTRACE(RDebug::Print(_L(" WPMessage::ProcessL: Number of settings: (%d)"), engine->ItemCount()));
@@ -199,41 +180,13 @@
FLOG( _L( "CWPMessage::ProcessL: Bootstrapping" ) );
CWPBootstrap* bootstrap = CWPBootstrap::NewL( iPhone->SubscriberId() );
CleanupStack::PushL( bootstrap );
-
+
CWPBootstrap::TBootstrapResult result(
bootstrap->BootstrapL( *iMessage, *engine, KNullDesC ) );
CleanupStack::PopAndDestroy(); // bootstrap
FTRACE(RDebug::Print(_L(" WPMessage::ProcessL: Bootstrap result: (%d)"), result));
// See UI specs figure 1
-
- TInt adapterCount( 0 );
- TInt userPin(0);
- TInt allowCriticalSetting(0);
-
- CRepository* repository = CRepository::NewLC( KOMAProvAuthenticationLV );
- TInt getErr = repository->Get( KOMAProvCriticalAdapterSettingCount, adapterCount);
- if(getErr != KErrNone)
- {
- FLOG( _L( "CWPMessage::ProcessL: set KOMAProvCriticalAdapterSettingCount Failed" ) );
- }
-
- getErr = repository->Get( KOMAProvIsUserPin, userPin );
- if(getErr != KErrNone)
- {
- FLOG( _L( "CWPMessage::PrepareEntryLC: set KOMAProvIsUserPin Failed" ) );
- }
-
- getErr = repository->Get( KOMAProvAllowCriticalAdapterSetting, allowCriticalSetting );
- if(getErr != KErrNone)
- {
- FLOG( _L( "CWPMessage::PrepareEntryLC: set KOMAProvIsUserPin Failed" ) );
- }
-
- CleanupStack::PopAndDestroy(); // repository
-
-
-
TBool haveSettings( engine->ItemCount() > 0 );
switch( result )
{
@@ -241,24 +194,9 @@
{
FLOG( _L( "CWPMessage::ProcessL: Bootstrapping ENoBootstrap" ) );
// If there's no bootstrap, just save the message
-
- if( haveSettings)
+ if( haveSettings )
{
- if(allowCriticalSetting)
- {
- if(!userPin)
- {
- StoreMsgL();
- }
- else if(adapterCount != engine->ItemCount())
- {
- StoreMsgL();
- }
- }
- else
- {
- StoreMsgL();
- }
+ StoreMsgL();
}
else
{
@@ -270,75 +208,36 @@
case CWPBootstrap::ENotAuthenticated:
{
FLOG( _L( "CWPMessage::ProcessL: Bootstrapping ENotAuthenticated" ) );
-
- if(haveSettings)
- {
- if(allowCriticalSetting)
- {
- if(adapterCount != engine->ItemCount())
- {
- StoreMsgL();
- }
- }
- else
- {
- StoreMsgL();
- }
- }
+ if( haveSettings )
+ {
+ StoreMsgL();
+ }
else
{
+
// Message is ignored and an information SMs is put to Inbox.
//Information SMs can be Class0, based on operator requirement.
- if(allowCriticalSetting)
- {
- if(adapterCount != engine->ItemCount())
- {
- TInt auth_value;
- CRepository * rep = 0;
- TRAPD( err, rep = CRepository::NewL( KCRUidOMAProvisioningLV ));
- if(err == KErrNone)
- {
- rep->Get( KOMAProvAuthFailMsgHandling, auth_value );
- delete rep;
-
- if(auth_value == 1)
- StoreMsgclass0L(R_TEXT_AUTHENTICATION_FAILED);
- else
- StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
+ TInt auth_value;
+ CRepository * rep = 0;
+ TRAPD( err, rep = CRepository::NewL( KCRUidOMAProvisioningLV ));
+ if(err == KErrNone)
+ {
+ rep->Get( KOMAProvAuthFailMsgHandling, auth_value );
+ delete rep;
- User::Leave( KErrAccessDenied );
- }
- else
- {
- StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
- User::Leave( KErrAccessDenied );
- }
- }
- }
+ if(auth_value == 1)
+ StoreMsgclass0L(R_TEXT_AUTHENTICATION_FAILED);
else
- {
- TInt auth_value;
- CRepository * rep = 0;
- TRAPD( err, rep = CRepository::NewL( KCRUidOMAProvisioningLV ));
- if(err == KErrNone)
- {
- rep->Get( KOMAProvAuthFailMsgHandling, auth_value );
- delete rep;
+ StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
- if(auth_value == 1)
- StoreMsgclass0L(R_TEXT_AUTHENTICATION_FAILED);
- else
- StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
-
- User::Leave( KErrAccessDenied );
- }
- else
- {
- StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
- User::Leave( KErrAccessDenied );
- }
+ User::Leave( KErrAccessDenied );
}
- }
+ else
+ {
+ StoreMsgL(R_TEXT_AUTHENTICATION_FAILED);
+ User::Leave( KErrAccessDenied );
+ }
+ }
break;
}
@@ -347,26 +246,12 @@
FLOG( _L( "CWPMessage::ProcessL: Bootstrapping EPinRequired" ) );
// If PIN is required, defer authentication to ProvisioningBC
- if(haveSettings)
+ if( haveSettings )
{
- if(allowCriticalSetting)
- {
- if(!userPin)
- {
- StoreMsgL();
- }
- else if(adapterCount != engine->ItemCount())
- {
- StoreMsgL();
- }
- }
- else
- {
- StoreMsgL();
- }
+ StoreMsgL();
}
else
- {
+ {
User::Leave( KErrCorrupt );
}
break;
@@ -686,22 +571,6 @@
aEntry.iError = KErrNone;
// iMtmData1 is been used/reserved for count, please don't use for any other purpose.
aEntry.SetMtmData1(3);
- aEntry.SetMtmData2(0);
-
- TInt userPin = 0;
- CRepository* repository = CRepository::NewLC( KOMAProvAuthenticationLV );
- TInt err = repository->Get( KOMAProvIsUserPin, userPin );
- if(err != KErrNone)
- {
- FLOG( _L( "CWPMessage::PrepareEntryLC: set KOMAProvIsUserPin Failed" ) );
- }
- CleanupStack::PopAndDestroy(); // repository
-
- if(userPin == 1)
- {
- aEntry.SetMtmData2(1);
- }
-
FLOG( _L( "CWPMessage::PrepareEntryLC create an invisible blank entry done" ) );
// Look up the details
HBufC* details = NULL;