telephonyutils/etel3rdpartyapi/Test/te_etelIsv/TE_EtelIsvLineInfo.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "TE_EtelIsvbase.h"
       
    17 #include "TE_EtelIsvCallFunc.h"
       
    18 #include "TE_EtelIsvLineInfo.h"
       
    19 
       
    20 
       
    21 /**
       
    22 @file
       
    23 
       
    24 @SYMTestCaseID Etel3rdParty 22.1, TestGetLineStatus
       
    25 @SYMTestCaseDesc Test GetLineStatus 3rd party API
       
    26 @SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.2.2
       
    27 */ 
       
    28  
       
    29 
       
    30 CTestGetLineStatus::CTestGetLineStatus(TInt& aCallCount)
       
    31 /** Each test step initialises it's own name
       
    32 */
       
    33 	: iCallCount(aCallCount)
       
    34 	{
       
    35 	// store the name of this test case
       
    36 	// this is the name that is used by the script file
       
    37 	SetTestStepName(_L("TestGetLineStatus"));
       
    38 	}
       
    39 	
       
    40 enum TVerdict CTestGetLineStatus::doTestStepL()
       
    41 	{
       
    42 /**
       
    43 This step tests the CTelephony::GetLineStatus() API
       
    44 */
       
    45 
       
    46 	INFO_PRINTF1(_L("START TEST 22.1"));	
       
    47  
       
    48 	INFO_PRINTF1(_L("Test retrieving of the mobile line status"));
       
    49 	_LIT(KGoodNumber,"1789");
       
    50 	
       
    51 	SetTestNumber(15); 
       
    52 
       
    53 	//Set the call parameters for MO call
       
    54 	CTelephony::TCallParamsV1 callParams;
       
    55 	callParams.iIdRestrict = CTelephony::ESendMyId;
       
    56 	CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);	
       
    57 	
       
    58 	TTestCallParams testCallParams;
       
    59 	testCallParams.iLine = CTelephony::EVoiceLine;
       
    60 	testCallParams.iCallParamsV1Pckg = &callParamsPckg;
       
    61 	testCallParams.iTelAddress.iTelNumber = KGoodNumber;
       
    62 	testCallParams.iExpStat = KErrNone;
       
    63 	testCallParams.iExpAPIErr = KErrNone;
       
    64 	
       
    65 	CTelephony::TCallStatusV1 statusV1;
       
    66 	CTelephony::TCallStatusV1Pckg statusV1Pckg(statusV1);
       
    67 	
       
    68 	// set up local data references
       
    69 	TDes8* statusV1Data;
       
    70 	if (iBufferMode)
       
    71 		{
       
    72 		statusV1Data = &iStatusV1Buff;
       
    73 		}
       
    74 	else
       
    75 		{
       
    76 		statusV1Data = &statusV1Pckg;
       
    77 		}
       
    78 
       
    79 	CTelephony::TCallStatusV1& statusV1Results = reinterpret_cast<CTelephony::TCallStatusV1&> 
       
    80     												( const_cast<TUint8&> ( *statusV1Data->Ptr() ));
       
    81 	
       
    82 	
       
    83 	//	
       
    84 	//TEST 1: GetLineStatus with on Data & Fax line.
       
    85 	//
       
    86 	testCallParams.iLine = CTelephony::EDataLine;
       
    87 	TInt err = iTelephony->GetLineStatus(testCallParams.iLine, *statusV1Data);
       
    88 	TEST1(err==KErrNone, ETrue);
       
    89 	TEST1(statusV1Results.iStatus==CTelephony::EStatusIdle, ETrue);
       
    90 	
       
    91 	testCallParams.iLine = CTelephony::EFaxLine;
       
    92 	err = iTelephony->GetLineStatus(testCallParams.iLine, *statusV1Data);
       
    93 	//Fax line not in SIM TSY
       
    94 	TEST1(err==KErrNotSupported, ETrue);
       
    95 	
       
    96 	//	
       
    97 	//TEST 2: GetLineStatus with no active call.
       
    98 	//
       
    99 	testCallParams.iLine = CTelephony::EVoiceLine;
       
   100 	//test GetLineStatus with no active call	
       
   101 	err = iTelephony->GetLineStatus(testCallParams.iLine, *statusV1Data);
       
   102 	TEST1(err==testCallParams.iExpAPIErr, ETrue);
       
   103 	TEST1(statusV1Results.iStatus==CTelephony::EStatusIdle, ETrue);
       
   104 	
       
   105 	//	
       
   106 	//TEST 3:Make a call & Hangup a call.  Set a linetstatus notifer going and each time it is invoked call
       
   107 	//		 GetLineStatus to compare the states which should match.
       
   108 	//
       
   109 	
       
   110 	//test line status for MO calls
       
   111 	testCallParams.iExpAPIErr = KErrNone;
       
   112 	CNotifyLineStatusMOAct* testGetLineStatusMOAct = CNotifyLineStatusMOAct::NewLC(this, iTelephony);	
       
   113 	testGetLineStatusMOAct->StartTestL(testCallParams, CNotifyLineStatusBaseAct::EGetLineStatus);
       
   114 	CActiveScheduler::Start();
       
   115 	CleanupStack::PopAndDestroy(); //testGetLineStatusMOAct
       
   116 
       
   117 	//
       
   118 	//TEST 4:Answer a call & Hangup a call.  Set a linestatus notifer going and each time it is invoked call
       
   119 	//		 GetLineStatus to compare the states which should match.
       
   120 	//
       
   121 
       
   122 	//test line status for MT calls
       
   123 	CNotifyLineStatusMTAct* testGetLineStatusMTAct = CNotifyLineStatusMTAct::NewLC(this, iTelephony, iCallCount);	
       
   124 	testGetLineStatusMTAct->StartTestL(testCallParams, CNotifyLineStatusBaseAct::EGetLineStatus);
       
   125 	CActiveScheduler::Start();
       
   126 	CleanupStack::PopAndDestroy(); //testGetLineStatusMTAct	
       
   127 
       
   128 //
       
   129 //TEST 5:Make a call - check the line state.  
       
   130 //	     Put the call on hold - check the line state. 
       
   131 //		 Resume the call - check the line state.
       
   132 //       Hangup the call.- check the line state.
       
   133 //
       
   134 
       
   135 	//test state change for calls on hold
       
   136 	
       
   137 	// Create active DialNewCallAct objects
       
   138 	CTestDialNewCallAct* testDialNewCallAct = CTestDialNewCallAct::NewLC(this, iTelephony);	
       
   139 	
       
   140 	// Create a call - should succeed
       
   141 	testCallParams.iCallId = CTelephony::EISVMaxNumOfCalls;
       
   142 	testDialNewCallAct->TestDialNewCall(testCallParams);
       
   143 	CActiveScheduler::Start();
       
   144 		
       
   145 	//get line status from GetLineStatus API
       
   146 	err = iTelephony->GetLineStatus(testCallParams.iLine, *statusV1Data);
       
   147 	TEST1(err == KErrNone, ETrue);
       
   148 	TEST1(statusV1Results.iStatus==CTelephony::EStatusConnected, ETrue);	
       
   149 	
       
   150 	//put call on hold
       
   151 	CTestHoldAct* TestHoldAct = CTestHoldAct::NewLC(this, iTelephony);
       
   152 	testCallParams.iExpStat=KErrNone;
       
   153 	TestHoldAct->TestHold(testCallParams);
       
   154 	CActiveScheduler::Start();
       
   155 	CleanupStack::PopAndDestroy(TestHoldAct);//TestHoldAct
       
   156 	
       
   157 	//get line status from GetLineStatus API
       
   158 	err = iTelephony->GetLineStatus(testCallParams.iLine, *statusV1Data);
       
   159 	TEST1(err == KErrNone, ETrue);
       
   160 	TEST1(statusV1Results.iStatus==CTelephony::EStatusHold, ETrue);	
       
   161 	
       
   162 	//resume the call
       
   163 	CTestResumeAct* testResumeAct = CTestResumeAct::NewLC(this, iTelephony);
       
   164 	testCallParams.iExpStat=KErrNone;
       
   165 	testResumeAct->TestResume(testCallParams);
       
   166 	CActiveScheduler::Start();
       
   167 	CleanupStack::PopAndDestroy(testResumeAct);//testResumeAct
       
   168 	
       
   169 	//get line status from GetLineStatus API
       
   170 	err = iTelephony->GetLineStatus(testCallParams.iLine, *statusV1Data);
       
   171 	TEST1(err == KErrNone, ETrue);
       
   172 	TEST1(statusV1Results.iStatus==CTelephony::EStatusConnected, ETrue);	
       
   173 	
       
   174 	// Create an activeHangupAct object
       
   175 	CTestHangupAct* testHangupAct = CTestHangupAct::NewLC(this, iTelephony);	
       
   176 	
       
   177 	//Hangup call1
       
   178 	testHangupAct->TestHangup(testCallParams);
       
   179 	CActiveScheduler::Start();
       
   180 	
       
   181 	err = iTelephony->GetLineStatus(testCallParams.iLine, *statusV1Data);
       
   182 	TEST1(err == KErrNone, ETrue);
       
   183 	TEST1(statusV1Results.iStatus==CTelephony::EStatusIdle, ETrue);	
       
   184 
       
   185 	CleanupStack::PopAndDestroy(testHangupAct);//testHangupAct
       
   186 	CleanupStack::PopAndDestroy(testDialNewCallAct);//testDialNewCallAct
       
   187 
       
   188 	return TestStepResult();
       
   189 	}
       
   190 	
       
   191 CTestGetCallInfo::CTestGetCallInfo()
       
   192 /** Each test step initialises it's own name
       
   193 */
       
   194 	{
       
   195 	// store the name of this test case
       
   196 	// this is the name that is used by the script file
       
   197 	SetTestStepName(_L("TestGetCallInfo"));
       
   198 	}
       
   199 
       
   200 /**
       
   201 *
       
   202 @SYMTestCaseID Etel3rdParty 23.1, TestGetCallInfo
       
   203 @SYMTestCaseDesc Test GetCallInfo 3rd party API
       
   204 @SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.3.4, REQ 2116.3.9
       
   205 */ 
       
   206 
       
   207 enum TVerdict CTestGetCallInfo::doTestStepL()
       
   208 	{
       
   209 /**
       
   210 This step tests the CTelephony::GetCallInfo() API
       
   211 */
       
   212 	INFO_PRINTF1(_L("Test retrieving of the mobile call status"));
       
   213 	_LIT(KGoodNumber,"1789");
       
   214 	
       
   215 	SetTestNumber(15); 
       
   216 	
       
   217 	//Set the call parameters for MO call
       
   218 	CTelephony::TCallParamsV1 callParams;
       
   219 	callParams.iIdRestrict = CTelephony::ESendMyId;
       
   220 	CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);	
       
   221 	
       
   222 	TTestCallParams testCallParams;
       
   223 	testCallParams.iLine = CTelephony::EVoiceLine;
       
   224 	testCallParams.iCallParamsV1Pckg = &callParamsPckg;
       
   225 	testCallParams.iTelAddress.iTelNumber = KGoodNumber;
       
   226 	testCallParams.iExpStat = KErrNone;
       
   227 	
       
   228 	//test GetCallInfo with no active call
       
   229 	
       
   230 	CTelephony::TCallInfoV1 callInfoV1;
       
   231 	CTelephony::TCallInfoV1 expCallInfoV1;
       
   232 	CTelephony::TCallInfoV1Pckg callInfoV1Pckg(callInfoV1);
       
   233 	CTelephony::TRemotePartyInfoV1 remoteInfoV1;
       
   234 	CTelephony::TRemotePartyInfoV1 expRemoteInfoV1;
       
   235 	CTelephony::TRemotePartyInfoV1Pckg remoteInfoV1Pckg(remoteInfoV1);
       
   236 	
       
   237 	CTelephony::TCallSelectionV1 callSelection;
       
   238 	CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg(callSelection);
       
   239 	callSelection.iSelect = CTelephony::EActiveCall;
       
   240 	callSelection.iLine = CTelephony::EVoiceLine;
       
   241 	
       
   242 	// set up local data references
       
   243 	TDes8* callInfoV1Data;
       
   244 	TDes8* remoteInfoV1Data;
       
   245 	TDes8* callSelectionV1Data;
       
   246 	
       
   247 	if (iBufferMode)
       
   248 		{
       
   249 		// initialize required buffers
       
   250 		iCallSelectionV1Buff = callSelection;
       
   251 	    
       
   252 		//initialize data pointers
       
   253 		callInfoV1Data = &iCallInfoV1Buff;
       
   254 		remoteInfoV1Data = &iRemoteInfoV1Buff;
       
   255 		callSelectionV1Data = &iCallSelectionV1Buff;
       
   256 		}
       
   257 	else
       
   258 		{
       
   259 		callInfoV1Data = &callInfoV1Pckg;
       
   260 		remoteInfoV1Data = &remoteInfoV1Pckg;
       
   261 		callSelectionV1Data = &callSelectionV1Pckg;
       
   262 		}
       
   263 	
       
   264 	CTelephony::TCallInfoV1& callInfoV1Results = reinterpret_cast<CTelephony::TCallInfoV1&> 
       
   265 													( const_cast<TUint8&> ( *callInfoV1Data->Ptr() ) );
       
   266 	CTelephony::TRemotePartyInfoV1& remoteInfoV1Results = reinterpret_cast<CTelephony::TRemotePartyInfoV1&> 
       
   267 													( const_cast<TUint8&> ( *remoteInfoV1Data->Ptr() ) );
       
   268 	
       
   269 	TInt err;
       
   270 	#if defined(_DEBUG)
       
   271 	//
       
   272 	//TEST 1: OOM
       
   273 	//
       
   274 
       
   275 		__UHEAP_FAILNEXT(3);
       
   276 		err = iTelephony->GetCallInfo(callSelectionV1Pckg, callInfoV1Pckg, remoteInfoV1Pckg);
       
   277 		TEST1(err==KErrNoMemory, ETrue);
       
   278 		__UHEAP_RESET;
       
   279 	#endif
       
   280 
       
   281 	//
       
   282 	//TEST 2: GetCallInfo with no active call
       
   283 	//	
       
   284 	err = iTelephony->GetCallInfo(*callSelectionV1Data, *callInfoV1Data, *remoteInfoV1Data);
       
   285 	TEST1(err==KErrNotFound, ETrue);
       
   286 	
       
   287 	//
       
   288 	//TEST 2: GetCallInfo for a single MO call that is put on held and resumed
       
   289 	//	      This tests EActiveCall and EHeldCall
       
   290 	//
       
   291 	
       
   292 	// Create active DialNewCallAct object and Hangup object
       
   293 	CTestDialNewCallAct* testDialNewCallAct = CTestDialNewCallAct::NewLC(this, iTelephony);	
       
   294 	
       
   295 	// Create a call - should succeed
       
   296 	testCallParams.iCallId = CTelephony::EISVMaxNumOfCalls;
       
   297 	testDialNewCallAct->TestDialNewCall(testCallParams);
       
   298 	CActiveScheduler::Start();
       
   299 	CleanupStack::PopAndDestroy(testDialNewCallAct);
       
   300 	
       
   301 	CTelephony::TCallStatusV1 status;
       
   302 	CTelephony::TCallStatusV1Pckg statusPckg(status);		
       
   303 	iTelephony->GetCallStatus(testCallParams.iCallId,  statusPckg);	
       
   304 	TEST1(status.iStatus == CTelephony::EStatusConnected, ETrue);
       
   305 	
       
   306 	expCallInfoV1.iStatus = CTelephony::EStatusConnected;
       
   307 	expCallInfoV1.iCallId = CTelephony::EISVCall1;
       
   308 	expCallInfoV1.iDuration = 0;
       
   309 	expCallInfoV1.iExitCode = 0;
       
   310 	expCallInfoV1.iSecurity = CTelephony::ECipheringOff;
       
   311 	expCallInfoV1.iDialledParty.iTypeOfNumber = CTelephony::EUnknownNumber;
       
   312 	expCallInfoV1.iDialledParty.iNumberPlan = CTelephony::EUnknownNumberingPlan;
       
   313 	
       
   314 	expRemoteInfoV1.iRemoteIdStatus = CTelephony::ERemoteIdentityUnknown;
       
   315 	expRemoteInfoV1.iDirection = CTelephony::EDirectionUnknown;
       
   316 	expRemoteInfoV1.iRemoteNumber.iTypeOfNumber = CTelephony::EUnknownNumber;
       
   317 	expRemoteInfoV1.iRemoteNumber.iNumberPlan = CTelephony::EUnknownNumberingPlan;
       
   318 	
       
   319 	//check status of active call
       
   320 	callSelection.iSelect = CTelephony::EActiveCall;
       
   321 	if (iBufferMode)
       
   322 		{
       
   323 		iCallSelectionV1Buff = callSelection;
       
   324 		}
       
   325 	    
       
   326 	err = iTelephony->GetCallInfo(*callSelectionV1Data, *callInfoV1Data, *remoteInfoV1Data);
       
   327 	TEST1(err==KErrNone, ETrue);
       
   328 	if(err == KErrNone)
       
   329 		{
       
   330 		CNotifyLineStatusBaseAct::PrintGetCallInfo(this, CTelephony::EActiveCall, callInfoV1Results, remoteInfoV1Results);
       
   331 		TestResults(callInfoV1Results, expCallInfoV1, remoteInfoV1Results, expRemoteInfoV1);
       
   332 		}
       
   333 		
       
   334 	//check status of held call - should fail
       
   335 	callSelection.iSelect = CTelephony::EHeldCall;
       
   336 	if (iBufferMode)
       
   337 		{
       
   338 		iCallSelectionV1Buff = callSelection;
       
   339 		}
       
   340 	err = iTelephony->GetCallInfo(*callSelectionV1Data, *callInfoV1Data, *remoteInfoV1Data);
       
   341 	TEST1(err==KErrNotFound, ETrue);
       
   342 	
       
   343 	//check status of in-progress call - should fail
       
   344 	callSelection.iSelect = CTelephony::EInProgressCall;
       
   345 	if (iBufferMode)
       
   346 		{
       
   347 		iCallSelectionV1Buff = callSelection;
       
   348 		}	
       
   349 	err = iTelephony->GetCallInfo(*callSelectionV1Data, *callInfoV1Data, *remoteInfoV1Data);
       
   350 	TEST1(err==KErrNotFound, ETrue);
       
   351 	
       
   352 	//put call on hold
       
   353 	CTestHoldAct* TestHoldAct = CTestHoldAct::NewLC(this, iTelephony);
       
   354 	testCallParams.iExpStat=KErrNone;
       
   355 	TestHoldAct->TestHold(testCallParams);
       
   356 	CActiveScheduler::Start();
       
   357 	CleanupStack::PopAndDestroy(TestHoldAct);//TestHoldAct
       
   358 	
       
   359 	//check status of held call 
       
   360 	callSelection.iSelect = CTelephony::EHeldCall;
       
   361 	if (iBufferMode)
       
   362 		{
       
   363 		iCallSelectionV1Buff = callSelection;
       
   364 		}
       
   365 	expCallInfoV1.iStatus = CTelephony::EStatusHold;
       
   366 	err = iTelephony->GetCallInfo(*callSelectionV1Data, *callInfoV1Data, *remoteInfoV1Data);
       
   367 	TEST1(err==KErrNone, ETrue);
       
   368 	if(err == KErrNone)
       
   369 		{
       
   370 		CNotifyLineStatusBaseAct::PrintGetCallInfo(this, CTelephony::EHeldCall, callInfoV1Results, remoteInfoV1Results);
       
   371 		TestResults(callInfoV1Results, expCallInfoV1, remoteInfoV1Results, expRemoteInfoV1);
       
   372 		}
       
   373 
       
   374 	//Hangup call1
       
   375 	CTestHangupAct* testHangupAct = CTestHangupAct::NewLC(this, iTelephony);	
       
   376 	testCallParams.iExpStat = KErrNone;
       
   377 	testHangupAct->TestHangup(testCallParams);
       
   378 	CActiveScheduler::Start();
       
   379 	CleanupStack::PopAndDestroy(testHangupAct);
       
   380 	
       
   381 	//
       
   382 	//TEST 3: Create a single MO call and each time a line state change notification is received call
       
   383 	//	      GetCallInfo. This tests EInProgressCall
       
   384 	//
       
   385 	//test call info for MO calls
       
   386 	CNotifyLineStatusMOAct* testGetCallInfoMOAct = CNotifyLineStatusMOAct::NewLC(this, iTelephony);	
       
   387 	testGetCallInfoMOAct->StartTestL(testCallParams, CNotifyLineStatusBaseAct::EGetCallInfo);
       
   388 	CActiveScheduler::Start();
       
   389 	CleanupStack::PopAndDestroy(); //testGetCallInfoMOAct
       
   390 
       
   391 	return TestStepResult();
       
   392 	}
       
   393 	
       
   394 void CTestGetCallInfo::TestResults(CTelephony::TCallInfoV1& aActualCallInfo, CTelephony::TCallInfoV1& aExpCallInfo, CTelephony::TRemotePartyInfoV1& aActualRemotePartyInfo,  CTelephony::TRemotePartyInfoV1& aExpRemotePartyInfo)
       
   395 	{
       
   396 	TEST1(aActualCallInfo.iStatus == aExpCallInfo.iStatus, ETrue);
       
   397 	TEST1(aActualCallInfo.iDialledParty.iTypeOfNumber == aExpCallInfo.iDialledParty.iTypeOfNumber, ETrue);
       
   398 	TEST1(aActualCallInfo.iDialledParty.iNumberPlan == aExpCallInfo.iDialledParty.iNumberPlan, ETrue);
       
   399 	TEST1(aActualCallInfo.iDialledParty.iTelNumber == aExpCallInfo.iDialledParty.iTelNumber, ETrue);
       
   400 	TEST1(aActualCallInfo.iDuration == aExpCallInfo.iDuration, ETrue);
       
   401 	TEST1(aActualCallInfo.iExitCode == aExpCallInfo.iExitCode, ETrue);
       
   402 	TEST1(aActualCallInfo.iSecurity == aExpCallInfo.iSecurity, ETrue);
       
   403 	TEST1(aActualCallInfo.iCallId == aExpCallInfo.iCallId, ETrue);
       
   404 	
       
   405 	TEST1(aActualRemotePartyInfo.iRemoteIdStatus == aExpRemotePartyInfo.iRemoteIdStatus, ETrue);
       
   406 	TEST1(aActualRemotePartyInfo.iCallingName == aExpRemotePartyInfo.iCallingName, ETrue);
       
   407 	TEST1(aActualRemotePartyInfo.iDirection == aExpRemotePartyInfo.iDirection, ETrue);
       
   408 	TEST1(aActualRemotePartyInfo.iRemoteNumber.iTypeOfNumber == aExpRemotePartyInfo.iRemoteNumber.iTypeOfNumber, ETrue);
       
   409 	TEST1(aActualRemotePartyInfo.iRemoteNumber.iNumberPlan == aExpRemotePartyInfo.iRemoteNumber.iNumberPlan, ETrue);
       
   410 	TEST1(aActualRemotePartyInfo.iRemoteNumber.iTelNumber == aExpRemotePartyInfo.iRemoteNumber.iTelNumber, ETrue);	
       
   411 	}
       
   412 	
       
   413  
       
   414 
       
   415 //
       
   416 //AO classes used by test steps above
       
   417 //
       
   418 
       
   419 
       
   420 CNotifyLineStatusBaseAct::CNotifyLineStatusBaseAct(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
       
   421  	: CEtelIsvActBase(aTestStep, aTelephony)
       
   422    	, iCallStatusV1Pckg(iCallStatusV1)
       
   423    	, iFinish(EFalse)
       
   424     {
       
   425     }
       
   426     
       
   427  
       
   428     
       
   429 void CNotifyLineStatusBaseAct::PrintGetCallInfo(CEtelIsvTestStep* aTestStep, CTelephony::TCallSelect aCallSelect, CTelephony::TCallInfoV1& aCallInfoV1, CTelephony::TRemotePartyInfoV1& aRemoteInfoV1)
       
   430 /**
       
   431 Print out results for GetCallInfo
       
   432 */
       
   433 	{
       
   434 	TBuf<150> strBuf;
       
   435 	
       
   436 	if(aCallSelect == CTelephony::EActiveCall)
       
   437 		strBuf = _L("EActiveCall");
       
   438 	else if(aCallSelect == CTelephony::EHeldCall)
       
   439 		strBuf = _L("EHeldCall");
       
   440 	else // CTelephony::EInProgressCall
       
   441 		strBuf = _L("EInProgressCall");
       
   442 	aTestStep->INFO_PRINTF2(_L("For %S GetCallInfo paramters are..."), &strBuf );
       
   443 	
       
   444 	//TCallInfoV1
       
   445 	strBuf=_L("GetCallInfo TCallInfoV1::iStatus=");
       
   446 	PrintLineStatus(aTestStep, strBuf, aCallInfoV1.iStatus); 
       
   447 	aTestStep->INFO_PRINTF2(_L("GetCallInfo TCallInfoV1::iDuration=%d "), aCallInfoV1.iDuration.Int() );
       
   448 	aTestStep->INFO_PRINTF2(_L("GetCallInfo TCallInfoV1::iExitCode=%d "), aCallInfoV1.iExitCode );
       
   449 	
       
   450 	switch(aCallInfoV1.iSecurity)
       
   451 		{
       
   452 	case CTelephony::ECipheringOff:
       
   453 		strBuf = _L("ECipheringOff");
       
   454 		break;
       
   455 	case CTelephony::ECipheringGSM:
       
   456 		strBuf = _L("ECipheringGSM");
       
   457 		break;
       
   458 	case CTelephony::ECipheringWCDMA:
       
   459 		strBuf = _L("ECipheringWCDMA");
       
   460 		break;
       
   461 	default:
       
   462 		strBuf = _L("UNKNOWN");
       
   463 		break;
       
   464 	
       
   465 		};
       
   466 	aTestStep->INFO_PRINTF2(_L("GetCallInfo TCallInfoV1::iSecurity=%S "), &strBuf );
       
   467 	aTestStep->INFO_PRINTF2(_L("GetCallInfo TCallInfoV1::iCallId=%d "), aCallInfoV1.iCallId );
       
   468 	
       
   469 	switch(aRemoteInfoV1.iRemoteIdStatus)
       
   470 		{
       
   471 	case CTelephony::ERemoteIdentityUnknown:
       
   472 		strBuf = _L("ERemoteIdentityUnknown");
       
   473 		break;
       
   474 	case CTelephony::ERemoteIdentityAvailable:
       
   475 		strBuf = _L("ERemoteIdentityAvailable");
       
   476 		break;
       
   477 	case CTelephony::ERemoteIdentitySuppressed:
       
   478 		strBuf = _L("ERemoteIdentitySuppressed");
       
   479 		break;
       
   480 	default:
       
   481 		strBuf = _L("UNKNOWN");
       
   482 		break;
       
   483 		};
       
   484 	aTestStep->INFO_PRINTF2(_L("GetCallInfo TRemotePartyInfoV1::iRemoteIdStatus=%S "), &strBuf );
       
   485 	aTestStep->INFO_PRINTF2(_L("GetCallInfo TRemotePartyInfoV1::iCallingName=%S "), &aRemoteInfoV1.iCallingName );
       
   486 	
       
   487 	switch( aRemoteInfoV1.iDirection)
       
   488 		{
       
   489 	case CTelephony::EDirectionUnknown:
       
   490 		strBuf = _L("EDirectionUnknown");
       
   491 		break;
       
   492 	case CTelephony::EMobileOriginated:
       
   493 		strBuf = _L("EMobileOriginated");
       
   494 		break;
       
   495 	case CTelephony::EMobileTerminated:
       
   496 		strBuf = _L("EMobileTerminated");
       
   497 		break;
       
   498 	default:
       
   499 		strBuf = _L("UNKNOWN");
       
   500 		break;
       
   501 		};
       
   502 	aTestStep->INFO_PRINTF2(_L("GetCallInfo TRemotePartyInfoV1::iDirection=%S "), &strBuf );
       
   503 
       
   504 	}
       
   505 	
       
   506 void CNotifyLineStatusBaseAct::PrintLineStatus(CEtelIsvTestStep* aTestStep, TDes& aLine, const CTelephony::TCallStatus aStatus) 
       
   507 /**
       
   508 Print out line status
       
   509 */
       
   510 	{	
       
   511 	switch(aStatus)
       
   512 		{
       
   513 	case CTelephony::EStatusUnknown:
       
   514 		aLine.Append(_L("EStatusUnknown"));
       
   515 		break;
       
   516 	case CTelephony::EStatusIdle:
       
   517 		aLine.Append(_L("EStatusIdle"));
       
   518 		break;
       
   519 	case CTelephony::EStatusDialling:
       
   520 		aLine.Append(_L("EStatusDialling"));
       
   521 		break;
       
   522 	case CTelephony::EStatusRinging:
       
   523 		aLine.Append(_L("EStaEStatusRinging"));
       
   524 		break;
       
   525 	case CTelephony::EStatusAnswering:
       
   526 		aLine.Append(_L("EStatusAnswering"));
       
   527 		break;
       
   528 	case CTelephony::EStatusConnecting:
       
   529 		aLine.Append(_L("EStatusConnecting"));
       
   530 		break;
       
   531 	case CTelephony::EStatusConnected:
       
   532 		aLine.Append(_L("EStatusConnected"));
       
   533 		break;
       
   534 	case CTelephony::EStatusReconnectPending:
       
   535 		aLine.Append(_L("EStatusReconnectPending"));
       
   536 		break;
       
   537 	case CTelephony::EStatusDisconnecting:
       
   538 		aLine.Append(_L("EStatusDisconnecting"));
       
   539 		break;
       
   540 	case CTelephony::EStatusHold:
       
   541 		aLine.Append(_L("EStatusHold"));
       
   542 		break;
       
   543 	case CTelephony::EStatusTransferring:
       
   544 		aLine.Append(_L("EStatusTransfering"));
       
   545 		break;
       
   546 	case CTelephony::EStatusTransferAlerting:
       
   547 		aLine.Append(_L("EStatusTransferAlerting"));
       
   548 		break;
       
   549 	default:
       
   550 		aLine.Append(_L("Unknown State"));
       
   551 		}
       
   552 	aTestStep->INFO_PRINTF2(_L("%S"), &aLine);
       
   553 	}
       
   554 	
       
   555 void CNotifyLineStatusBaseAct::CallGetCallInfo(const CTelephony::TCallSelect aSelect, CTelephony::TCallStatus aExpStatus)
       
   556 /**
       
   557 Call the GetCallInfo function and print out results
       
   558 */
       
   559 	{
       
   560 	CTelephony::TCallInfoV1 callInfoV1;
       
   561 	CTelephony::TCallInfoV1Pckg callInfoV1Pckg(callInfoV1);
       
   562 	CTelephony::TRemotePartyInfoV1 remoteInfoV1;
       
   563 	CTelephony::TRemotePartyInfoV1Pckg remoteInfoV1Pckg(remoteInfoV1);
       
   564 	
       
   565 	CTelephony::TCallSelectionV1 callSelection;
       
   566 	CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg(callSelection);
       
   567 	callSelection.iSelect = aSelect;
       
   568 	callSelection.iLine = CTelephony::EVoiceLine;
       
   569 	
       
   570 	TInt err = iTelephony->GetCallInfo(callSelectionV1Pckg, callInfoV1Pckg, remoteInfoV1Pckg);
       
   571 	iTestStep->TEST1(err == KErrNone, ETrue);
       
   572 	iTestStep->TEST1(callInfoV1.iStatus == aExpStatus,ETrue);
       
   573 	PrintGetCallInfo(iTestStep, aSelect, callInfoV1, remoteInfoV1);
       
   574 	}
       
   575 
       
   576 /**
       
   577 Active Object to request a notifications of line status change and create an MO call.
       
   578 This AO is used to test two APIs GetLineStatus() and GetCallInfo().
       
   579 **/
       
   580 CNotifyLineStatusMOAct* CNotifyLineStatusMOAct::NewLC(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
       
   581 //Factory constructor
       
   582 	{
       
   583 	CNotifyLineStatusMOAct* obj = new(ELeave) CNotifyLineStatusMOAct(aTestStep, aTelephony);
       
   584 	CleanupStack::PushL(obj);
       
   585 	obj->ConstructL();
       
   586 	return obj;
       
   587 	}
       
   588 	
       
   589 CNotifyLineStatusMOAct::CNotifyLineStatusMOAct(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
       
   590 	: CNotifyLineStatusBaseAct(aTestStep, aTelephony)
       
   591    	{  
       
   592 	}
       
   593 
       
   594 void CNotifyLineStatusMOAct::ConstructL()
       
   595 	{    
       
   596 	iCanceller = new(ELeave) CTestCanceller(this);
       
   597 	CActiveScheduler::Add(this);
       
   598 	}
       
   599 
       
   600 CNotifyLineStatusMOAct::~CNotifyLineStatusMOAct()
       
   601 	{  
       
   602 	delete iDialNewCallAct;
       
   603 	delete iHangupAct;
       
   604 	Cancel();	// if any Req outstanding, calls DoCancel() to cleanup.
       
   605 	delete iCanceller;
       
   606 	}
       
   607 
       
   608 void CNotifyLineStatusMOAct::DoCancel()
       
   609 	{
       
   610 	iTelephony->CancelAsync(CTelephony::EVoiceLineStatusChangeCancel);
       
   611 	}
       
   612 
       
   613 void CNotifyLineStatusMOAct::StartTestL(TTestCallParams& aTestCallParams, TTestToRun aTestToRun)
       
   614 /**
       
   615 Start the test
       
   616 */ 
       
   617 	{
       
   618 	iTestStep-> INFO_PRINTF1(_L("CNotifyLineStatusMOAct::StartTest() Start"));
       
   619  	iTestCallParams = &aTestCallParams;
       
   620  	// Update the expected return value.
       
   621 	iExpStat=aTestCallParams.iExpStat;
       
   622 	iTestToRun = aTestToRun;
       
   623  	
       
   624  	//start the notify request for Line Status Change
       
   625 	iEvent = CTelephony::EVoiceLineStatusChange;
       
   626  		
       
   627 	//set notification request going
       
   628  	iTelephony->NotifyChange(iStatus, iEvent, iCallStatusV1Pckg);	
       
   629 	SetActive(); 
       
   630 	
       
   631 	//now initiate a call
       
   632 	if(iDialNewCallAct)
       
   633 		{
       
   634 		delete iDialNewCallAct;
       
   635 		iDialNewCallAct = NULL;
       
   636 		}
       
   637 	//create dial AO
       
   638 	iDialNewCallAct = CTestDialNewCallAct::NewL(iTestStep, iTelephony, this);	
       
   639 	//create hangup AO
       
   640 	if(iHangupAct)
       
   641 		{
       
   642 		delete iHangupAct;
       
   643 		iHangupAct = NULL;
       
   644 		}
       
   645 	iHangupAct = CTestHangupAct::NewL(iTestStep, iTelephony, this);	
       
   646 	
       
   647 	//dial
       
   648 	iDialNewCallAct->TestDialNewCall(*iTestCallParams);	
       
   649 	}
       
   650 	
       
   651 void  CNotifyLineStatusMOAct::ActionParent(const TRequestStatus aCallStatus, const TActionEvent aEvent)
       
   652 	{
       
   653 /**
       
   654 Gets called from a child AO when its RunL has been called.  
       
   655 */
       
   656 	//got callback from child AO. Proceed the test.
       
   657 	if(aCallStatus.Int() == KErrNone)
       
   658 		{
       
   659 		if(aEvent == EDialNewCall)	//new call has been successfully made.  So hangup
       
   660 			{
       
   661 			iHangupAct->TestHangup(*iTestCallParams);
       
   662 			return;
       
   663 			}
       
   664 		}		
       
   665 	//finish the test by cancelling the registered notification
       
   666 	DoCancel();	
       
   667 	iFinish = ETrue;
       
   668 	CActiveScheduler::Stop();
       
   669 	}
       
   670 	
       
   671 void CNotifyLineStatusMOAct::RunL()
       
   672 	{ 
       
   673 	// ActiveScheduler will have set status to KRequestComplete, just before
       
   674 	// calling this RunL().
       
   675 	iTestStep-> INFO_PRINTF1(_L(" CNotifyLineStatusMOAct::RunL "));
       
   676 	iTestStep->INFO_PRINTF2(_L("CNotifyLineStatusMOAct: Request Status returned is: %d"), iStatus.Int()   );
       
   677 	iTestStep->TEST1(iStatus.Int() == iExpStat.Int(), ETrue);
       
   678 	
       
   679 	if(iStatus.Int() == KErrNone)
       
   680 		{
       
   681 		TBuf<100> line=_L("CNotifyLineStatusMOAct: Line status from notification = ");
       
   682 		//line status from notification
       
   683 		PrintLineStatus(iTestStep, line, iCallStatusV1.iStatus);
       
   684 		
       
   685 		if(iTestToRun == EGetLineStatus)	//test GetLinStatus
       
   686 			{			
       
   687 			//line status from GetLineStatus API
       
   688 			CTelephony::TCallStatusV1 statusV1;
       
   689 			CTelephony::TCallStatusV1Pckg statusV1Pckg(statusV1);
       
   690 			TInt err = iTelephony->GetLineStatus(iTestCallParams->iLine, statusV1Pckg);
       
   691 			line=_L("CNotifyLineStatusMOAct: Line status from GetLineStatus = ");
       
   692 			iTestStep->TEST1(err == iTestCallParams->iExpAPIErr, ETrue);
       
   693 			PrintLineStatus(iTestStep, line, statusV1.iStatus);			
       
   694 			//These should match
       
   695 			iTestStep->TEST1(statusV1.iStatus == iCallStatusV1.iStatus, ETrue);							
       
   696 			}
       
   697 		else	//test GetCallInfo
       
   698 			{
       
   699 			//call GetCallInfo API for each call select notification that is call in progress.
       
   700 			if(iCallStatusV1.iStatus != CTelephony::EStatusConnected && iCallStatusV1.iStatus != CTelephony::EStatusIdle)
       
   701 				CallGetCallInfo(CTelephony::EInProgressCall, iCallStatusV1.iStatus);
       
   702 			}		
       
   703 		}
       
   704 	else
       
   705 		{
       
   706 		iTestStep->INFO_PRINTF2(_L("CNotifyLineStatusMOAct: Error for notify ELineStatusChange: %d"), iStatus.Int() );
       
   707 		}
       
   708 	//if true finish the test.
       
   709 	if(iFinish)
       
   710 		CActiveScheduler::Stop();
       
   711 	else
       
   712 		{
       
   713 		iTelephony->NotifyChange(iStatus, iEvent, iCallStatusV1Pckg);	
       
   714 		SetActive();
       
   715 		}
       
   716 	}	
       
   717 	
       
   718 /**
       
   719 Active Object to request a notifications of line status change and answer a MT call.
       
   720 This AO is used to test two APIs GetLineStatus() and GetCallInfo().
       
   721 **/
       
   722 CNotifyLineStatusMTAct* CNotifyLineStatusMTAct::NewLC(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony, TInt& aCallCount)
       
   723 //Factory constructor
       
   724 	{
       
   725 	CNotifyLineStatusMTAct* obj = new(ELeave) CNotifyLineStatusMTAct(aTestStep, aTelephony, aCallCount);
       
   726 	CleanupStack::PushL(obj);
       
   727 	obj->ConstructL();
       
   728 	return obj;
       
   729 	}
       
   730 	
       
   731 CNotifyLineStatusMTAct::CNotifyLineStatusMTAct(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony, TInt& aCallCount)
       
   732 	: CNotifyLineStatusBaseAct(aTestStep, aTelephony)
       
   733 	, iCallCount(aCallCount)
       
   734    	{  
       
   735 	}
       
   736 
       
   737 void CNotifyLineStatusMTAct::ConstructL()
       
   738 	{    
       
   739 	iCanceller = new(ELeave) CTestCanceller(this);
       
   740 	CActiveScheduler::Add(this);
       
   741 	}
       
   742 
       
   743 CNotifyLineStatusMTAct::~CNotifyLineStatusMTAct()
       
   744 	{  
       
   745 	delete iAnswerIncomingCallAct;
       
   746 	delete iHangupAct;
       
   747 	Cancel();	// if any Req outstanding, calls DoCancel() to cleanup.
       
   748 	delete iCanceller;
       
   749 	}
       
   750 
       
   751 void CNotifyLineStatusMTAct::DoCancel()
       
   752 	{
       
   753 	iTelephony->CancelAsync(CTelephony::EVoiceLineStatusChangeCancel);
       
   754 	}
       
   755 	
       
   756 void CNotifyLineStatusMTAct::StartTestL(TTestCallParams& aTestCallParams, TTestToRun aTestToRun) 
       
   757 /**
       
   758 Start the test
       
   759 */
       
   760 	{
       
   761 	iTestStep->INFO_PRINTF1(_L("CNotifyLineStatusMTAct::StartTest() Start"));
       
   762  	iTestCallParams = &aTestCallParams;
       
   763  	// Update the expected return value.
       
   764 	iExpStat=aTestCallParams.iExpStat;
       
   765 	iTestToRun = aTestToRun;
       
   766  	
       
   767  	//start the notify request for Line Status Change
       
   768 	iEvent = CTelephony::EVoiceLineStatusChange;
       
   769  		
       
   770 	//set notification request going
       
   771 	iTelephony->NotifyChange(iStatus, iEvent, iCallStatusV1Pckg);	
       
   772 	SetActive(); 
       
   773 	
       
   774 	//get SIMTSY to call us
       
   775 	CallMe(iCallCount);
       
   776 	
       
   777 	//now set up AO to wait for a call
       
   778 	if(iAnswerIncomingCallAct)
       
   779 		{
       
   780 		delete iAnswerIncomingCallAct;
       
   781 		iAnswerIncomingCallAct = NULL;
       
   782 		}
       
   783 	//create dial AO
       
   784 	iAnswerIncomingCallAct = CTestAnswerIncomingCallAct::NewL(iTestStep, iTelephony, this);	
       
   785 	//create hangup AO
       
   786 	if(iHangupAct)
       
   787 		{
       
   788 		delete iHangupAct;
       
   789 		iHangupAct = NULL;
       
   790 		}
       
   791 	iHangupAct = CTestHangupAct::NewL(iTestStep, iTelephony, this);		
       
   792 	}
       
   793 	
       
   794 void  CNotifyLineStatusMTAct::ActionParent(const TRequestStatus aCallStatus, const TActionEvent aEvent)
       
   795 	{
       
   796 /**
       
   797 Gets called from a child AO when its RunL has been called. 
       
   798 */
       
   799 	//got callback from child AO. Proceed the test.
       
   800 	if(aCallStatus.Int() == KErrNone)
       
   801 		{
       
   802 		if(aEvent == EAnswerIncomingCall)	//new call has been successfully made.  So hangup
       
   803 			{
       
   804 			iHangupAct->TestHangup(*iTestCallParams);
       
   805 			return;
       
   806 			}
       
   807 		}		
       
   808 	//finish the test by cancelling the registered notification
       
   809 	DoCancel();	
       
   810 	iFinish = ETrue;
       
   811 	CActiveScheduler::Stop();
       
   812 	}
       
   813 	
       
   814 void CNotifyLineStatusMTAct::RunL()
       
   815 	{ 
       
   816 	// ActiveScheduler will have set status to KRequestComplete, just before
       
   817 	// calling this RunL().
       
   818 	iTestStep-> INFO_PRINTF1(_L("CNotifyLineStatusMTAct::RunL "));
       
   819 	iTestStep->INFO_PRINTF2(_L("CNotifyLineStatusMTAct: Request Status returned is: %d"), iStatus.Int()   );
       
   820 	iTestStep->TEST1(iStatus.Int() == iExpStat.Int(), ETrue);
       
   821 	
       
   822 	if(iStatus.Int() == KErrNone)
       
   823 		{
       
   824 		TBuf<100> line=_L("CNotifyLineStatusMTAct: Line status from notification = ");
       
   825 		//line status from notification
       
   826 		PrintLineStatus(iTestStep, line, iCallStatusV1.iStatus);
       
   827 		
       
   828 		if(iTestToRun == EGetLineStatus)	//test GetLinStatus
       
   829 			{			
       
   830 			//line status from GetLineStatus API
       
   831 			CTelephony::TCallStatusV1 statusV1;
       
   832 			CTelephony::TCallStatusV1Pckg statusV1Pckg(statusV1);
       
   833 			TInt err = iTelephony->GetLineStatus(iTestCallParams->iLine, statusV1Pckg);
       
   834 			line=_L("CNotifyLineStatusMTAct: Line status from GetLineStatus = ");
       
   835 			iTestStep->TEST1(err == iTestCallParams->iExpAPIErr, ETrue);
       
   836 			PrintLineStatus(iTestStep, line, statusV1.iStatus);			
       
   837 			//These should match
       
   838 			iTestStep->TEST1(statusV1.iStatus == iCallStatusV1.iStatus, ETrue);							
       
   839 			}	
       
   840 		}
       
   841 	else
       
   842 		{
       
   843 		iTestStep->INFO_PRINTF2(_L("CNotifyLineStatusMTAct: Error for notify ELineStatusChange: %d"), iStatus.Int() );
       
   844 		}
       
   845 	
       
   846 	if(iTestToRun == EGetLineStatus && iCallStatusV1.iStatus == CTelephony::EStatusRinging)
       
   847 		{
       
   848 		//answer the call call
       
   849 		iAnswerIncomingCallAct->TestAnswerIncomingCall(*iTestCallParams);	
       
   850 		}
       
   851 		
       
   852 	//if true finish the test.
       
   853 	if(iFinish)
       
   854 		{
       
   855 		CActiveScheduler::Stop();
       
   856 		}
       
   857 	else
       
   858 		{
       
   859 		iTelephony->NotifyChange(iStatus, iEvent, iCallStatusV1Pckg);
       
   860 		SetActive();
       
   861 		}
       
   862 	}
       
   863 
       
   864 /**
       
   865 Each test step initialises it's own name
       
   866 */
       
   867 CTestLineFuncFlightModeOnWithPublishSubscribe::CTestLineFuncFlightModeOnWithPublishSubscribe()
       
   868 	{
       
   869 	// store the name of this test case
       
   870 	// this is the name that is used by the script file
       
   871 	SetTestStepName(_L("TestLineFuncFlightModeOnWithPublishSubscribe"));
       
   872 	}
       
   873 
       
   874 /**
       
   875 @SYMTestCaseID Etel3rdParty 25,1, TestLineFuncFlightModeOn
       
   876 @SYMTestCaseDesc Test GetLineStatus, GetCallInfo 3rd party APIs
       
   877 @SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.2.2, 2116.3.4, 2116.3.9
       
   878 */
       
   879 enum TVerdict CTestLineFuncFlightModeOnWithPublishSubscribe::doTestStepL()
       
   880 	{
       
   881 	INFO_PRINTF1(_L("START TEST 25.1"));	
       
   882 	 
       
   883 	INFO_PRINTF1(_L(" TEST: Signal Strength information not retrievable when flight mode on with publish and subscribe "));
       
   884 
       
   885 	//Set test number
       
   886 	SetTestNumber(15);
       
   887 	
       
   888 	
       
   889 	//Set the call parameters for MO call
       
   890 	_LIT(KGoodNumber,"1789");
       
   891 	
       
   892 	CTelephony::TCallParamsV1 callParams;
       
   893 	callParams.iIdRestrict = CTelephony::ESendMyId;
       
   894 	CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);	
       
   895 	
       
   896 	TTestCallParams testCallParams;
       
   897 	testCallParams.iLine = CTelephony::EVoiceLine;
       
   898 	testCallParams.iCallParamsV1Pckg = &callParamsPckg;
       
   899 	testCallParams.iTelAddress.iTelNumber = KGoodNumber;
       
   900 	testCallParams.iExpStat = KErrNone;
       
   901 	testCallParams.iExpAPIErr = KErrNone;
       
   902 	
       
   903 	CTelephony::TCallStatusV1 statusV1;
       
   904 	CTelephony::TCallStatusV1Pckg statusV1Pckg(statusV1);
       
   905 	 
       
   906 	// Set up phonePowerProperty variable so that flight mode can be manipulated.
       
   907 	RProperty phonePowerProperty;
       
   908 	User::LeaveIfError(phonePowerProperty.Attach(KUidSystemCategory, KUidPhonePwr.iUid));
       
   909 	CleanupClosePushL(phonePowerProperty);
       
   910  	
       
   911 	
       
   912 	//
       
   913 	//
       
   914 	// Test GetLineStatus with flight mode on.
       
   915 	//
       
   916 	//
       
   917 	
       
   918 	INFO_PRINTF1(_L("Test retrieval of the mobile line status - flight mode on"));
       
   919 	
       
   920 	// Create active DialNewCallAct objects
       
   921 	CTestDialNewCallAct* testDialNewCallAct = CTestDialNewCallAct::NewLC(this, iTelephony);	
       
   922 	
       
   923 	// Create a call - should succeed
       
   924 	testCallParams.iCallId = CTelephony::EISVMaxNumOfCalls;
       
   925 	testDialNewCallAct->TestDialNewCall(testCallParams);
       
   926 	CActiveScheduler::Start();
       
   927 
       
   928 
       
   929 	//Switch flight mode on (ie radio mode off)
       
   930 	TRequestStatus status;
       
   931 	phonePowerProperty.Subscribe(status);
       
   932 	User::LeaveIfError(phonePowerProperty.Set(KUidSystemCategory,KUidPhonePwr.iUid,ESAPhoneOff));
       
   933 	User::WaitForRequest(status);
       
   934 	TEST(status.Int() == KErrNone);
       
   935 
       
   936 	// Attempt to get line status from GetLineStatus API
       
   937 	// This should fail as flight mode is on.
       
   938 	//testCallParams.iExpStat = KErrAccessDenied;
       
   939 	TInt err = iTelephony->GetLineStatus(testCallParams.iLine, statusV1Pckg);
       
   940 	TEST1(err == KErrAccessDenied, ETrue);
       
   941 
       
   942 
       
   943 	//
       
   944 	//
       
   945 	// Test GetCallInfo with flight mode on.
       
   946 	//
       
   947 	//
       
   948 
       
   949 	INFO_PRINTF1(_L("Test retrieval of call info - flight mode on"));
       
   950 
       
   951 	CTelephony::TCallInfoV1 callInfoV1;
       
   952 	CTelephony::TCallInfoV1 expCallInfoV1;
       
   953 	CTelephony::TCallInfoV1Pckg callInfoV1Pckg(callInfoV1);
       
   954 	CTelephony::TRemotePartyInfoV1 remoteInfoV1;
       
   955 	CTelephony::TRemotePartyInfoV1 expRemoteInfoV1;
       
   956 	CTelephony::TRemotePartyInfoV1Pckg remoteInfoV1Pckg(remoteInfoV1);
       
   957 	
       
   958 	CTelephony::TCallSelectionV1 callSelection;
       
   959 	CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg(callSelection);
       
   960 	callSelection.iSelect = CTelephony::EActiveCall;
       
   961 	callSelection.iLine = CTelephony::EVoiceLine;
       
   962  	expCallInfoV1.iStatus = CTelephony::EStatusConnected;
       
   963 	expCallInfoV1.iCallId = CTelephony::EISVCall1;
       
   964 	expCallInfoV1.iDuration = 0;
       
   965 	expCallInfoV1.iExitCode = 0;
       
   966 	expCallInfoV1.iSecurity = CTelephony::ECipheringOff;
       
   967 	expCallInfoV1.iDialledParty.iTypeOfNumber = CTelephony::EUnknownNumber;
       
   968 	expCallInfoV1.iDialledParty.iNumberPlan = CTelephony::EUnknownNumberingPlan;
       
   969 	
       
   970 	expRemoteInfoV1.iRemoteIdStatus = CTelephony::ERemoteIdentityUnknown;
       
   971 	expRemoteInfoV1.iDirection = CTelephony::EDirectionUnknown;
       
   972 	expRemoteInfoV1.iRemoteNumber.iTypeOfNumber = CTelephony::EUnknownNumber;
       
   973 	expRemoteInfoV1.iRemoteNumber.iNumberPlan = CTelephony::EUnknownNumberingPlan;
       
   974 	
       
   975 	// attempt to get call info of active call
       
   976 	callSelection.iSelect = CTelephony::EActiveCall;
       
   977 	err = iTelephony->GetCallInfo(callSelectionV1Pckg, callInfoV1Pckg, remoteInfoV1Pckg);
       
   978 	TEST1(err==KErrAccessDenied, ETrue);
       
   979 
       
   980 
       
   981 	//
       
   982 	//
       
   983 	// Test GetCallStatus with flight mode on.
       
   984 	//
       
   985 	//
       
   986 
       
   987 	INFO_PRINTF1(_L("Test retrieval of call status - flight mode on"));
       
   988 
       
   989 	// Attempt to retrive the call status while flight mode is on.
       
   990 	err = iTelephony->GetCallStatus(testCallParams.iCallId,  statusV1Pckg);
       
   991 	TEST1(err==KErrAccessDenied, ETrue);
       
   992 
       
   993 	INFO_PRINTF1(_L("END TEST 25.1"));
       
   994 
       
   995 
       
   996 	CleanupStack::PopAndDestroy(testDialNewCallAct);
       
   997 	CleanupStack::PopAndDestroy(&phonePowerProperty);
       
   998 
       
   999 	return TestStepResult(); 
       
  1000 	}
       
  1001 
       
  1002 CTestGetLineStatusNoCaps::CTestGetLineStatusNoCaps(TInt& aCallCount)
       
  1003 /** Each test step initialises it's own name
       
  1004 */
       
  1005  	: iCallCount(aCallCount)
       
  1006  	{
       
  1007  	// store the name of this test case
       
  1008  	// this is the name that is used by the script file
       
  1009  	SetTestStepName(_L("TestGetLineStatusNoCaps"));
       
  1010  	}
       
  1011  	
       
  1012 enum TVerdict CTestGetLineStatusNoCaps::doTestStepL()
       
  1013 /**
       
  1014 Tests an incoming call can be detected when the client has no capabilities.
       
  1015  The test preamble constructs CTelephony::NewL() which makes a request
       
  1016  to RLine::NotifyIncomingCall.
       
  1017  The test step does the following:
       
  1018  1) Makes a request to be notified of a change to the line status
       
  1019  by calling RMobileLine::NotifyMobileLineStatusChange.
       
  1020  2) Triggers an incoming call
       
  1021  3) Validates that the client receives the line status change.
       
  1022  
       
  1023  The test does not directly check that RLine::NotifyIncomingCall completes
       
  1024  successfully. This is because CNotifyIncomingCallAc only notifies
       
  1025  CAnswerIncomingCallAct when an incoming call is received. However
       
  1026  CAnswerIncomingCallAct calls RMobileCall::AnswerIncomingCallISV() 
       
  1027  which needs Network Service capabilities. The fact that the test
       
  1028  completes is sufficient to prove that the RLine::NotifyIncomingCall does not
       
  1029  require NetworkServices - if it did, the CNotifyIncomingCallAc gets
       
  1030  locked in an infinite loop, causing the test to hang.
       
  1031  */
       
  1032  	{
       
  1033  	INFO_PRINTF1(_L("START TEST 1"));	
       
  1034   
       
  1035    	INFO_PRINTF1(_L("Test retrieving of the mobile line status"));
       
  1036  	_LIT(KGoodNumber,"1789");
       
  1037  	
       
  1038  	SetTestNumber(15); 
       
  1039  
       
  1040  	//Set the call parameters for MO call
       
  1041  	CTelephony::TCallParamsV1 callParams;
       
  1042  	callParams.iIdRestrict = CTelephony::ESendMyId;
       
  1043  	CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);	
       
  1044  	
       
  1045  	TTestCallParams testCallParams;
       
  1046  	testCallParams.iLine = CTelephony::EVoiceLine;
       
  1047  	testCallParams.iCallParamsV1Pckg = &callParamsPckg;
       
  1048  	testCallParams.iTelAddress.iTelNumber = KGoodNumber;
       
  1049  	testCallParams.iExpStat = KErrNone;
       
  1050  	testCallParams.iExpAPIErr = KErrNone;
       
  1051  
       
  1052  	//test line status for MT calls
       
  1053  	CNotifyLineStatusNoCapsMTAct* testGetLineStatusMTAct = CNotifyLineStatusNoCapsMTAct::NewLC(this, iTelephony, iCallCount);	
       
  1054  	testGetLineStatusMTAct->StartTestL(testCallParams, CNotifyLineStatusBaseAct::EGetLineStatus);
       
  1055  	 	CActiveScheduler::Start();
       
  1056  	CleanupStack::PopAndDestroy(); //testGetLineStatusMTAct	
       
  1057  
       
  1058  	return TestStepResult();
       
  1059  	}
       
  1060  
       
  1061  
       
  1062  void CNotifyLineStatusNoCapsMTAct::RunL()
       
  1063  	{ 
       
  1064  	// ActiveScheduler will have set status to KRequestComplete, just before
       
  1065  	// calling this RunL().
       
  1066  	iTestStep-> INFO_PRINTF1(_L("CNotifyLineStatusMTAct::RunL "));
       
  1067  	iTestStep->INFO_PRINTF2(_L("CNotifyLineStatusMTAct: Request Status returned is: %d"), iStatus.Int()   );
       
  1068  	iTestStep->TEST1(iStatus.Int() == iExpStat.Int(), ETrue);
       
  1069  	
       
  1070  	if(iStatus.Int() == KErrNone)
       
  1071  		{
       
  1072  		TBuf<100> line=_L("CNotifyLineStatusMTAct: Line status from notification = ");
       
  1073  		//line status from notification
       
  1074  		PrintLineStatus(iTestStep, line, iCallStatusV1.iStatus);
       
  1075  		
       
  1076  		if(iTestToRun == EGetLineStatus)	//test GetLinStatus
       
  1077  			{			
       
  1078  			//line status from GetLineStatus API
       
  1079  			CTelephony::TCallStatusV1 statusV1;
       
  1080  			CTelephony::TCallStatusV1Pckg statusV1Pckg(statusV1);
       
  1081  			TInt err = iTelephony->GetLineStatus(iTestCallParams->iLine, statusV1Pckg);
       
  1082  			line=_L("CNotifyLineStatusMTAct: Line status from GetLineStatus = ");
       
  1083  			iTestStep->TEST1(err == iTestCallParams->iExpAPIErr, ETrue);
       
  1084  			PrintLineStatus(iTestStep, line, statusV1.iStatus);			
       
  1085  			//These should match
       
  1086  			iTestStep->TEST1(statusV1.iStatus == iCallStatusV1.iStatus, ETrue);							
       
  1087  			}	
       
  1088  		}
       
  1089  	else
       
  1090  		{
       
  1091  		iTestStep->INFO_PRINTF2(_L("CNotifyLineStatusMTAct: Error for notify ELineStatusChange: %d"), iStatus.Int() );
       
  1092  		}
       
  1093  	
       
  1094  	CActiveScheduler::Stop();
       
  1095  	}
       
  1096  
       
  1097 
       
  1098  CNotifyLineStatusNoCapsMTAct* CNotifyLineStatusNoCapsMTAct::NewLC(CEtelIsvTestStep* aTestStep,CTelephony* aTelephony, TInt& aCallCount)
       
  1099  	{
       
  1100  	CNotifyLineStatusNoCapsMTAct* obj = new(ELeave) CNotifyLineStatusNoCapsMTAct(aTestStep, aTelephony, aCallCount);
       
  1101  	CleanupStack::PushL(obj);
       
  1102  	obj->ConstructL();
       
  1103  	return obj;    
       
  1104  	}
       
  1105  
       
  1106  CNotifyLineStatusNoCapsMTAct::CNotifyLineStatusNoCapsMTAct(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony, TInt& aCallCount):
       
  1107      CNotifyLineStatusMTAct(aTestStep, aTelephony, aCallCount)
       
  1108      {
       
  1109      }
       
  1110