diff -r ccb4f6b3db21 -r 8cb079868133 sysstatemgmt/systemstateplugins/adptplugin/src/emergencycallrfadaptationref.cpp --- a/sysstatemgmt/systemstateplugins/adptplugin/src/emergencycallrfadaptationref.cpp Tue Aug 31 16:29:05 2010 +0300 +++ b/sysstatemgmt/systemstateplugins/adptplugin/src/emergencycallrfadaptationref.cpp Wed Sep 01 12:34:26 2010 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -10,21 +10,11 @@ // // Contributors: // -// Description: This adaptation plugin implementation is for test/reference purposes. -// The loading of this plugin is controlled through test macro defined in the iby file "ssmcompatibility.iby". -// If the macro "TEST_SSM_MACRO" is not defined, original plugins are loaded and this plugin is not loaded. -// If the test P & S key is set in the test code, the calls are routed to the reference or dummy implementations. -// Else the actual plugins are loaded and the calls are routed to the actual implementations. -// The test P & S key which it looks for is KEmergencyCallRfAdaptationPluginPropertyKey(0x2000E657) +// Description: // -#include "ssmdebug.h" -#include #include "emergencycallrfadaptationref.h" -const TUint32 KEmergencyCallRfAdaptationPluginPropertyKey = 0x2000E657; -const TUid KPropertyCategory={0x2000D75B}; - /** Function to create new Emergency Call RF Adaptation Plugin. @@ -42,25 +32,11 @@ CEmergencyCallRfAdaptationRef* CEmergencyCallRfAdaptationRef::NewL() { CEmergencyCallRfAdaptationRef* self = new(ELeave) CEmergencyCallRfAdaptationRef; - - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; } -void CEmergencyCallRfAdaptationRef::ConstructL() - { - DEBUGPRINT1A("Loading Actual plugins"); - _LIT(KSaaEmergencyCallRfAdaptationDLL, "saaemergencycallrfadaptation.dll"); - User::LeaveIfError(iSaaEmergencyCallRfAdaptationLib.Load(KSaaEmergencyCallRfAdaptationDLL)); - iSaaEmergencyCallRfAdaptationDll = (MEmergencyCallRfAdaptation *)(iSaaEmergencyCallRfAdaptationLib.Lookup(1)()); - } - CEmergencyCallRfAdaptationRef::~CEmergencyCallRfAdaptationRef() { - iSaaEmergencyCallRfAdaptationLib.Close(); } CEmergencyCallRfAdaptationRef::CEmergencyCallRfAdaptationRef() @@ -72,65 +48,36 @@ */ void CEmergencyCallRfAdaptationRef::Release() { - if(!IsTestPsKeyDefined()) - { - DEBUGPRINT1A("Release:: Calling Actual plugins functions (saaemergencycallrfadaptation.dll)"); - iSaaEmergencyCallRfAdaptationDll->Release(); - } - else - { - DEBUGPRINT1A("Release:: Calling Reference plugins functions (emergencycallrfadaptationref.dll)"); - } - delete this; + delete this; } /** Request RF activation so that an emergency call can be made. - Reference implementation completes the request with KErrNone. This is required for automated testing. - Actual plugins return expected values and this can be verified by manual testing + Reference implementation completes the request with KErrNone as support for RF activation is not available on Techview/H4 hrp. @param aStatus to complete when the operation has finished @see TRequestStatus */ void CEmergencyCallRfAdaptationRef::ActivateRfForEmergencyCall(TRequestStatus& aStatus) { - if(!IsTestPsKeyDefined()) - { - DEBUGPRINT1A("ActivateRfForEmergencyCall:: Calling Actual plugins functions (saaemergencycallrfadaptation.dll)"); - iSaaEmergencyCallRfAdaptationDll->ActivateRfForEmergencyCall(aStatus); - } - else - { - DEBUGPRINT1A("ActivateRfForEmergencyCall:: Calling Reference plugins functions (emergencycallrfadaptationref.dll)"); - aStatus = KRequestPending; - TRequestStatus* status = &aStatus; - User::RequestComplete(status, KErrNone); - } + aStatus = KRequestPending; + TRequestStatus* status = &aStatus; + User::RequestComplete(status, KErrNone); } /** Request RF deactivation after an emergency call have been made. - Reference implementation completes the request with KErrNone. This is required for automated testing. - Actual plugins return expected values and this can be verified by manual testing - + Reference implementation completes the request with KErrNone as support for RF deactivation is not available on Techview/H4 hrp. + @param aStatus to complete when the operation has finished @see TRequestStatus */ void CEmergencyCallRfAdaptationRef::DeactivateRfForEmergencyCall(TRequestStatus& aStatus) { - if(!IsTestPsKeyDefined()) - { - DEBUGPRINT1A("DeactivateRfForEmergencyCall:: Calling Actual plugins functions (saaemergencycallrfadaptation.dll)"); - iSaaEmergencyCallRfAdaptationDll->DeactivateRfForEmergencyCall(aStatus); - } - else - { - DEBUGPRINT1A("DeactivateRfForEmergencyCall:: Calling Reference plugins functions (emergencycallrfadaptationref.dll)"); - aStatus = KRequestPending; - TRequestStatus* status = &aStatus; - User::RequestComplete(status, KErrNone); - } - } + aStatus = KRequestPending; + TRequestStatus* status = &aStatus; + User::RequestComplete(status, KErrNone); + } /** Cancel the outstanding request. Reference implementation completes the requests immediately so there is nothing to cancel. @@ -138,26 +85,4 @@ */ void CEmergencyCallRfAdaptationRef::Cancel() { - if(!IsTestPsKeyDefined()) - { - DEBUGPRINT1A("Cancel:: Calling Actual plugins functions (saaemergencycallrfadaptation.dll)"); - iSaaEmergencyCallRfAdaptationDll->Cancel(); - } } - -/** - Helper function to check for P&S Key -*/ -TBool CEmergencyCallRfAdaptationRef::IsTestPsKeyDefined() - { - TBool testPsKeyDefined = EFalse; - TInt result = RProperty::Get(KPropertyCategory, KEmergencyCallRfAdaptationPluginPropertyKey, testPsKeyDefined); - DEBUGPRINT3(_L("KEmergencyCallRfAdaptationPluginPropertyKey %d Error %d"), testPsKeyDefined, result); - if ((KErrNone != result) && (KErrNotFound != result)) - { - //Could not retrieve property value. Tests might fail - DEBUGPRINT1A("IsTestPsKeyDefined ERROR :: Could not retrieve property value)"); - } - return testPsKeyDefined; - } -