diff -r 30e048a7b597 -r bad0cc58d154 eapol/eapol_framework/eapol_symbian/am/type/aka/symbian/plugin/src/EapAka.cpp --- a/eapol/eapol_framework/eapol_symbian/am/type/aka/symbian/plugin/src/EapAka.cpp Thu Aug 19 09:58:27 2010 +0300 +++ b/eapol/eapol_framework/eapol_symbian/am/type/aka/symbian/plugin/src/EapAka.cpp Tue Aug 31 15:16:37 2010 +0300 @@ -16,7 +16,7 @@ */ /* -* %version: 15.1.2 % +* %version: 25 % */ // This is enumeration of EAPOL source code. @@ -37,12 +37,11 @@ #include #include "eap_am_type_aka_symbian.h" #include "EapAkaDbUtils.h" - -#include -#include "EapAkaUi.h" - +#include "EapConversion.h" #include "eap_am_tools_symbian.h" +#include "EapTraceSymbian.h" + // LOCAL CONSTANTS @@ -138,40 +137,19 @@ } // ---------------------------------------------------------- -TInt CEapAka::InvokeUiL() -{ - TInt buttonId(0); - -#ifdef USE_EAP_EXPANDED_TYPES - CEapAkaUiConnection uiConn(iIndexType, iIndex, iTunnelingType.get_vendor_type()); - -#else - - CEapAkaUiConnection uiConn(iIndexType, iIndex, iTunnelingType); - -#endif //#ifdef USE_EAP_EXPANDED_TYPES - - CEapAkaUi* ui = CEapAkaUi::NewL(&uiConn); - CleanupStack::PushL(ui); - buttonId = ui->InvokeUiL(); - CleanupStack::PopAndDestroy(ui); - return buttonId; -} - -// ---------------------------------------------------------- -CEapTypeInfo* CEapAka::GetInfoLC() +CEapTypeInfo* CEapAka::GetInfoL() { CEapTypeInfo* info = new(ELeave) CEapTypeInfo( (TDesC&)KReleaseDate, (TDesC&)KEapTypeVersion, (TDesC&)KManufacturer); - CleanupStack::PushL(info); return info; } // ---------------------------------------------------------- + void CEapAka::DeleteConfigurationL() { EapAkaDbUtils::DeleteConfigurationL(iIndexType, iIndex, iTunnelingType); @@ -186,19 +164,22 @@ // ---------------------------------------------------------- -void CEapAka::SetTunnelingType(const TInt aTunnelingType) -{ -#ifdef USE_EAP_EXPANDED_TYPES - - // Vendor id is eap_type_vendor_id_ietf always in this plugin. - iTunnelingType.set_eap_type_values(eap_type_vendor_id_ietf, aTunnelingType); - -#else - - iTunnelingType = static_cast(aTunnelingType); - -#endif //#ifdef USE_EAP_EXPANDED_TYPES -} +void CEapAka::SetTunnelingType(const TEapExpandedType aTunnelingType) + { + EAP_TRACE_DATA_DEBUG_SYMBIAN( + (EAPL("CEapAka::SetTunnelingType - tunneling type"), + aTunnelingType.GetValue().Ptr(), aTunnelingType.GetValue().Length())); + + eap_type_value_e aInternalType; + + TInt err = CEapConversion::ConvertExpandedEAPTypeToInternalType( + &aTunnelingType, + &aInternalType); + + iTunnelingType = aInternalType; + + + } // ---------------------------------------------------------- @@ -223,13 +204,16 @@ RDbNamedDatabase db; - RDbs session; - - EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); + RFs session; CleanupClosePushL(session); CleanupClosePushL(db); - + TInt error = session.Connect(); + EAP_TRACE_DEBUG_SYMBIAN((_L("CEapAka::SetIndexL(): - session.Connect(), error=%d\n"), error)); + User::LeaveIfError(error); + + EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); + EapAkaDbUtils::SetIndexL( db, iIndexType, @@ -242,7 +226,11 @@ iIndexType = aIndexType; iIndex = aIndex; - CleanupStack::PopAndDestroy(2); // db + db.Close(); + session.Close(); + + CleanupStack::PopAndDestroy(&db); + CleanupStack::PopAndDestroy(&session); } // ---------------------------------------------------------- @@ -251,22 +239,29 @@ { RDbNamedDatabase db; - RDbs session; - + RFs session; + + CleanupClosePushL(session); + CleanupClosePushL(db); + TInt error = session.Connect(); + EAP_TRACE_DEBUG_SYMBIAN((_L("CEapAka::SetConfigurationL(): - session.Connect(), error=%d\n"), error)); + User::LeaveIfError(error); + // This also creates the IAP entry if it doesn't exist EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); - CleanupClosePushL(session); - CleanupClosePushL(db); - EapAkaDbUtils::SetConfigurationL( db, aSettings, iIndexType, iIndex, iTunnelingType); - - CleanupStack::PopAndDestroy(2); // db, session + + db.Close(); + session.Close(); + + CleanupStack::PopAndDestroy(&db); + CleanupStack::PopAndDestroy(&session); } // ---------------------------------------------------------- @@ -275,13 +270,16 @@ { RDbNamedDatabase db; - RDbs session; - + RFs session; + + CleanupClosePushL(session); + CleanupClosePushL(db); + TInt error = session.Connect(); + EAP_TRACE_DEBUG_SYMBIAN((_L("CEapAka::SetConfigurationL(): - session.Connect(), error=%d\n"), error)); + User::LeaveIfError(error); + // This also creates the IAP entry if it doesn't exist EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); - - CleanupClosePushL(session); - CleanupClosePushL(db); EapAkaDbUtils::GetConfigurationL( db, @@ -289,8 +287,12 @@ iIndexType, iIndex, iTunnelingType); - - CleanupStack::PopAndDestroy(2); // db, session + + db.Close(); + session.Close(); + + CleanupStack::PopAndDestroy(&db); + CleanupStack::PopAndDestroy(&session); } // ---------------------------------------------------------- @@ -316,13 +318,16 @@ RDbNamedDatabase db; - RDbs session; - - EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); - + RFs session; + CleanupClosePushL(session); CleanupClosePushL(db); - + TInt error = session.Connect(); + EAP_TRACE_DEBUG_SYMBIAN((_L("CEapAka::CopySettingsL(): - session.Connect(), error=%d\n"), error)); + User::LeaveIfError(error); + + EapAkaDbUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType); + EapAkaDbUtils::CopySettingsL( db, iIndexType, @@ -331,8 +336,12 @@ aDestinationIndexType, aDestinationIndex, iTunnelingType); - - CleanupStack::PopAndDestroy(2); // db - + + db.Close(); + session.Close(); + + CleanupStack::PopAndDestroy(&db); + CleanupStack::PopAndDestroy(&session); } + // End of file