24
|
1 |
// Copyright (c) 2007-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 |
// Contains the CEtelSessionMgr class definition.
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalTechnology
|
|
21 |
*/
|
|
22 |
|
|
23 |
#include "cetelsessionmgr.h"
|
|
24 |
#include "cctsytestlogging.h"
|
|
25 |
|
|
26 |
|
|
27 |
/********************************************************************************************
|
|
28 |
* PLEASE READ WHEN UPDATING SUBSESSION SUPPORT
|
|
29 |
*
|
|
30 |
* Subsessions which provide notificaion support, e.g. RMobileLine::NotifyMobileLineStatusChange
|
|
31 |
* must be tidied up between tests. This means providing a method to consume any outstanding
|
|
32 |
* notifications being held on the server for that subsession, and to cancel the internal repost
|
|
33 |
* mechanism within the Etel server. The steps are
|
|
34 |
* 1) Write a method along the lines of the methods in cetelnotifycleanup.cpp, e.g.
|
|
35 |
* CleanupMobileLineNotifyMobileLineStatusChange. The naming convention is
|
|
36 |
* Cleanup<<subsession>><<api>>.
|
|
37 |
* 2) Add that function to the method which calls all the related methods for that subsession, in
|
|
38 |
* the same file, e.g.CleanupMobileLineNotifiers. Add a new method for a new subsession type.
|
|
39 |
* 3) If a new subsession has been added, then the Cleanup<<subsession>>Notifiers method should be
|
|
40 |
* called from the appropriate place within the cascade of methods starting at TidyPhoneNotifiers
|
|
41 |
* - e.g. TidyPhoneNotifiers calls TidyLineNotifiers for every line on the phone, which calls
|
|
42 |
* TidyCallNotifiers for it's dependent call subsessions and then CleanupLineNotifiers and
|
|
43 |
* CleanupMobileLineNotifiers. The naming convention is that TidyXXX forms part of the hierarchy of
|
|
44 |
* subsession objects and Cleanup<<subsession>>Notifiers call the individual notification method
|
|
45 |
* cleanups.
|
|
46 |
**********************************************************************************************/
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Factory constructor.
|
|
50 |
*/
|
|
51 |
CEtelSessionMgr* CEtelSessionMgr::NewL(TName& aTsyName, TName& aPhoneName, TBool aKeepSessOpen)
|
|
52 |
{
|
|
53 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::NewL aTsyName=%S aPhoneName=%S aKeepSessOpen=%d "), &aTsyName, &aPhoneName, aKeepSessOpen);
|
|
54 |
CEtelSessionMgr* self = new(ELeave) CEtelSessionMgr(aTsyName, aPhoneName, aKeepSessOpen);
|
|
55 |
CleanupStack::PushL(self);
|
|
56 |
self->ConstructL();
|
|
57 |
CleanupStack::Pop();
|
|
58 |
return self;
|
|
59 |
}
|
|
60 |
|
|
61 |
/**
|
|
62 |
* Constructor.
|
|
63 |
*/
|
|
64 |
CEtelSessionMgr::CEtelSessionMgr(TName& aTsyName, TName& aPhoneName, TBool aKeepSessOpen)
|
|
65 |
: iTsyName(aTsyName), iPhoneName(aPhoneName), iKeepSessOpen(aKeepSessOpen)
|
|
66 |
{
|
|
67 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::CEtelSessionMgr aTsyName=%S aPhoneName=%S aKeepSessOpen=%d "), &aTsyName, &aPhoneName, aKeepSessOpen);
|
|
68 |
iSmsStoreNames[KMeSmsStore] = &KETelMeSmsStore;
|
|
69 |
iSmsStoreNames[KIccSmsStore] = &KETelIccSmsStore;
|
|
70 |
iSmsStoreNames[KCombinedSmsStore] = &KETelCombinedSmsStore;
|
|
71 |
|
|
72 |
iPhoneBookStoreNames[KMeAdnPhoneBook].Copy(KETelMeAdnPhoneBook);
|
|
73 |
iPhoneBookStoreNames[KMeDialledPhoneBook].Copy(KETelMeDialledPhoneBook);
|
|
74 |
iPhoneBookStoreNames[KMeMissedPhoneBook].Copy(KETelMeMissedPhoneBook);
|
|
75 |
iPhoneBookStoreNames[KMeReceivedPhoneBook].Copy(KETelMeReceivedPhoneBook);
|
|
76 |
iPhoneBookStoreNames[KCombinedAdnPhoneBook].Copy(KETelCombinedAdnPhoneBook);
|
|
77 |
iPhoneBookStoreNames[KTaAdnPhoneBook].Copy(KETelTaAdnPhoneBook);
|
|
78 |
iPhoneBookStoreNames[KIccAdnPhoneBook].Copy(KETelIccAdnPhoneBook);
|
|
79 |
iPhoneBookStoreNames[KIccFdnPhoneBook].Copy(KETelIccFdnPhoneBook);
|
|
80 |
iPhoneBookStoreNames[KIccSdnPhoneBook].Copy(KETelIccSdnPhoneBook);
|
|
81 |
iPhoneBookStoreNames[KIccBdnPhoneBook].Copy(KETelIccBdnPhoneBook);
|
|
82 |
iPhoneBookStoreNames[KIccLndPhoneBook].Copy(KETelIccLndPhoneBook);
|
|
83 |
iPhoneBookStoreNames[KIccVoiceMailBox].Copy(KETelIccVoiceMailBox);
|
|
84 |
iPhoneBookStoreNames[KIccMbdnPhoneBook].Copy(KETelIccMbdnPhoneBook);
|
|
85 |
|
|
86 |
}
|
|
87 |
|
|
88 |
/**
|
|
89 |
* Second phase constructor.
|
|
90 |
*/
|
|
91 |
void CEtelSessionMgr::ConstructL()
|
|
92 |
{
|
|
93 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::ConstructL"));
|
|
94 |
iThreadExec = CThreadExec::NewL();
|
|
95 |
}
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Destructor.
|
|
99 |
*/
|
|
100 |
CEtelSessionMgr::~CEtelSessionMgr()
|
|
101 |
{
|
|
102 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::~CEtelSessionMgr"));
|
|
103 |
delete iThreadExec;
|
|
104 |
}
|
|
105 |
|
|
106 |
/**
|
|
107 |
* Post constructor open
|
|
108 |
*/
|
|
109 |
void CEtelSessionMgr::OpenL(TBool aAutoOpenSess)
|
|
110 |
{
|
|
111 |
TEST_FRAMEWORK_LOG2(_L("CEtelSessionMgr::OpenL aAutoOpenSess=%d"), aAutoOpenSess);
|
|
112 |
if (iIsOpen || !aAutoOpenSess)
|
|
113 |
{
|
|
114 |
// Close all sessions if :
|
|
115 |
// - the Session Mgr was not closed properly
|
|
116 |
// - the caller doesn't want any sessions open
|
|
117 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::OpenL closing all sessions"));
|
|
118 |
CThreadExec::TFunctorP1<CEtelSessionMgr,TBool> fn(this,&CEtelSessionMgr::DoCloseAllSessL,ETrue);
|
|
119 |
iThreadExec->Exec(&fn);
|
|
120 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::OpenL done closing all sessions"));
|
|
121 |
iAutoSessionOpened = EFalse;
|
|
122 |
}
|
|
123 |
|
|
124 |
if (aAutoOpenSess && !iAutoSessionOpened)
|
|
125 |
{
|
|
126 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::OpenL opening all sessions"));
|
|
127 |
// Open auto session if requested and if they are not open yet
|
|
128 |
CThreadExec::TFunctor<CEtelSessionMgr> fn(this,&CEtelSessionMgr::DoOpenAutoSessL);
|
|
129 |
User::LeaveIfError(iThreadExec->Exec(&fn));
|
|
130 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::OpenL done opening all sessions"));
|
|
131 |
iAutoSessionOpened = ETrue;
|
|
132 |
}
|
|
133 |
|
|
134 |
iIsOpen = ETrue;
|
|
135 |
}
|
|
136 |
|
|
137 |
/**
|
|
138 |
* Close the subsession manager
|
|
139 |
*/
|
|
140 |
void CEtelSessionMgr::Close()
|
|
141 |
{
|
|
142 |
TEST_FRAMEWORK_LOG3(_L("CEtelSessionMgr::Close iAutoSessionOpened=%d iIsOpen=%d"), iAutoSessionOpened, iIsOpen);
|
|
143 |
// Close only manually opened sessions if iKeepSessOpen, all session else
|
|
144 |
CThreadExec::TFunctorP1<CEtelSessionMgr,TBool> fn(this,&CEtelSessionMgr::DoCloseAllSessL,!iKeepSessOpen);
|
|
145 |
TInt err = iThreadExec->Exec(&fn);
|
|
146 |
iAutoSessionOpened = iKeepSessOpen;
|
|
147 |
iIsOpen = EFalse;
|
|
148 |
}
|
|
149 |
|
|
150 |
|
|
151 |
/**
|
|
152 |
* Force a close on the session manager including auto opened sessions
|
|
153 |
* so that the server is unloaded, then re-open
|
|
154 |
*/
|
|
155 |
void CEtelSessionMgr::RestartL()
|
|
156 |
{
|
|
157 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::RestartL"));
|
|
158 |
TBool savedKeepFlag = iKeepSessOpen;
|
|
159 |
iKeepSessOpen = EFalse;
|
|
160 |
|
|
161 |
Close();
|
|
162 |
|
|
163 |
iKeepSessOpen = savedKeepFlag;
|
|
164 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::RestartL calling OpenL"));
|
|
165 |
OpenL(savedKeepFlag);
|
|
166 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::RestartL after OpenL"));
|
|
167 |
}
|
|
168 |
|
|
169 |
|
|
170 |
/**
|
|
171 |
* Get a server subsubsession
|
|
172 |
*/
|
|
173 |
RTelServer& CEtelSessionMgr::GetServerL(TServerId aServerId)
|
|
174 |
{
|
|
175 |
TEST_FRAMEWORK_LOG2(_L("CEtelSessionMgr::GetServerL aServerId=%d"), aServerId);
|
|
176 |
|
|
177 |
if (iTelServersStatus[aServerId] == ESessClosed)
|
|
178 |
{
|
|
179 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::GetServerL iTelServersStatus[aServerId] == ESessClosed"));
|
|
180 |
CThreadExec::TFunctorP1<CEtelSessionMgr, TServerId> fn(this,&CEtelSessionMgr::DoOpenServerL,aServerId);
|
|
181 |
TInt err = iThreadExec->Exec(&fn);
|
|
182 |
TEST_FRAMEWORK_LOG2(_L("CEtelSessionMgr::GetServerL err=%d"), err);
|
|
183 |
User::LeaveIfError(err);
|
|
184 |
iTelServersStatus[aServerId] = ESessOpenManually;
|
|
185 |
}
|
|
186 |
|
|
187 |
return iTelServers[aServerId];
|
|
188 |
}
|
|
189 |
|
|
190 |
/**
|
|
191 |
* Get a RMobilePhone subsession
|
|
192 |
*/
|
|
193 |
RMobilePhone& CEtelSessionMgr::GetPhoneL(TServerId aServerId, TPhoneId aPhoneId)
|
|
194 |
{
|
|
195 |
TEST_FRAMEWORK_LOG3(_L("CEtelSessionMgr::GetPhoneL aServerId=%d aPhoneId=%d"), aServerId, aPhoneId);
|
|
196 |
|
|
197 |
if (iTelServersStatus[aServerId] == ESessClosed)
|
|
198 |
GetServerL(aServerId); // open parent session if required
|
|
199 |
|
|
200 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessClosed)
|
|
201 |
{
|
|
202 |
CThreadExec::TFunctorP2<CEtelSessionMgr, TServerId, TPhoneId> fn(this,&CEtelSessionMgr::DoOpenPhoneL,aServerId,aPhoneId);
|
|
203 |
TInt err = iThreadExec->Exec(&fn);
|
|
204 |
User::LeaveIfError(err);
|
|
205 |
iPhonesStatus[aServerId][aPhoneId] = ESessOpenManually;
|
|
206 |
}
|
|
207 |
|
|
208 |
return iPhones[aServerId][aPhoneId];
|
|
209 |
}
|
|
210 |
|
|
211 |
/**
|
|
212 |
* Get a RMobileLine subsession
|
|
213 |
*/
|
|
214 |
RMobileLine& CEtelSessionMgr::GetLineL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId)
|
|
215 |
{
|
|
216 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::GetLineL aServerId=%d aPhoneId=%d aLine=%d"), aServerId, aPhoneId, aLineId);
|
|
217 |
|
|
218 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessClosed)
|
|
219 |
GetPhoneL(aServerId, aPhoneId); // open parent session if require
|
|
220 |
|
|
221 |
if (iLinesStatus[aServerId][aPhoneId][aLineId] == ESessClosed)
|
|
222 |
{
|
|
223 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TLineId> fn(this,&CEtelSessionMgr::DoOpenLineL,aServerId,aPhoneId,aLineId);
|
|
224 |
TInt err = iThreadExec->Exec(&fn);
|
|
225 |
User::LeaveIfError(err);
|
|
226 |
iLinesStatus[aServerId][aPhoneId][aLineId] = ESessOpenManually;
|
|
227 |
}
|
|
228 |
return iLines[aServerId][aPhoneId][aLineId];
|
|
229 |
}
|
|
230 |
|
|
231 |
/**
|
|
232 |
* Get a RMobileCall subsession
|
|
233 |
*/
|
|
234 |
RMobileCall& CEtelSessionMgr::GetCallL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId)
|
|
235 |
{
|
|
236 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::GetCallL aServerId=%d aPhoneId=%d aLine=%d aCallId=%d"), aServerId, aPhoneId, aLineId, aCallId);
|
|
237 |
|
|
238 |
if (iLinesStatus[aServerId][aPhoneId][aLineId] == ESessClosed)
|
|
239 |
GetLineL(aServerId, aPhoneId, aLineId); // open parent session if require
|
|
240 |
|
|
241 |
if (iCallsStatus[aServerId][aPhoneId][aLineId][aCallId] == ESessClosed)
|
|
242 |
{
|
|
243 |
CThreadExec::TFunctorP4<CEtelSessionMgr, TServerId, TPhoneId, TLineId, TCallId> fn(this,&CEtelSessionMgr::DoOpenCallL,aServerId,aPhoneId,aLineId,aCallId);
|
|
244 |
TInt err = iThreadExec->Exec(&fn);
|
|
245 |
User::LeaveIfError(err);
|
|
246 |
iCallsStatus[aServerId][aPhoneId][aLineId][aCallId] = ESessOpenManually;
|
|
247 |
}
|
|
248 |
|
|
249 |
return iCalls[aServerId][aPhoneId][aLineId][aCallId];
|
|
250 |
}
|
|
251 |
|
|
252 |
|
|
253 |
/**
|
|
254 |
* Get a RMobileCall subsession that has been assigned to an incoming call represented by name.
|
|
255 |
*/
|
|
256 |
RMobileCall& CEtelSessionMgr::GetIncomingCallL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, const TName& aName, TCallId& aCallId)
|
|
257 |
{
|
|
258 |
TCallId callId = KCall3;
|
|
259 |
|
|
260 |
while(!(callId==KMaxCalls || (iCallsRefs[aLineId][callId].GetCount()==0 && iCallsStatus[aServerId][aPhoneId][aLineId][callId]==ESessClosed)))
|
|
261 |
{
|
|
262 |
callId = (TCallId)(callId +1);
|
|
263 |
}
|
|
264 |
|
|
265 |
if(callId == KMaxCalls)
|
|
266 |
{
|
|
267 |
User::Leave(KErrInUse);
|
|
268 |
}
|
|
269 |
|
|
270 |
if (iLinesStatus[aServerId][aPhoneId][aLineId] == ESessClosed)
|
|
271 |
GetLineL(aServerId, aPhoneId, aLineId); // open parent session if required
|
|
272 |
|
|
273 |
CThreadExec::TFunctorP5 <CEtelSessionMgr, TServerId, TPhoneId, TLineId, TCallId, const TName&> fn(this,&CEtelSessionMgr::DoAssignCallToIncomingL,aServerId,aPhoneId,aLineId,callId,aName);
|
|
274 |
TInt err = iThreadExec->Exec(&fn);
|
|
275 |
User::LeaveIfError(err);
|
|
276 |
iCallsStatus[aServerId][aPhoneId][aLineId][callId] = ESessOpenManually;
|
|
277 |
|
|
278 |
aCallId = callId;
|
|
279 |
return iCalls[aServerId][aPhoneId][aLineId][callId];
|
|
280 |
}
|
|
281 |
|
|
282 |
|
|
283 |
|
|
284 |
/**
|
|
285 |
* Get a RFax subsession
|
|
286 |
*/
|
|
287 |
RFax& CEtelSessionMgr::GetFaxL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId, TFaxId aFaxId)
|
|
288 |
{
|
|
289 |
|
|
290 |
if (iCallsStatus[aServerId][aPhoneId][aLineId][aCallId] == ESessClosed)
|
|
291 |
GetCallL(aServerId, aPhoneId, aLineId, aCallId); // open parent session if require
|
|
292 |
|
|
293 |
if (iFaxesStatus[aServerId][aPhoneId][aLineId][aCallId][aFaxId] == ESessClosed)
|
|
294 |
{
|
|
295 |
CThreadExec::TFunctorP5<CEtelSessionMgr, TServerId, TPhoneId, TLineId, TCallId, TFaxId>
|
|
296 |
fn(this,&CEtelSessionMgr::DoOpenFaxL,aServerId,aPhoneId,aLineId,aCallId,aFaxId);
|
|
297 |
TInt err = iThreadExec->Exec(&fn);
|
|
298 |
User::LeaveIfError(err);
|
|
299 |
iFaxesStatus[aServerId][aPhoneId][aLineId][aCallId][aFaxId] = ESessOpenManually;
|
|
300 |
}
|
|
301 |
|
|
302 |
return iFaxes[aServerId][aPhoneId][aLineId][aCallId][aFaxId];
|
|
303 |
}
|
|
304 |
|
|
305 |
|
|
306 |
/**
|
|
307 |
* Get a RMobileConferenceCall subsession
|
|
308 |
*/
|
|
309 |
RMobileConferenceCall& CEtelSessionMgr::GetConferenceCallL(TServerId aServerId, TPhoneId aPhoneId,
|
|
310 |
TConferenceCallId aConferenceCallId)
|
|
311 |
{
|
|
312 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::GetConferenceCallL aServerId=%d aPhoneId=%d aConferenceCallId=%d"), aServerId, aPhoneId, aConferenceCallId);
|
|
313 |
|
|
314 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessClosed)
|
|
315 |
GetPhoneL(aServerId, aPhoneId); // open parent session if required
|
|
316 |
|
|
317 |
if (iConferenceCallsStatus[aServerId][aPhoneId][aConferenceCallId] == ESessClosed)
|
|
318 |
{
|
|
319 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TConferenceCallId>
|
|
320 |
fn(this,&CEtelSessionMgr::DoOpenConferenceCallL,aServerId,aPhoneId,aConferenceCallId);
|
|
321 |
TInt err = iThreadExec->Exec(&fn);
|
|
322 |
User::LeaveIfError(err);
|
|
323 |
iConferenceCallsStatus[aServerId][aPhoneId][aConferenceCallId] = ESessOpenManually;
|
|
324 |
}
|
|
325 |
|
|
326 |
return iConferenceCalls[aServerId][aPhoneId][aConferenceCallId];
|
|
327 |
}
|
|
328 |
|
|
329 |
|
|
330 |
/**
|
|
331 |
* Get a RPacketService subsession
|
|
332 |
*/
|
|
333 |
RPacketService& CEtelSessionMgr::GetPacketServiceL(TServerId aServerId, TPhoneId aPhoneId,TPacketServiceId aPacketServiceId)
|
|
334 |
{
|
|
335 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::GetPacketServiceL aServerId=%d aPhoneId=%d aPacketServiceId=%d"), aServerId, aPhoneId, aPacketServiceId);
|
|
336 |
|
|
337 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessClosed)
|
|
338 |
GetPhoneL(aServerId, aPhoneId); // open parent session if required
|
|
339 |
|
|
340 |
if (iPacketServicesStatus[aServerId][aPhoneId][aPacketServiceId] == ESessClosed)
|
|
341 |
{
|
|
342 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TPacketServiceId> fn(this,&CEtelSessionMgr::DoOpenPacketServiceL,aServerId,aPhoneId,aPacketServiceId);
|
|
343 |
TInt err = iThreadExec->Exec(&fn);
|
|
344 |
User::LeaveIfError(err);
|
|
345 |
iPacketServicesStatus[aServerId][aPhoneId][aPacketServiceId] = ESessOpenManually;
|
|
346 |
}
|
|
347 |
|
|
348 |
return iPacketServices[aServerId][aPhoneId][aPacketServiceId];
|
|
349 |
}
|
|
350 |
|
|
351 |
|
|
352 |
/**
|
|
353 |
* Get a primary RPacketContext subsession
|
|
354 |
*/
|
|
355 |
RPacketContext& CEtelSessionMgr::GetPrimaryPacketContextL(TServerId aServerId, TPhoneId aPhoneId,
|
|
356 |
TPacketServiceId aPacketServiceId,
|
|
357 |
TPrimaryPacketContextId aPrimaryPacketContextId)
|
|
358 |
{
|
|
359 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::GetPrimaryPacketContextL aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId);
|
|
360 |
|
|
361 |
if (iPacketServicesStatus[aServerId][aPhoneId][aPacketServiceId] == ESessClosed)
|
|
362 |
GetPacketServiceL( aServerId, aPhoneId, aPacketServiceId );
|
|
363 |
|
|
364 |
if (iPrimaryPacketContextsStatus[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId] == ESessClosed)
|
|
365 |
{
|
|
366 |
CThreadExec::TFunctorP4<CEtelSessionMgr, TServerId, TPhoneId, TPacketServiceId, TPrimaryPacketContextId>
|
|
367 |
fn(this,&CEtelSessionMgr::DoOpenPrimaryPacketContextL,aServerId,aPhoneId,aPacketServiceId,aPrimaryPacketContextId);
|
|
368 |
TInt err = iThreadExec->Exec(&fn);
|
|
369 |
User::LeaveIfError(err);
|
|
370 |
iPrimaryPacketContextsStatus[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId] = ESessOpenManually;
|
|
371 |
}
|
|
372 |
|
|
373 |
return iPrimaryPacketContexts[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId];
|
|
374 |
}
|
|
375 |
|
|
376 |
|
|
377 |
/**
|
|
378 |
* Get a RPacketQoS subsession for a primary packet context
|
|
379 |
*/
|
|
380 |
RPacketQoS& CEtelSessionMgr::GetPrimaryPacketContextQoSL(TServerId aServerId, TPhoneId aPhoneId,
|
|
381 |
TPacketServiceId aPacketServiceId,
|
|
382 |
TPrimaryPacketContextId aPrimaryPacketContextId)
|
|
383 |
{
|
|
384 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::GetPrimaryPacketContextQoSL aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId);
|
|
385 |
|
|
386 |
if (iPacketServicesStatus[aServerId][aPhoneId][aPacketServiceId] == ESessClosed)
|
|
387 |
GetPacketServiceL( aServerId, aPhoneId, aPacketServiceId );
|
|
388 |
|
|
389 |
if (iPrimaryPacketContextQoSsStatus[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId] == ESessClosed)
|
|
390 |
{
|
|
391 |
CThreadExec::TFunctorP4<CEtelSessionMgr, TServerId, TPhoneId, TPacketServiceId, TPrimaryPacketContextId>
|
|
392 |
fn(this,&CEtelSessionMgr::DoOpenPrimaryPacketContextQoSL,aServerId,aPhoneId,aPacketServiceId,aPrimaryPacketContextId);
|
|
393 |
TInt err = iThreadExec->Exec(&fn);
|
|
394 |
User::LeaveIfError(err);
|
|
395 |
iPrimaryPacketContextQoSsStatus[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId] = ESessOpenManually;
|
|
396 |
}
|
|
397 |
|
|
398 |
return iPrimaryPacketContextQoSs[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId];
|
|
399 |
}
|
|
400 |
|
|
401 |
|
|
402 |
/**
|
|
403 |
* Get a secondary RPacketContext subsession
|
|
404 |
*/
|
|
405 |
RPacketContext& CEtelSessionMgr::GetSecondaryPacketContextL(TServerId aServerId, TPhoneId aPhoneId,
|
|
406 |
TPacketServiceId aPacketServiceId,
|
|
407 |
TPrimaryPacketContextId aPrimaryPacketContextId,
|
|
408 |
TSecondaryPacketContextId aSecondaryPacketContextId)
|
|
409 |
{
|
|
410 |
if (iPrimaryPacketContextsStatus[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId] == ESessClosed)
|
|
411 |
GetPrimaryPacketContextL( aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId );
|
|
412 |
|
|
413 |
if (iSecondaryPacketContextsStatus[aServerId][aPhoneId][aPacketServiceId]
|
|
414 |
[aPrimaryPacketContextId][aSecondaryPacketContextId] == ESessClosed)
|
|
415 |
{
|
|
416 |
CThreadExec::TFunctorP5<CEtelSessionMgr, TServerId, TPhoneId, TPacketServiceId,
|
|
417 |
TPrimaryPacketContextId,TSecondaryPacketContextId>
|
|
418 |
fn(this,&CEtelSessionMgr::DoOpenSecondaryPacketContextL,aServerId,aPhoneId,aPacketServiceId,
|
|
419 |
aPrimaryPacketContextId,aSecondaryPacketContextId);
|
|
420 |
TInt err = iThreadExec->Exec(&fn);
|
|
421 |
User::LeaveIfError(err);
|
|
422 |
iSecondaryPacketContextsStatus[aServerId][aPhoneId][aPacketServiceId]
|
|
423 |
[aPrimaryPacketContextId][aSecondaryPacketContextId] = ESessOpenManually;
|
|
424 |
}
|
|
425 |
|
|
426 |
return iSecondaryPacketContexts[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId][aSecondaryPacketContextId];
|
|
427 |
}
|
|
428 |
|
|
429 |
/**
|
|
430 |
* Get a RPacketQoS subsession for a secondary packet context
|
|
431 |
*/
|
|
432 |
RPacketQoS& CEtelSessionMgr::GetSecondaryPacketContextQoSL(TServerId aServerId, TPhoneId aPhoneId,
|
|
433 |
TPacketServiceId aPacketServiceId,
|
|
434 |
TPrimaryPacketContextId aPrimaryPacketContextId,
|
|
435 |
TSecondaryPacketContextId aSecondaryPacketContextId)
|
|
436 |
{
|
|
437 |
if (iSecondaryPacketContextsStatus[aServerId][aPhoneId][aPacketServiceId]
|
|
438 |
[aPrimaryPacketContextId][aSecondaryPacketContextId] == ESessClosed)
|
|
439 |
|
|
440 |
GetSecondaryPacketContextL( aServerId, aPhoneId, aPacketServiceId,
|
|
441 |
aPrimaryPacketContextId,aSecondaryPacketContextId );
|
|
442 |
|
|
443 |
if (iSecondaryPacketContextQoSsStatus[aServerId][aPhoneId][aPacketServiceId]
|
|
444 |
[aPrimaryPacketContextId][aSecondaryPacketContextId] == ESessClosed)
|
|
445 |
{
|
|
446 |
CThreadExec::TFunctorP5<CEtelSessionMgr, TServerId, TPhoneId, TPacketServiceId,
|
|
447 |
TPrimaryPacketContextId,TSecondaryPacketContextId>
|
|
448 |
fn(this,&CEtelSessionMgr::DoOpenSecondaryPacketContextQoSL,aServerId,aPhoneId,aPacketServiceId,
|
|
449 |
aPrimaryPacketContextId,aSecondaryPacketContextId);
|
|
450 |
TInt err = iThreadExec->Exec(&fn);
|
|
451 |
User::LeaveIfError(err);
|
|
452 |
iSecondaryPacketContextQoSsStatus[aServerId][aPhoneId][aPacketServiceId]
|
|
453 |
[aPrimaryPacketContextId][aSecondaryPacketContextId] = ESessOpenManually;
|
|
454 |
}
|
|
455 |
|
|
456 |
return iSecondaryPacketContextQoSs[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId][aSecondaryPacketContextId];
|
|
457 |
}
|
|
458 |
|
|
459 |
/**
|
|
460 |
* Get a RMobileONStore subsession
|
|
461 |
*/
|
|
462 |
RMobileONStore& CEtelSessionMgr::GetONStoreL(TServerId aServerId, TPhoneId aPhoneId,TONStoreId aONStoreId)
|
|
463 |
{
|
|
464 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::GetONStoreL aServerId=%d aPhoneId=%d aONStoreId=%d"), aServerId, aPhoneId, aONStoreId);
|
|
465 |
|
|
466 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessClosed)
|
|
467 |
GetPhoneL(aServerId, aPhoneId); // open parent session if required
|
|
468 |
|
|
469 |
if (iONStoresStatus[aServerId][aPhoneId][aONStoreId] == ESessClosed)
|
|
470 |
{
|
|
471 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TONStoreId>
|
|
472 |
fn(this,&CEtelSessionMgr::DoOpenONStoreL,aServerId,aPhoneId,aONStoreId);
|
|
473 |
TInt err = iThreadExec->Exec(&fn);
|
|
474 |
User::LeaveIfError(err);
|
|
475 |
iONStoresStatus[aServerId][aPhoneId][aONStoreId] = ESessOpenManually;
|
|
476 |
}
|
|
477 |
|
|
478 |
return iONStores[aServerId][aPhoneId][aONStoreId];
|
|
479 |
}
|
|
480 |
|
|
481 |
/**
|
|
482 |
* Get a RMobileENStore subsession
|
|
483 |
*/
|
|
484 |
RMobileENStore& CEtelSessionMgr::GetENStoreL(TServerId aServerId, TPhoneId aPhoneId, TENStoreId aENStoreId)
|
|
485 |
{
|
|
486 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::GetENStoreL aServerId=%d aPhoneId=%d aENStoreId=%d"), aServerId, aPhoneId, aENStoreId);
|
|
487 |
|
|
488 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessClosed)
|
|
489 |
GetPhoneL(aServerId, aPhoneId); // open parent session if required
|
|
490 |
|
|
491 |
if (iENStoresStatus[aServerId][aPhoneId][aENStoreId] == ESessClosed)
|
|
492 |
{
|
|
493 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TENStoreId>
|
|
494 |
fn(this,&CEtelSessionMgr::DoOpenENStoreL,aServerId,aPhoneId,aENStoreId);
|
|
495 |
TInt err = iThreadExec->Exec(&fn);
|
|
496 |
User::LeaveIfError(err);
|
|
497 |
iENStoresStatus[aServerId][aPhoneId][aENStoreId] = ESessOpenManually;
|
|
498 |
}
|
|
499 |
|
|
500 |
return iENStores[aServerId][aPhoneId][aENStoreId];
|
|
501 |
}
|
|
502 |
|
|
503 |
/**
|
|
504 |
* Get a RMobilePhoneBookStore subsession
|
|
505 |
*/
|
|
506 |
RMobilePhoneBookStore& CEtelSessionMgr::GetPhoneBookStoreL(TServerId aServerId, TPhoneId aPhoneId,TPhoneBookStoreId aPhoneBookStoreId)
|
|
507 |
{
|
|
508 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::GetPhoneBookStoreL aServerId=%d aPhoneId=%d aPhoneBookStoreId=%d"), aServerId, aPhoneId, aPhoneBookStoreId);
|
|
509 |
|
|
510 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessClosed)
|
|
511 |
GetPhoneL(aServerId, aPhoneId); // open parent session if required
|
|
512 |
|
|
513 |
if (iPhoneBookStoresStatus[aServerId][aPhoneId][aPhoneBookStoreId] == ESessClosed)
|
|
514 |
{
|
|
515 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TPhoneBookStoreId>
|
|
516 |
fn(this,&CEtelSessionMgr::DoOpenPhoneBookStoreL,aServerId,aPhoneId,aPhoneBookStoreId);
|
|
517 |
TInt err = iThreadExec->Exec(&fn);
|
|
518 |
User::LeaveIfError(err);
|
|
519 |
iPhoneBookStoresStatus[aServerId][aPhoneId][aPhoneBookStoreId] = ESessOpenManually;
|
|
520 |
}
|
|
521 |
|
|
522 |
return iPhoneBookStores[aServerId][aPhoneId][aPhoneBookStoreId];
|
|
523 |
}
|
|
524 |
|
|
525 |
/**
|
|
526 |
* Get a RMobileSmsStore subsession
|
|
527 |
*/
|
|
528 |
RMobileSmsStore& CEtelSessionMgr::GetSmsStoreL(TServerId aServerId, TPhoneId aPhoneId,
|
|
529 |
TSmsMessagingId aSmsMessagingId, TSmsStoreId aSmsStoreId)
|
|
530 |
{
|
|
531 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::GetSmsStoreL aServerId=%d aPhoneId=%d aSmsMessagingId=%d aSmsStoreId=%d"), aServerId, aPhoneId, aSmsMessagingId, aSmsStoreId);
|
|
532 |
|
|
533 |
if (iSmsMessagingsStatus[aServerId][aPhoneId][aSmsMessagingId] == ESessClosed)
|
|
534 |
GetSmsMessagingL(aServerId, aPhoneId,aSmsMessagingId ); // open parent session if required
|
|
535 |
|
|
536 |
if (iSmsStoresStatus[aServerId][aPhoneId][aSmsMessagingId][aSmsStoreId] == ESessClosed)
|
|
537 |
{
|
|
538 |
CThreadExec::TFunctorP4<CEtelSessionMgr, TServerId, TPhoneId, TSmsMessagingId, TSmsStoreId>
|
|
539 |
fn(this,&CEtelSessionMgr::DoOpenSmsStoreL,aServerId,aPhoneId,aSmsMessagingId,aSmsStoreId);
|
|
540 |
TInt err = iThreadExec->Exec(&fn);
|
|
541 |
User::LeaveIfError(err);
|
|
542 |
iSmsStoresStatus[aServerId][aPhoneId][aSmsMessagingId][aSmsStoreId] = ESessOpenManually;
|
|
543 |
}
|
|
544 |
|
|
545 |
return iSmsStores[aServerId][aPhoneId][aSmsMessagingId][aSmsStoreId];
|
|
546 |
}
|
|
547 |
|
|
548 |
/**
|
|
549 |
* Get a RMobileSmsMessaging subsession
|
|
550 |
*/
|
|
551 |
RMobileSmsMessaging& CEtelSessionMgr::GetSmsMessagingL(TServerId aServerId, TPhoneId aPhoneId,TSmsMessagingId aSmsMessagingId)
|
|
552 |
{
|
|
553 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::GetSmsStoreL aServerId=%d aPhoneId=%d aSmsMessagingId=%d"), aServerId, aPhoneId, aSmsMessagingId);
|
|
554 |
|
|
555 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessClosed)
|
|
556 |
GetPhoneL(aServerId, aPhoneId); // open parent session if required
|
|
557 |
|
|
558 |
if (iSmsMessagingsStatus[aServerId][aPhoneId][aSmsMessagingId] == ESessClosed)
|
|
559 |
{
|
|
560 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TSmsMessagingId>
|
|
561 |
fn(this,&CEtelSessionMgr::DoOpenSmsMessagingL,aServerId,aPhoneId,aSmsMessagingId);
|
|
562 |
TInt err = iThreadExec->Exec(&fn);
|
|
563 |
User::LeaveIfError(err);
|
|
564 |
iSmsMessagingsStatus[aServerId][aPhoneId][aSmsMessagingId] = ESessOpenManually;
|
|
565 |
}
|
|
566 |
|
|
567 |
return iSmsMessagings[aServerId][aPhoneId][aSmsMessagingId];
|
|
568 |
}
|
|
569 |
|
|
570 |
/**
|
|
571 |
* Get a RMobileBroadcastMessaging subsession
|
|
572 |
*/
|
|
573 |
RMobileBroadcastMessaging& CEtelSessionMgr::GetBroadcastMessagingL(TServerId aServerId, TPhoneId aPhoneId,TBroadcastMessagingId aBroadcastMessagingId)
|
|
574 |
{
|
|
575 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::GetBroadcastMessagingL aServerId=%d aPhoneId=%d aBroadcastMessagingId=%d"), aServerId, aPhoneId, aBroadcastMessagingId);
|
|
576 |
|
|
577 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessClosed)
|
|
578 |
GetPhoneL(aServerId, aPhoneId); // open parent session if required
|
|
579 |
|
|
580 |
if (iBroadcastMessagingsStatus[aServerId][aPhoneId][aBroadcastMessagingId] == ESessClosed)
|
|
581 |
{
|
|
582 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TBroadcastMessagingId>
|
|
583 |
fn(this,&CEtelSessionMgr::DoOpenBroadcastMessagingL,aServerId,aPhoneId,aBroadcastMessagingId);
|
|
584 |
TInt err = iThreadExec->Exec(&fn);
|
|
585 |
User::LeaveIfError(err);
|
|
586 |
iBroadcastMessagingsStatus[aServerId][aPhoneId][aBroadcastMessagingId] = ESessOpenManually;
|
|
587 |
}
|
|
588 |
|
|
589 |
return iBroadcastMessagings[aServerId][aPhoneId][aBroadcastMessagingId];
|
|
590 |
}
|
|
591 |
|
|
592 |
/**
|
|
593 |
* Get a RMobileUssdMessaging subsession
|
|
594 |
*/
|
|
595 |
RMobileUssdMessaging& CEtelSessionMgr::GetUssdMessagingL(TServerId aServerId, TPhoneId aPhoneId,TUssdMessagingId aUssdMessagingId)
|
|
596 |
{
|
|
597 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::GetUssdMessagingL aServerId=%d aPhoneId=%d aUssdMessagingId=%d"), aServerId, aPhoneId, aUssdMessagingId);
|
|
598 |
|
|
599 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessClosed)
|
|
600 |
GetPhoneL(aServerId, aPhoneId); // open parent session if required
|
|
601 |
|
|
602 |
if (iUssdMessagingsStatus[aServerId][aPhoneId][aUssdMessagingId] == ESessClosed)
|
|
603 |
{
|
|
604 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TUssdMessagingId>
|
|
605 |
fn(this,&CEtelSessionMgr::DoOpenUssdMessagingL,aServerId,aPhoneId,aUssdMessagingId);
|
|
606 |
TInt err = iThreadExec->Exec(&fn);
|
|
607 |
User::LeaveIfError(err);
|
|
608 |
iUssdMessagingsStatus[aServerId][aPhoneId][aUssdMessagingId] = ESessOpenManually;
|
|
609 |
}
|
|
610 |
|
|
611 |
return iUssdMessagings[aServerId][aPhoneId][aUssdMessagingId];
|
|
612 |
}
|
|
613 |
|
|
614 |
/**
|
|
615 |
* Get a RMmCustomAPI subsession
|
|
616 |
*/
|
|
617 |
RMmCustomAPI& CEtelSessionMgr::GetCustomApiL(TServerId aServerId, TPhoneId aPhoneId, TCustomApiId aCustomApiId)
|
|
618 |
{
|
|
619 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::GetCustomApiL aServerId=%d aPhoneId=%d aCustomIpcId=%d"), aServerId, aPhoneId, aCustomApiId);
|
|
620 |
|
|
621 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessClosed)
|
|
622 |
GetPhoneL(aServerId, aPhoneId); // open parent session if required
|
|
623 |
|
|
624 |
if (iCustomApisStatus[aServerId][aPhoneId][aCustomApiId] == ESessClosed)
|
|
625 |
{
|
|
626 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TCustomApiId>
|
|
627 |
fn(this,&CEtelSessionMgr::DoOpenCustomApiL,aServerId,aPhoneId,aCustomApiId);
|
|
628 |
TInt err = iThreadExec->Exec(&fn);
|
|
629 |
User::LeaveIfError(err);
|
|
630 |
iCustomApisStatus[aServerId][aPhoneId][aCustomApiId] = ESessOpenManually;
|
|
631 |
}
|
|
632 |
|
|
633 |
return iCustomApis[aServerId][aPhoneId][aCustomApiId];
|
|
634 |
}
|
|
635 |
|
|
636 |
/**
|
|
637 |
* Release a server object
|
|
638 |
*/
|
|
639 |
void CEtelSessionMgr::ReleaseServer(TServerId aServerId)
|
|
640 |
{
|
|
641 |
TEST_FRAMEWORK_LOG2(_L("CEtelSessionMgr::ReleaseServer aServerId=%d"), aServerId);
|
|
642 |
if (iTelServersStatus[aServerId] == ESessOpenManually)
|
|
643 |
{
|
|
644 |
CThreadExec::TFunctorP1<CEtelSessionMgr, TServerId> fn(this,&CEtelSessionMgr::DoCloseServerL,aServerId);
|
|
645 |
TInt err = iThreadExec->Exec(&fn);
|
|
646 |
iTelServersStatus[aServerId] = ESessClosed;
|
|
647 |
}
|
|
648 |
}
|
|
649 |
|
|
650 |
/**
|
|
651 |
* Release a phone object
|
|
652 |
*/
|
|
653 |
void CEtelSessionMgr::ReleasePhone(TServerId aServerId, TPhoneId aPhoneId)
|
|
654 |
{
|
|
655 |
TEST_FRAMEWORK_LOG3(_L("CEtelSessionMgr::ReleasePhone aServerId=%d aPhoneId=%d"), aServerId, aPhoneId);
|
|
656 |
if (iPhonesStatus[aServerId][aPhoneId] == ESessOpenManually)
|
|
657 |
{
|
|
658 |
CThreadExec::TFunctorP2<CEtelSessionMgr, TServerId, TPhoneId> fn(this,&CEtelSessionMgr::DoClosePhoneL,aServerId,aPhoneId);
|
|
659 |
TInt err = iThreadExec->Exec(&fn);
|
|
660 |
iPhonesStatus[aServerId][aPhoneId] = ESessClosed;
|
|
661 |
}
|
|
662 |
}
|
|
663 |
|
|
664 |
/**
|
|
665 |
* Release a line object
|
|
666 |
*/
|
|
667 |
void CEtelSessionMgr::ReleaseLine(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId)
|
|
668 |
{
|
|
669 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::ReleaseLine aServerId=%d aPhoneId=%d aLineId=%d"), aServerId, aPhoneId, aLineId);
|
|
670 |
if (iLinesStatus[aServerId][aPhoneId][aLineId] == ESessOpenManually)
|
|
671 |
{
|
|
672 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TLineId> fn(this,&CEtelSessionMgr::DoCloseLineL,aServerId,aPhoneId,aLineId);
|
|
673 |
TInt err = iThreadExec->Exec(&fn);
|
|
674 |
iLinesStatus[aServerId][aPhoneId][aLineId] = ESessClosed;
|
|
675 |
}
|
|
676 |
}
|
|
677 |
|
|
678 |
/**
|
|
679 |
* Release a call object
|
|
680 |
*/
|
|
681 |
void CEtelSessionMgr::ReleaseCall(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId)
|
|
682 |
{
|
|
683 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::ReleaseCall aServerId=%d aPhoneId=%d aLineId=%d"), aServerId, aPhoneId, aLineId, aCallId);
|
|
684 |
if (iCallsStatus[aServerId][aPhoneId][aLineId][aCallId] == ESessOpenManually)
|
|
685 |
{
|
|
686 |
CThreadExec::TFunctorP4<CEtelSessionMgr, TServerId, TPhoneId, TLineId, TCallId> fn(this,&CEtelSessionMgr::DoCloseCallL,aServerId,aPhoneId,aLineId,aCallId);
|
|
687 |
TInt err = iThreadExec->Exec(&fn);
|
|
688 |
iCallsStatus[aServerId][aPhoneId][aLineId][aCallId] = ESessClosed;
|
|
689 |
}
|
|
690 |
}
|
|
691 |
|
|
692 |
/**
|
|
693 |
* Release a conference call object
|
|
694 |
*/
|
|
695 |
|
|
696 |
void CEtelSessionMgr::ReleaseConferenceCall( TServerId aServerId, TPhoneId aPhoneId,TConferenceCallId aConferenceCallId )
|
|
697 |
{
|
|
698 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::ReleaseConferenceCall aServerId=%d aPhoneId=%d aConferenceCallId=%d"), aServerId, aPhoneId, aConferenceCallId);
|
|
699 |
if (iConferenceCallsStatus[aServerId][aPhoneId][aConferenceCallId] == ESessOpenManually)
|
|
700 |
{
|
|
701 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TConferenceCallId>
|
|
702 |
fn(this,&CEtelSessionMgr::DoCloseConferenceCallL,aServerId,aPhoneId,aConferenceCallId);
|
|
703 |
TInt err = iThreadExec->Exec(&fn);
|
|
704 |
iConferenceCallsStatus[aServerId][aPhoneId][aConferenceCallId] = ESessClosed;
|
|
705 |
}
|
|
706 |
}
|
|
707 |
|
|
708 |
/**
|
|
709 |
* Release a Fax object
|
|
710 |
*/
|
|
711 |
void CEtelSessionMgr::ReleaseFaxL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId, TFaxId aFaxId)
|
|
712 |
{
|
|
713 |
TEST_FRAMEWORK_LOG6(_L("CEtelSessionMgr::ReleaseFax aServerId=%d aPhoneId=%d aLineId=%d aCallId=%d aFaxId=%d"), aServerId, aPhoneId, aLineId, aCallId, aFaxId);
|
|
714 |
if (iFaxesStatus[aServerId][aPhoneId][aLineId][aCallId][aFaxId] == ESessOpenManually)
|
|
715 |
{
|
|
716 |
CThreadExec::TFunctorP5<CEtelSessionMgr, TServerId, TPhoneId, TLineId, TCallId, TFaxId>
|
|
717 |
fn(this,&CEtelSessionMgr::DoCloseFaxL,aServerId,aPhoneId,aLineId,aCallId,aFaxId);
|
|
718 |
TInt err = iThreadExec->Exec(&fn);
|
|
719 |
User::LeaveIfError(err);
|
|
720 |
iFaxesStatus[aServerId][aPhoneId][aLineId][aCallId][aFaxId] = ESessClosed;
|
|
721 |
}
|
|
722 |
|
|
723 |
}
|
|
724 |
|
|
725 |
/**
|
|
726 |
* Release the a service object
|
|
727 |
*/
|
|
728 |
void CEtelSessionMgr::ReleasePacketServiceL(TServerId aServerId, TPhoneId aPhoneId, TPacketServiceId aPacketServiceId)
|
|
729 |
{
|
|
730 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::ReleasePacketService aServerId=%d aPhoneId=%d aPacketServiceId=%d"), aServerId, aPhoneId, aPacketServiceId);
|
|
731 |
if (iPacketServicesStatus[aServerId][aPhoneId][aPacketServiceId] == ESessOpenManually)
|
|
732 |
{
|
|
733 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TPacketServiceId> fn(this,&CEtelSessionMgr::DoClosePacketServiceL,aServerId,aPhoneId,aPacketServiceId);
|
|
734 |
TInt err = iThreadExec->Exec(&fn);
|
|
735 |
iPacketServicesStatus[aServerId][aPhoneId][aPacketServiceId] = ESessClosed;
|
|
736 |
}
|
|
737 |
}
|
|
738 |
|
|
739 |
|
|
740 |
/**
|
|
741 |
* Release a primary packet context object
|
|
742 |
*/
|
|
743 |
void CEtelSessionMgr::ReleasePrimaryPacketContext(TServerId aServerId,
|
|
744 |
TPhoneId aPhoneId,
|
|
745 |
TPacketServiceId aPacketServiceId,
|
|
746 |
TPrimaryPacketContextId aPrimaryPacketContextId)
|
|
747 |
{
|
|
748 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::ReleasePrimaryPacketContext aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId);
|
|
749 |
if (iPrimaryPacketContextsStatus[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId] == ESessOpenManually)
|
|
750 |
{
|
|
751 |
CThreadExec::TFunctorP4<CEtelSessionMgr, TServerId, TPhoneId, TPacketServiceId, TPrimaryPacketContextId>
|
|
752 |
fn(this,&CEtelSessionMgr::DoClosePrimaryPacketContextL,aServerId,aPhoneId,aPacketServiceId, aPrimaryPacketContextId);
|
|
753 |
TInt err = iThreadExec->Exec(&fn);
|
|
754 |
iPrimaryPacketContextsStatus[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId] = ESessClosed;
|
|
755 |
}
|
|
756 |
}
|
|
757 |
|
|
758 |
/**
|
|
759 |
* Release the PacketContextQoS object for a primary packet context
|
|
760 |
*/
|
|
761 |
void CEtelSessionMgr::ReleasePrimaryPacketContextQoS(TServerId aServerId,
|
|
762 |
TPhoneId aPhoneId,
|
|
763 |
TPacketServiceId aPacketServiceId,
|
|
764 |
TPrimaryPacketContextId aPrimaryPacketContextId)
|
|
765 |
{
|
|
766 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::ReleasePrimaryPacketContextQoS aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId);
|
|
767 |
if (iPrimaryPacketContextQoSsStatus[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId] == ESessOpenManually)
|
|
768 |
{
|
|
769 |
CThreadExec::TFunctorP4<CEtelSessionMgr, TServerId, TPhoneId, TPacketServiceId, TPrimaryPacketContextId>
|
|
770 |
fn(this,&CEtelSessionMgr::DoClosePrimaryPacketContextQoSL,aServerId,aPhoneId,aPacketServiceId, aPrimaryPacketContextId);
|
|
771 |
TInt err = iThreadExec->Exec(&fn);
|
|
772 |
iPrimaryPacketContextQoSsStatus[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId] = ESessClosed;
|
|
773 |
}
|
|
774 |
}
|
|
775 |
|
|
776 |
|
|
777 |
/**
|
|
778 |
* Release a secondary packet context object
|
|
779 |
*/
|
|
780 |
void CEtelSessionMgr::ReleaseSecondaryPacketContext(TServerId aServerId,
|
|
781 |
TPhoneId aPhoneId,
|
|
782 |
TPacketServiceId aPacketServiceId,
|
|
783 |
TPrimaryPacketContextId aPrimaryPacketContextId,
|
|
784 |
TSecondaryPacketContextId aSecondaryPacketContextId)
|
|
785 |
{
|
|
786 |
TEST_FRAMEWORK_LOG6(_L("CEtelSessionMgr::ReleaseSecondaryPacketContext aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d aSecondaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId, aSecondaryPacketContextId);
|
|
787 |
if (iSecondaryPacketContextsStatus[aServerId][aPhoneId][aPacketServiceId]
|
|
788 |
[aPrimaryPacketContextId][aSecondaryPacketContextId] == ESessOpenManually)
|
|
789 |
{
|
|
790 |
CThreadExec::TFunctorP5<CEtelSessionMgr, TServerId, TPhoneId, TPacketServiceId,
|
|
791 |
TPrimaryPacketContextId,TSecondaryPacketContextId>
|
|
792 |
fn(this,&CEtelSessionMgr::DoCloseSecondaryPacketContextL,aServerId,aPhoneId,aPacketServiceId,
|
|
793 |
aPrimaryPacketContextId,aSecondaryPacketContextId);
|
|
794 |
TInt err = iThreadExec->Exec(&fn);
|
|
795 |
iSecondaryPacketContextsStatus[aServerId][aPhoneId][aPacketServiceId]
|
|
796 |
[aPrimaryPacketContextId][aSecondaryPacketContextId] = ESessClosed;
|
|
797 |
}
|
|
798 |
}
|
|
799 |
|
|
800 |
/**
|
|
801 |
* Release the PacketContextQoS object for a primary packet context
|
|
802 |
*/
|
|
803 |
void CEtelSessionMgr::ReleaseSecondaryPacketContextQoS(TServerId aServerId,
|
|
804 |
TPhoneId aPhoneId,
|
|
805 |
TPacketServiceId aPacketServiceId,
|
|
806 |
TPrimaryPacketContextId aPrimaryPacketContextId,
|
|
807 |
TSecondaryPacketContextId aSecondaryPacketContextId)
|
|
808 |
{
|
|
809 |
TEST_FRAMEWORK_LOG6(_L("CEtelSessionMgr::ReleaseSecondaryPacketContextQoS aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d aSecondaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId, aSecondaryPacketContextId);
|
|
810 |
if (iSecondaryPacketContextQoSsStatus[aServerId][aPhoneId][aPacketServiceId]
|
|
811 |
[aPrimaryPacketContextId][aSecondaryPacketContextId] == ESessOpenManually)
|
|
812 |
{
|
|
813 |
CThreadExec::TFunctorP5<CEtelSessionMgr, TServerId, TPhoneId, TPacketServiceId,
|
|
814 |
TPrimaryPacketContextId,TSecondaryPacketContextId>
|
|
815 |
fn(this,&CEtelSessionMgr::DoCloseSecondaryPacketContextQoSL,aServerId,aPhoneId,aPacketServiceId,
|
|
816 |
aPrimaryPacketContextId,aSecondaryPacketContextId);
|
|
817 |
TInt err = iThreadExec->Exec(&fn);
|
|
818 |
iSecondaryPacketContextQoSsStatus[aServerId][aPhoneId][aPacketServiceId]
|
|
819 |
[aPrimaryPacketContextId][aSecondaryPacketContextId] = ESessClosed;
|
|
820 |
}
|
|
821 |
}
|
|
822 |
|
|
823 |
|
|
824 |
/**
|
|
825 |
* Release an ONStore object
|
|
826 |
*/
|
|
827 |
void CEtelSessionMgr::ReleaseONStore(TServerId aServerId, TPhoneId aPhoneId, TONStoreId aONStoreId)
|
|
828 |
{
|
|
829 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::ReleaseONStore aServerId=%d aPhoneId=%d aONStoreId=%d"), aServerId, aPhoneId, aONStoreId);
|
|
830 |
if (iONStoresStatus[aServerId][aPhoneId][aONStoreId] == ESessOpenManually)
|
|
831 |
{
|
|
832 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TONStoreId> fn(this,&CEtelSessionMgr::DoCloseONStoreL,aServerId,aPhoneId,aONStoreId);
|
|
833 |
TInt err = iThreadExec->Exec(&fn);
|
|
834 |
iONStoresStatus[aServerId][aPhoneId][aONStoreId] = ESessClosed;
|
|
835 |
}
|
|
836 |
}
|
|
837 |
|
|
838 |
/**
|
|
839 |
* Release an ENStore object
|
|
840 |
*/
|
|
841 |
void CEtelSessionMgr::ReleaseENStore(TServerId aServerId, TPhoneId aPhoneId, TENStoreId aENStoreId)
|
|
842 |
{
|
|
843 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::ReleaseENStore aServerId=%d aPhoneId=%d aENStoreId=%d"), aServerId, aPhoneId, aENStoreId);
|
|
844 |
if (iENStoresStatus[aServerId][aPhoneId][aENStoreId] == ESessOpenManually)
|
|
845 |
{
|
|
846 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TENStoreId> fn(this,&CEtelSessionMgr::DoCloseENStoreL,aServerId,aPhoneId,aENStoreId);
|
|
847 |
TInt err = iThreadExec->Exec(&fn);
|
|
848 |
iENStoresStatus[aServerId][aPhoneId][aENStoreId] = ESessClosed;
|
|
849 |
}
|
|
850 |
}
|
|
851 |
|
|
852 |
/**
|
|
853 |
* Release a PhoneBookStore object
|
|
854 |
*/
|
|
855 |
void CEtelSessionMgr::ReleasePhoneBookStore(TServerId aServerId, TPhoneId aPhoneId, TPhoneBookStoreId aPhoneBookStoreId)
|
|
856 |
{
|
|
857 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::ReleasePhoneBookStore aServerId=%d aPhoneId=%d aPhoneBookStoreId=%d"), aServerId, aPhoneId, aPhoneBookStoreId);
|
|
858 |
if (iPhoneBookStoresStatus[aServerId][aPhoneId][aPhoneBookStoreId] == ESessOpenManually)
|
|
859 |
{
|
|
860 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TPhoneBookStoreId> fn(this,&CEtelSessionMgr::DoClosePhoneBookStoreL,aServerId,aPhoneId,aPhoneBookStoreId);
|
|
861 |
TInt err = iThreadExec->Exec(&fn);
|
|
862 |
iPhoneBookStoresStatus[aServerId][aPhoneId][aPhoneBookStoreId] = ESessClosed;
|
|
863 |
}
|
|
864 |
}
|
|
865 |
|
|
866 |
/**
|
|
867 |
* Release an SMS Store object
|
|
868 |
*/
|
|
869 |
void CEtelSessionMgr::ReleaseSmsStore(TServerId aServerId, TPhoneId aPhoneId,
|
|
870 |
TSmsMessagingId aSmsMessagingId, TSmsStoreId aSmsStoreId)
|
|
871 |
{
|
|
872 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::ReleaseSmsStore aServerId=%d aPhoneId=%d aSmsMessagingId=%d aSmsStoreId=%d"), aServerId, aPhoneId, aSmsMessagingId, aSmsStoreId);
|
|
873 |
if (iSmsStoresStatus[aServerId][aPhoneId][aSmsMessagingId][aSmsStoreId] == ESessOpenManually)
|
|
874 |
{
|
|
875 |
CThreadExec::TFunctorP4<CEtelSessionMgr, TServerId, TPhoneId, TSmsMessagingId, TSmsStoreId>
|
|
876 |
fn(this,&CEtelSessionMgr::DoCloseSmsStoreL,aServerId,aPhoneId,aSmsMessagingId,aSmsStoreId);
|
|
877 |
TInt err = iThreadExec->Exec(&fn);
|
|
878 |
iSmsStoresStatus[aServerId][aPhoneId][aSmsMessagingId][aSmsStoreId] = ESessClosed;
|
|
879 |
}
|
|
880 |
}
|
|
881 |
|
|
882 |
/**
|
|
883 |
* Release an SMS Messaging object
|
|
884 |
*/
|
|
885 |
void CEtelSessionMgr::ReleaseSmsMessaging(TServerId aServerId, TPhoneId aPhoneId, TSmsMessagingId aSmsMessagingId)
|
|
886 |
{
|
|
887 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::ReleaseSmsMessaging aServerId=%d aPhoneId=%d aSmsMessagingId=%d"), aServerId, aPhoneId, aSmsMessagingId);
|
|
888 |
if (iSmsMessagingsStatus[aServerId][aPhoneId][aSmsMessagingId] == ESessOpenManually)
|
|
889 |
{
|
|
890 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TSmsMessagingId> fn(this,&CEtelSessionMgr::DoCloseSmsMessagingL,aServerId,aPhoneId,aSmsMessagingId);
|
|
891 |
TInt err = iThreadExec->Exec(&fn);
|
|
892 |
iSmsMessagingsStatus[aServerId][aPhoneId][aSmsMessagingId] = ESessClosed;
|
|
893 |
}
|
|
894 |
}
|
|
895 |
|
|
896 |
/**
|
|
897 |
* Release a broadcast messaging object
|
|
898 |
*/
|
|
899 |
void CEtelSessionMgr::ReleaseBroadcastMessaging(TServerId aServerId, TPhoneId aPhoneId, TBroadcastMessagingId aBroadcastMessagingId)
|
|
900 |
{
|
|
901 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::ReleaseBroadcastMessaging aServerId=%d aPhoneId=%d aBroadcastMessagingId=%d"), aServerId, aPhoneId, aBroadcastMessagingId);
|
|
902 |
if (iBroadcastMessagingsStatus[aServerId][aPhoneId][aBroadcastMessagingId] == ESessOpenManually)
|
|
903 |
{
|
|
904 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TBroadcastMessagingId> fn(this,&CEtelSessionMgr::DoCloseBroadcastMessagingL,aServerId,aPhoneId,aBroadcastMessagingId);
|
|
905 |
TInt err = iThreadExec->Exec(&fn);
|
|
906 |
iBroadcastMessagingsStatus[aServerId][aPhoneId][aBroadcastMessagingId] = ESessClosed;
|
|
907 |
}
|
|
908 |
}
|
|
909 |
|
|
910 |
/**
|
|
911 |
* Release a UssdMessaging object
|
|
912 |
*/
|
|
913 |
void CEtelSessionMgr::ReleaseUssdMessaging(TServerId aServerId, TPhoneId aPhoneId, TUssdMessagingId aUssdMessagingId)
|
|
914 |
{
|
|
915 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::ReleaseUssdMessaging aServerId=%d aPhoneId=%d aUssdMessagingId=%d"), aServerId, aPhoneId, aUssdMessagingId);
|
|
916 |
if (iUssdMessagingsStatus[aServerId][aPhoneId][aUssdMessagingId] == ESessOpenManually)
|
|
917 |
{
|
|
918 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TUssdMessagingId> fn(this,&CEtelSessionMgr::DoCloseUssdMessagingL,aServerId,aPhoneId,aUssdMessagingId);
|
|
919 |
TInt err = iThreadExec->Exec(&fn);
|
|
920 |
iUssdMessagingsStatus[aServerId][aPhoneId][aUssdMessagingId] = ESessClosed;
|
|
921 |
}
|
|
922 |
}
|
|
923 |
|
|
924 |
/**
|
|
925 |
* Release a RMmCustomAPI object
|
|
926 |
*/
|
|
927 |
void CEtelSessionMgr::ReleaseCustomApi(TServerId aServerId, TPhoneId aPhoneId, TCustomApiId aCustomApiId)
|
|
928 |
{
|
|
929 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::ReleaseCustomApi aServerId=%d aPhoneId=%d aCustomApiId=%d"), aServerId, aPhoneId, aCustomApiId);
|
|
930 |
if (iCustomApisStatus[aServerId][aPhoneId][aCustomApiId] == ESessOpenManually)
|
|
931 |
{
|
|
932 |
CThreadExec::TFunctorP3<CEtelSessionMgr, TServerId, TPhoneId, TCustomApiId> fn(this,&CEtelSessionMgr::DoCloseCustomApiL,aServerId,aPhoneId,aCustomApiId);
|
|
933 |
TInt err = iThreadExec->Exec(&fn);
|
|
934 |
iCustomApisStatus[aServerId][aPhoneId][aCustomApiId] = ESessClosed;
|
|
935 |
}
|
|
936 |
}
|
|
937 |
|
|
938 |
|
|
939 |
//
|
|
940 |
// The following DoXXXMethods are called on the test suite server thread not on
|
|
941 |
// the test client thread
|
|
942 |
//
|
|
943 |
|
|
944 |
/**
|
|
945 |
* Called when OpenL is called to open the main subsessions
|
|
946 |
*/
|
|
947 |
void CEtelSessionMgr::DoOpenAutoSessL()
|
|
948 |
{
|
|
949 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::DoOpenAutoSessL"));
|
|
950 |
// only open the main sessions
|
|
951 |
DoOpenServerL(KMainServer);
|
|
952 |
iTelServersStatus[KMainServer] = ESessOpenAutomatically;
|
|
953 |
DoOpenPhoneL(KMainServer,KMainPhone);
|
|
954 |
iPhonesStatus[KMainServer][KMainPhone] = ESessOpenAutomatically;
|
|
955 |
// open all existings lines
|
|
956 |
for (TLineId lineId = KVoiceLine; lineId < KMaxLines; lineId = TLineId(lineId+1))
|
|
957 |
{
|
|
958 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::DoOpenAutoSessL open existing lines"));
|
|
959 |
if (iLinesName[lineId].Length() >0)
|
|
960 |
{
|
|
961 |
DoOpenLineL(KMainServer,KMainPhone,lineId) ;
|
|
962 |
iLinesStatus[KMainServer][KMainPhone][lineId] = ESessOpenAutomatically;
|
|
963 |
}
|
|
964 |
}
|
|
965 |
// open 2 calls on the main voice line (assume there is always a voice line)
|
|
966 |
DoOpenCallL(KMainServer,KMainPhone,KVoiceLine,KCall1);
|
|
967 |
iCallsStatus[KMainServer][KMainPhone][KVoiceLine][KCall1] = ESessOpenAutomatically;
|
|
968 |
DoOpenCallL(KMainServer,KMainPhone,KVoiceLine,KCall2);
|
|
969 |
iCallsStatus[KMainServer][KMainPhone][KVoiceLine][KCall2] = ESessOpenAutomatically;
|
|
970 |
}
|
|
971 |
|
|
972 |
/**
|
|
973 |
* Close all subsessions post test and prior to re-opening
|
|
974 |
*/
|
|
975 |
void CEtelSessionMgr::DoCloseAllSessL(TBool aIncludeAutoOpenedSess)
|
|
976 |
{
|
|
977 |
TEST_FRAMEWORK_LOG2(_L("CEtelSessionMgr::DoCloseAllSessL aIncludeAutoOpenedSess=%d"), aIncludeAutoOpenedSess);
|
|
978 |
// if aIncludeAutoOpenedSess, close sessions with staus ESessOpenAutomatically and ESessOpenManually
|
|
979 |
// else close only sessions with status ESessOpenManually
|
|
980 |
|
|
981 |
// comparison made is if( status >= iStatusCloseThresh)
|
|
982 |
iStatusCloseThresh = aIncludeAutoOpenedSess ? ESessOpenAutomatically : ESessOpenManually;
|
|
983 |
|
|
984 |
// do some cleanup before closing sessions
|
|
985 |
DoCleanup();
|
|
986 |
|
|
987 |
for (TServerId serverId = KMainServer; serverId < KMaxServers; serverId = TServerId(serverId+1))
|
|
988 |
{
|
|
989 |
for (TPhoneId phoneId = KMainPhone; phoneId < KMaxPhones; phoneId = TPhoneId(phoneId+1))
|
|
990 |
{
|
|
991 |
ClosePhoneSessL( serverId, phoneId );
|
|
992 |
}
|
|
993 |
|
|
994 |
// close servers
|
|
995 |
if (iTelServersStatus[serverId] >= iStatusCloseThresh)
|
|
996 |
{
|
|
997 |
DoCloseServerL(serverId);
|
|
998 |
iTelServersStatus[serverId] = ESessClosed;
|
|
999 |
}
|
|
1000 |
}
|
|
1001 |
}
|
|
1002 |
|
|
1003 |
|
|
1004 |
//
|
|
1005 |
// The following DoXXXMethods are called on the test suite server thread not on
|
|
1006 |
// the test client thread
|
|
1007 |
//
|
|
1008 |
|
|
1009 |
|
|
1010 |
/**
|
|
1011 |
* Cleanup all sessions and bring them back to the default configuration
|
|
1012 |
* ** default configuration to be defined***
|
|
1013 |
*/
|
|
1014 |
void CEtelSessionMgr::DoCleanup()
|
|
1015 |
{
|
|
1016 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::DoCleanup"));
|
|
1017 |
CleanupPacketService();
|
|
1018 |
CleanupPhoneService();
|
|
1019 |
}
|
|
1020 |
|
|
1021 |
/**
|
|
1022 |
* Cleanup phone service
|
|
1023 |
*/
|
|
1024 |
void CEtelSessionMgr::CleanupPhoneService()
|
|
1025 |
{
|
|
1026 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::CleanupPhoneService"));
|
|
1027 |
|
|
1028 |
// Phone cleanup
|
|
1029 |
RMobilePhone* phone = NULL;
|
|
1030 |
|
|
1031 |
TServerId serverId = KMainServer;
|
|
1032 |
while (serverId < KMaxServers && phone == NULL)
|
|
1033 |
{
|
|
1034 |
TPhoneId phoneId = KMainPhone;
|
|
1035 |
while (phoneId < KMaxPhones && phone == NULL)
|
|
1036 |
{
|
|
1037 |
if( iPhonesStatus[serverId][phoneId] != ESessClosed )
|
|
1038 |
{
|
|
1039 |
phone = &iPhones[serverId][phoneId];
|
|
1040 |
|
|
1041 |
TidyPhoneNotifiers( serverId, phoneId );
|
|
1042 |
|
|
1043 |
}
|
|
1044 |
phoneId = TPhoneId(phoneId+1);
|
|
1045 |
}
|
|
1046 |
serverId = TServerId(serverId+1);
|
|
1047 |
}
|
|
1048 |
|
|
1049 |
// a phone session is open
|
|
1050 |
if (phone)
|
|
1051 |
{
|
|
1052 |
TRequestStatus reqStatus;
|
|
1053 |
// terminate all calls
|
|
1054 |
phone->TerminateAllCalls(reqStatus);
|
|
1055 |
User::WaitForRequest(reqStatus);
|
|
1056 |
|
|
1057 |
}
|
|
1058 |
}
|
|
1059 |
|
|
1060 |
/**
|
|
1061 |
* Cleanup packet service
|
|
1062 |
*/
|
|
1063 |
void CEtelSessionMgr::CleanupPacketService()
|
|
1064 |
{
|
|
1065 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::CleanupPacketService"));
|
|
1066 |
|
|
1067 |
RPacketService* packetService = NULL;
|
|
1068 |
|
|
1069 |
TServerId serverId = KMainServer;
|
|
1070 |
while (serverId < KMaxServers && packetService == NULL)
|
|
1071 |
{
|
|
1072 |
TPhoneId phoneId = KMainPhone;
|
|
1073 |
while (phoneId < KMaxPhones && packetService == NULL)
|
|
1074 |
{
|
|
1075 |
TPacketServiceId packetServiceId = KMainPacketService;
|
|
1076 |
while (packetServiceId < KMaxPacketService && packetService == NULL)
|
|
1077 |
{
|
|
1078 |
if (iPacketServicesStatus[serverId][phoneId][packetServiceId] != ESessClosed)
|
|
1079 |
{
|
|
1080 |
packetService = &iPacketServices[serverId][phoneId][packetServiceId];
|
|
1081 |
}
|
|
1082 |
packetServiceId = TPacketServiceId(packetServiceId+1);
|
|
1083 |
}
|
|
1084 |
phoneId = TPhoneId(phoneId+1);
|
|
1085 |
}
|
|
1086 |
serverId = TServerId(serverId+1);
|
|
1087 |
}
|
|
1088 |
|
|
1089 |
if (packetService)
|
|
1090 |
{
|
|
1091 |
RPacketService::TStatus packetServiceStatus;
|
|
1092 |
TInt err = packetService->GetStatus(packetServiceStatus);
|
|
1093 |
if (packetServiceStatus != RPacketService::EStatusUnattached)
|
|
1094 |
{
|
|
1095 |
TRequestStatus status;
|
|
1096 |
packetService->Detach(status);
|
|
1097 |
User::WaitForRequest(status);
|
|
1098 |
}
|
|
1099 |
}
|
|
1100 |
}
|
|
1101 |
|
|
1102 |
|
|
1103 |
|
|
1104 |
//
|
|
1105 |
// The following DoOpenXXXMethods are called on the test suite server thread not on
|
|
1106 |
// the test client thread
|
|
1107 |
//
|
|
1108 |
|
|
1109 |
/**
|
|
1110 |
* Open the server subsession
|
|
1111 |
*/
|
|
1112 |
void CEtelSessionMgr::DoOpenServerL(TServerId aServerId)
|
|
1113 |
{
|
|
1114 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::DoOpenServerL"));
|
|
1115 |
User::LeaveIfError(iTelServers[aServerId].Connect());
|
|
1116 |
CleanupClosePushL(iTelServers[aServerId]);
|
|
1117 |
iTelServers[aServerId].ShareAuto();
|
|
1118 |
User::LeaveIfError(iTelServers[aServerId].SetExtendedErrorGranularity(RTelServer::EErrorExtended));
|
|
1119 |
CleanupStack::Pop(&iTelServers[aServerId]);
|
|
1120 |
User::LeaveIfError(iTelServers[aServerId].LoadPhoneModule(iTsyName));
|
|
1121 |
}
|
|
1122 |
|
|
1123 |
/**
|
|
1124 |
* Close the server
|
|
1125 |
*/
|
|
1126 |
void CEtelSessionMgr::DoCloseServerL(TServerId aServerId)
|
|
1127 |
{
|
|
1128 |
TEST_FRAMEWORK_LOG2(_L("CEtelSessionMgr::DoCloseServerL aServerId=%d"), aServerId);
|
|
1129 |
iTelServers[aServerId].UnloadPhoneModule(iTsyName);
|
|
1130 |
iTelServers[aServerId].Close();
|
|
1131 |
}
|
|
1132 |
|
|
1133 |
/**
|
|
1134 |
* Open a phone subsession
|
|
1135 |
*/
|
|
1136 |
void CEtelSessionMgr::DoOpenPhoneL(TServerId aServerId, TPhoneId aPhoneId)
|
|
1137 |
{
|
|
1138 |
TEST_FRAMEWORK_LOG3(_L("CEtelSessionMgr::DoOpenPhoneL aServerId=%d aPhoneId=%d"), aServerId, aPhoneId);
|
|
1139 |
TInt err = iPhones[aServerId][aPhoneId].Open(iTelServers[aServerId], iPhoneName);
|
|
1140 |
TEST_FRAMEWORK_LOG2(_L("iPhones[][].Open err=%d"), err);
|
|
1141 |
User::LeaveIfError(err);
|
|
1142 |
if (!iHaveLineNames)
|
|
1143 |
DoGetLineNamesL(iPhones[aServerId][aPhoneId]);
|
|
1144 |
}
|
|
1145 |
|
|
1146 |
/**
|
|
1147 |
* Close a phone subsession
|
|
1148 |
*/
|
|
1149 |
void CEtelSessionMgr::DoClosePhoneL(TServerId aServerId, TPhoneId aPhoneId)
|
|
1150 |
{
|
|
1151 |
TEST_FRAMEWORK_LOG3(_L("CEtelSessionMgr::DoClosePhoneL aServerId=%d aPhoneId=%d"), aServerId, aPhoneId);
|
|
1152 |
iPhones[aServerId][aPhoneId].Close();
|
|
1153 |
}
|
|
1154 |
|
|
1155 |
/**
|
|
1156 |
* Open a line subsession
|
|
1157 |
*/
|
|
1158 |
void CEtelSessionMgr::DoOpenLineL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId)
|
|
1159 |
{
|
|
1160 |
TEST_FRAMEWORK_LOG3(_L("CEtelSessionMgr::DoOpenLineL aServerId=%d aPhoneId=%d"), aServerId, aPhoneId);
|
|
1161 |
User::LeaveIfError(iLines[aServerId][aPhoneId][aLineId].Open(iPhones[aServerId][aPhoneId], iLinesName[aLineId]));
|
|
1162 |
}
|
|
1163 |
|
|
1164 |
/**
|
|
1165 |
* Close a line subsession
|
|
1166 |
*/
|
|
1167 |
void CEtelSessionMgr::DoCloseLineL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId)
|
|
1168 |
{
|
|
1169 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoCloseLineL aServerId=%d aPhoneId=%d aLineId=%d"), aServerId, aPhoneId, aLineId);
|
|
1170 |
iLines[aServerId][aPhoneId][aLineId].Close();
|
|
1171 |
}
|
|
1172 |
|
|
1173 |
/**
|
|
1174 |
* Open a call subsession
|
|
1175 |
*/
|
|
1176 |
void CEtelSessionMgr::DoOpenCallL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId)
|
|
1177 |
{
|
|
1178 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::DoOpenCallL aServerId=%d aPhoneId=%d aLineId=%d aCallId=%d"), aServerId, aPhoneId, aLineId, aCallId);
|
|
1179 |
|
|
1180 |
RMobileCall& call = iCalls[aServerId][aPhoneId][aLineId][aCallId];
|
|
1181 |
RMobileLine& line = iLines[aServerId][aPhoneId][aLineId];
|
|
1182 |
TRefCountItem& refCount = iCallsRefs[aLineId][aCallId];
|
|
1183 |
|
|
1184 |
TName callName;
|
|
1185 |
if( refCount.GetCount() )
|
|
1186 |
{
|
|
1187 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::DoOpenCallL calling RCall::OpenExistingCall"));
|
|
1188 |
callName = refCount.GetName();
|
|
1189 |
User::LeaveIfError( call.OpenExistingCall( line, callName) );
|
|
1190 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::DoOpenCallL called RCall::OpenExistingCall"));
|
|
1191 |
}
|
|
1192 |
else
|
|
1193 |
{
|
|
1194 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::DoOpenCallL calling RCall::OpenNewCall"));
|
|
1195 |
User::LeaveIfError(call.OpenNewCall(line, callName));
|
|
1196 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::DoOpenCallL called RCall::OpenNewCall"));
|
|
1197 |
}
|
|
1198 |
refCount.AddRef( callName );
|
|
1199 |
}
|
|
1200 |
|
|
1201 |
|
|
1202 |
/**
|
|
1203 |
* Assign a RMobilCall to be the incoming call.
|
|
1204 |
*/
|
|
1205 |
void CEtelSessionMgr::DoAssignCallToIncomingL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId, const TName& aIncomingCallName)
|
|
1206 |
{
|
|
1207 |
RMobileCall& call = iCalls[aServerId][aPhoneId][aLineId][aCallId];
|
|
1208 |
TRefCountItem& refCount = iCallsRefs[aLineId][aCallId];
|
|
1209 |
RMobileLine& line = iLines[aServerId][aPhoneId][aLineId];
|
|
1210 |
User::LeaveIfError(call.OpenExistingCall(line, aIncomingCallName));
|
|
1211 |
|
|
1212 |
// Check callname
|
|
1213 |
RCall::TCallInfo callInfo;
|
|
1214 |
User::LeaveIfError(call.GetInfo(callInfo));
|
|
1215 |
if(callInfo.iCallName != aIncomingCallName)
|
|
1216 |
{
|
|
1217 |
User::Leave(KErrGeneral);
|
|
1218 |
}
|
|
1219 |
refCount.AddRef( const_cast<TName&>(aIncomingCallName));
|
|
1220 |
}
|
|
1221 |
|
|
1222 |
|
|
1223 |
/**
|
|
1224 |
* Close a call subsession
|
|
1225 |
*/
|
|
1226 |
void CEtelSessionMgr::DoCloseCallL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId)
|
|
1227 |
{
|
|
1228 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::DoCloseCallL aServerId=%d aPhoneId=%d aLineId=%d aCallId=%d"), aServerId, aPhoneId, aLineId, aCallId);
|
|
1229 |
RMobileCall& call = iCalls[aServerId][aPhoneId][aLineId][aCallId];
|
|
1230 |
RCall::TStatus callStatus = RCall::EStatusIdle;
|
|
1231 |
call.GetStatus(callStatus); // ignore error
|
|
1232 |
if (callStatus != RCall::EStatusIdle)
|
|
1233 |
{
|
|
1234 |
call.HangUp();
|
|
1235 |
}
|
|
1236 |
call.Close();
|
|
1237 |
TRefCountItem& refCount = iCallsRefs[aLineId][aCallId];
|
|
1238 |
refCount.ReleaseL();
|
|
1239 |
}
|
|
1240 |
|
|
1241 |
|
|
1242 |
/**
|
|
1243 |
* Open a conference call subsession
|
|
1244 |
*/
|
|
1245 |
void CEtelSessionMgr::DoOpenConferenceCallL(TServerId aServerId, TPhoneId aPhoneId, TConferenceCallId aConferenceCallId)
|
|
1246 |
{
|
|
1247 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoOpenConferenceCallL aServerId=%d aPhoneId=%d aConferenceCallId=%d"), aServerId, aPhoneId, aConferenceCallId);
|
|
1248 |
RMobileConferenceCall& confCall = iConferenceCalls[aServerId][aPhoneId][aConferenceCallId];
|
|
1249 |
User::LeaveIfError(iConferenceCalls[aServerId][aPhoneId][aConferenceCallId].Open(iPhones[aServerId][aPhoneId]));
|
|
1250 |
}
|
|
1251 |
|
|
1252 |
|
|
1253 |
/**
|
|
1254 |
* Close a conference call subsession
|
|
1255 |
*/
|
|
1256 |
void CEtelSessionMgr::DoCloseConferenceCallL(TServerId aServerId, TPhoneId aPhoneId, TConferenceCallId aConferenceCallId)
|
|
1257 |
{
|
|
1258 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoCloseConferenceCallL aServerId=%d aPhoneId=%d aConferenceCallId=%d"), aServerId, aPhoneId, aConferenceCallId);
|
|
1259 |
iConferenceCalls[aServerId][aPhoneId][aConferenceCallId].Close();
|
|
1260 |
}
|
|
1261 |
|
|
1262 |
|
|
1263 |
/**
|
|
1264 |
* Open a RFax subsession
|
|
1265 |
*/
|
|
1266 |
void CEtelSessionMgr::DoOpenFaxL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId, TFaxId aFaxId)
|
|
1267 |
{
|
|
1268 |
TEST_FRAMEWORK_LOG6(_L("CEtelSessionMgr::DoOpenFaxL aServerId=%d aPhoneId=%d aLineId=%d aCallId=%d aFaxId=%d"), aServerId, aPhoneId, aLineId, aCallId, aFaxId);
|
|
1269 |
RFax &fax = iFaxes[aServerId][aPhoneId][aLineId][aCallId][aFaxId];
|
|
1270 |
User::LeaveIfError(fax.Open(iCalls[aServerId][aPhoneId][aLineId][aCallId]));
|
|
1271 |
}
|
|
1272 |
|
|
1273 |
/**
|
|
1274 |
* Close a RFax subsession
|
|
1275 |
*/
|
|
1276 |
void CEtelSessionMgr::DoCloseFaxL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId, TFaxId aFaxId)
|
|
1277 |
{
|
|
1278 |
TEST_FRAMEWORK_LOG6(_L("CEtelSessionMgr::DoCloseFaxL aServerId=%d aPhoneId=%d aLineId=%d aCallId=%d aFaxId=%d"), aServerId, aPhoneId, aLineId, aCallId, aFaxId);
|
|
1279 |
iFaxes[aServerId][aPhoneId][aLineId][aCallId][aFaxId].Close();
|
|
1280 |
}
|
|
1281 |
|
|
1282 |
|
|
1283 |
/**
|
|
1284 |
* Open a packet service subsession
|
|
1285 |
*/
|
|
1286 |
void CEtelSessionMgr::DoOpenPacketServiceL(TServerId aServerId, TPhoneId aPhoneId, TPacketServiceId aPacketServiceId)
|
|
1287 |
{
|
|
1288 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoOpenPacketServiceL aServerId=%d aPhoneId=%d aPacketServiceId=%d"), aServerId, aPhoneId, aPacketServiceId);
|
|
1289 |
RPacketService& packetService = iPacketServices[aServerId][aPhoneId][aPacketServiceId];
|
|
1290 |
User::LeaveIfError(packetService.Open(iPhones[aServerId][aPhoneId]));
|
|
1291 |
}
|
|
1292 |
|
|
1293 |
/**
|
|
1294 |
* Close a packet service subsession
|
|
1295 |
*/
|
|
1296 |
void CEtelSessionMgr::DoClosePacketServiceL(TServerId aServerId, TPhoneId aPhoneId, TPacketServiceId aPacketServiceId)
|
|
1297 |
{
|
|
1298 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoClosePacketServiceL aServerId=%d aPhoneId=%d aPacketServiceId=%d"), aServerId, aPhoneId, aPacketServiceId);
|
|
1299 |
iPacketServices[aServerId][aPhoneId][aPacketServiceId].Close();
|
|
1300 |
}
|
|
1301 |
|
|
1302 |
|
|
1303 |
/**
|
|
1304 |
* Open a primary packet context subsession
|
|
1305 |
*/
|
|
1306 |
void CEtelSessionMgr::DoOpenPrimaryPacketContextL(TServerId aServerId,
|
|
1307 |
TPhoneId aPhoneId,
|
|
1308 |
TPacketServiceId aPacketServiceId,
|
|
1309 |
TPrimaryPacketContextId aPrimaryPacketContextId)
|
|
1310 |
{
|
|
1311 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::DoOpenPrimaryPacketContextL aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId);
|
|
1312 |
RPacketService& packetService = iPacketServices[aServerId][aPhoneId][aPacketServiceId];
|
|
1313 |
RPacketContext& context = iPrimaryPacketContexts[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId];
|
|
1314 |
TRefCountItem& refCount = iPrimaryPacketContextRefs[aPrimaryPacketContextId];
|
|
1315 |
|
|
1316 |
TName contextName;
|
|
1317 |
if( refCount.GetCount() )
|
|
1318 |
{
|
|
1319 |
contextName = refCount.GetName();
|
|
1320 |
User::LeaveIfError( context.OpenExistingContext( packetService, contextName) );
|
|
1321 |
}
|
|
1322 |
else
|
|
1323 |
{
|
|
1324 |
User::LeaveIfError( context.OpenNewContext( packetService, contextName) );
|
|
1325 |
TEST_FRAMEWORK_LOG2(_L("CEtelSessionMgr::DoOpenPrimaryPacketContextL context name = %S"), &contextName);
|
|
1326 |
|
|
1327 |
// Open channel
|
|
1328 |
TUint channelNumber;
|
|
1329 |
TLex lex(contextName);
|
|
1330 |
while (!lex.Eos())
|
|
1331 |
{
|
|
1332 |
TInt err = lex.Val(channelNumber);
|
|
1333 |
TEST_FRAMEWORK_LOG3(_L("CEtelSessionMgr::DoOpenPrimaryPacketContextL err = %d, channel number = %d"), err, channelNumber);
|
|
1334 |
lex.Inc();
|
|
1335 |
};
|
|
1336 |
|
|
1337 |
TEST_FRAMEWORK_LOG2(_L("CEtelSessionMgr::DoOpenPrimaryPacketContextL channel number = %d"), channelNumber);
|
|
1338 |
TRequestStatus status;
|
|
1339 |
RPacketContext::TDataChannelV2 dataChannel;
|
|
1340 |
TPckg<RPacketContext::TDataChannelV2> dataChannelPckg(dataChannel);
|
|
1341 |
context.InitialiseContext(status,dataChannelPckg);
|
|
1342 |
User::WaitForRequest(status);
|
|
1343 |
|
|
1344 |
if (status.Int() != KErrNone)
|
|
1345 |
{
|
|
1346 |
TEST_FRAMEWORK_LOG2(_L("CEtelSessionMgr::DoOpenPrimaryPacketContextL Failed to Initialise Context error = %d"), status.Int());
|
|
1347 |
User::Leave(status.Int());
|
|
1348 |
}
|
|
1349 |
}
|
|
1350 |
refCount.AddRef( contextName );
|
|
1351 |
}
|
|
1352 |
|
|
1353 |
|
|
1354 |
/**
|
|
1355 |
* Close a primary packet context subsession
|
|
1356 |
*/
|
|
1357 |
void CEtelSessionMgr::DoClosePrimaryPacketContextL(TServerId aServerId, TPhoneId aPhoneId,
|
|
1358 |
TPacketServiceId aPacketServiceId, TPrimaryPacketContextId aPrimaryPacketContextId)
|
|
1359 |
{
|
|
1360 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::DoClosePrimaryPacketContextL aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId);
|
|
1361 |
RPacketContext& context = iPrimaryPacketContexts[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId];
|
|
1362 |
TRefCountItem& refCount = iPrimaryPacketContextRefs[aPrimaryPacketContextId];
|
|
1363 |
|
|
1364 |
context.Close();
|
|
1365 |
refCount.ReleaseL();
|
|
1366 |
|
|
1367 |
}
|
|
1368 |
|
|
1369 |
|
|
1370 |
/**
|
|
1371 |
* Open the RPacketQos for a primary packet context
|
|
1372 |
*/
|
|
1373 |
void CEtelSessionMgr::DoOpenPrimaryPacketContextQoSL(TServerId aServerId,
|
|
1374 |
TPhoneId aPhoneId,
|
|
1375 |
TPacketServiceId aPacketServiceId,
|
|
1376 |
TPrimaryPacketContextId aPrimaryPacketContextId)
|
|
1377 |
{
|
|
1378 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::DoOpenPrimaryPacketContextQoSL aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId);
|
|
1379 |
RPacketContext& context = iPrimaryPacketContexts[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId];
|
|
1380 |
RPacketQoS& qos = iPrimaryPacketContextQoSs[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId];
|
|
1381 |
TRefCountItem& refCount = iPrimaryPacketContextQoSRefs[aPrimaryPacketContextId];
|
|
1382 |
|
|
1383 |
TName serviceName;
|
|
1384 |
if( refCount.GetCount() )
|
|
1385 |
{
|
|
1386 |
serviceName = refCount.GetName();
|
|
1387 |
User::LeaveIfError( qos.OpenExistingQoS( context, serviceName) );
|
|
1388 |
}
|
|
1389 |
else
|
|
1390 |
{
|
|
1391 |
User::LeaveIfError( qos.OpenNewQoS( context, serviceName) );
|
|
1392 |
}
|
|
1393 |
refCount.AddRef( serviceName );
|
|
1394 |
}
|
|
1395 |
|
|
1396 |
|
|
1397 |
/**
|
|
1398 |
* Close the RPacketQos for a primary packet context
|
|
1399 |
*/
|
|
1400 |
void CEtelSessionMgr::DoClosePrimaryPacketContextQoSL(TServerId aServerId, TPhoneId aPhoneId,
|
|
1401 |
TPacketServiceId aPacketServiceId, TPrimaryPacketContextId aPrimaryPacketContextId)
|
|
1402 |
{
|
|
1403 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::DoClosePrimaryPacketContextQoSL aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId);
|
|
1404 |
RPacketQoS& qos = iPrimaryPacketContextQoSs[aServerId][aPhoneId][aPacketServiceId][aPrimaryPacketContextId];
|
|
1405 |
TRefCountItem& refCount = iPrimaryPacketContextQoSRefs[aPrimaryPacketContextId];
|
|
1406 |
|
|
1407 |
qos.Close();
|
|
1408 |
refCount.ReleaseL();
|
|
1409 |
}
|
|
1410 |
|
|
1411 |
/**
|
|
1412 |
* Open a secondary packet context subsession
|
|
1413 |
*/
|
|
1414 |
void CEtelSessionMgr::DoOpenSecondaryPacketContextL(TServerId aServerId, TPhoneId aPhoneId,
|
|
1415 |
TPacketServiceId aPacketServiceId,
|
|
1416 |
TPrimaryPacketContextId aPrimaryPacketContextId,
|
|
1417 |
TSecondaryPacketContextId aSecondaryPacketContextId )
|
|
1418 |
|
|
1419 |
{
|
|
1420 |
TEST_FRAMEWORK_LOG6(_L("CEtelSessionMgr::DoOpenSecondaryPacketContextL aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d aSecondaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId, aSecondaryPacketContextId);
|
|
1421 |
RPacketService &packetService = iPacketServices[aServerId][aPhoneId][aPacketServiceId];
|
|
1422 |
RPacketContext& secContext = iSecondaryPacketContexts[aServerId][aPhoneId][aPacketServiceId]
|
|
1423 |
[aPrimaryPacketContextId][aSecondaryPacketContextId];
|
|
1424 |
|
|
1425 |
TRefCountItem& secRefCount = iSecondaryPacketContextRefs[aPrimaryPacketContextId][aSecondaryPacketContextId];
|
|
1426 |
|
|
1427 |
TName serviceName;
|
|
1428 |
if( secRefCount.GetCount() )
|
|
1429 |
|
|
1430 |
{
|
|
1431 |
serviceName = secRefCount.GetName();
|
|
1432 |
User::LeaveIfError( secContext.OpenExistingContext( packetService, serviceName) );
|
|
1433 |
}
|
|
1434 |
else
|
|
1435 |
{
|
|
1436 |
// Get the related primary context name
|
|
1437 |
TRefCountItem& priRefCount = iPrimaryPacketContextRefs[aPrimaryPacketContextId];
|
|
1438 |
|
|
1439 |
if( !priRefCount.GetCount() )
|
|
1440 |
{
|
|
1441 |
User::Leave( KErrGeneral );
|
|
1442 |
}
|
|
1443 |
|
|
1444 |
User::LeaveIfError( secContext.OpenNewSecondaryContext( packetService, priRefCount.GetName(), serviceName) );
|
|
1445 |
|
|
1446 |
// Open channel
|
|
1447 |
TUint channelNumber;
|
|
1448 |
TLex lex(serviceName);
|
|
1449 |
while (!lex.Eos())
|
|
1450 |
{
|
|
1451 |
TInt err = lex.Val(channelNumber);
|
|
1452 |
TEST_FRAMEWORK_LOG3(_L("CEtelSessionMgr::DoOpenSecondaryPacketContextL err = %d, channel number = %d"), err, channelNumber);
|
|
1453 |
lex.Inc();
|
|
1454 |
};
|
|
1455 |
|
|
1456 |
TEST_FRAMEWORK_LOG2(_L("CEtelSessionMgr::DoOpenSecondaryPacketContextL channel number = %d"), channelNumber);
|
|
1457 |
TRequestStatus status;
|
|
1458 |
|
|
1459 |
RPacketContext::TDataChannelV2 dataChannel;
|
|
1460 |
TPckg<RPacketContext::TDataChannelV2> dataChannelPckg(dataChannel);
|
|
1461 |
secContext.InitialiseContext(status,dataChannelPckg);
|
|
1462 |
User::WaitForRequest(status);
|
|
1463 |
|
|
1464 |
if (status.Int() != KErrNone)
|
|
1465 |
{
|
|
1466 |
TEST_FRAMEWORK_LOG2(_L("CEtelSessionMgr::DoOpenSecondaryPacketContextL Failed to Initialise Context error = %d"), status.Int());
|
|
1467 |
User::Leave(status.Int());
|
|
1468 |
}
|
|
1469 |
|
|
1470 |
}
|
|
1471 |
|
|
1472 |
secRefCount.AddRef( serviceName );
|
|
1473 |
}
|
|
1474 |
|
|
1475 |
|
|
1476 |
/**
|
|
1477 |
* Close a secondary packet context subsession
|
|
1478 |
*/
|
|
1479 |
void CEtelSessionMgr::DoCloseSecondaryPacketContextL(TServerId aServerId, TPhoneId aPhoneId,
|
|
1480 |
TPacketServiceId aPacketServiceId,
|
|
1481 |
TPrimaryPacketContextId aPrimaryPacketContextId,
|
|
1482 |
TSecondaryPacketContextId aSecondaryPacketContextId )
|
|
1483 |
{
|
|
1484 |
TEST_FRAMEWORK_LOG6(_L("CEtelSessionMgr::DoCloseSecondaryPacketContextL aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d aSecondaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId, aSecondaryPacketContextId);
|
|
1485 |
RPacketContext& secContext = iSecondaryPacketContexts[aServerId][aPhoneId][aPacketServiceId]
|
|
1486 |
[aPrimaryPacketContextId][aSecondaryPacketContextId];
|
|
1487 |
|
|
1488 |
TRefCountItem& secRefCount = iSecondaryPacketContextRefs[aPrimaryPacketContextId][aSecondaryPacketContextId];
|
|
1489 |
|
|
1490 |
secContext.Close();
|
|
1491 |
secRefCount.ReleaseL();
|
|
1492 |
}
|
|
1493 |
|
|
1494 |
/**
|
|
1495 |
* Open the RPacketQos for a secondary packet context
|
|
1496 |
*/
|
|
1497 |
void CEtelSessionMgr::DoOpenSecondaryPacketContextQoSL(TServerId aServerId,
|
|
1498 |
TPhoneId aPhoneId,
|
|
1499 |
TPacketServiceId aPacketServiceId,
|
|
1500 |
TPrimaryPacketContextId aPrimaryPacketContextId,
|
|
1501 |
TSecondaryPacketContextId aSecondaryPacketContextId)
|
|
1502 |
{
|
|
1503 |
TEST_FRAMEWORK_LOG6(_L("CEtelSessionMgr::DoOpenSecondaryPacketContextQoSL aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d aSecondaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId, aSecondaryPacketContextId);
|
|
1504 |
RPacketContext& context = iSecondaryPacketContexts[aServerId][aPhoneId][aPacketServiceId]
|
|
1505 |
[aPrimaryPacketContextId][aSecondaryPacketContextId];
|
|
1506 |
RPacketQoS& qos = iSecondaryPacketContextQoSs[aServerId][aPhoneId][aPacketServiceId]
|
|
1507 |
[aPrimaryPacketContextId][aSecondaryPacketContextId];
|
|
1508 |
|
|
1509 |
TRefCountItem& refCount = iSecondaryPacketContextQoSRefs[aPrimaryPacketContextId][aSecondaryPacketContextId];
|
|
1510 |
|
|
1511 |
TName serviceName;
|
|
1512 |
if( refCount.GetCount() )
|
|
1513 |
{
|
|
1514 |
serviceName = refCount.GetName();
|
|
1515 |
User::LeaveIfError( qos.OpenExistingQoS( context, serviceName) );
|
|
1516 |
}
|
|
1517 |
else
|
|
1518 |
{
|
|
1519 |
User::LeaveIfError( qos.OpenNewQoS( context, serviceName) );
|
|
1520 |
}
|
|
1521 |
refCount.AddRef( serviceName );
|
|
1522 |
}
|
|
1523 |
|
|
1524 |
|
|
1525 |
/**
|
|
1526 |
* Close the RPacketQos for a secondary packet context
|
|
1527 |
*/
|
|
1528 |
void CEtelSessionMgr::DoCloseSecondaryPacketContextQoSL(TServerId aServerId, TPhoneId aPhoneId,
|
|
1529 |
TPacketServiceId aPacketServiceId,
|
|
1530 |
TPrimaryPacketContextId aPrimaryPacketContextId,
|
|
1531 |
TSecondaryPacketContextId aSecondaryPacketContextId)
|
|
1532 |
{
|
|
1533 |
TEST_FRAMEWORK_LOG6(_L("CEtelSessionMgr::DoCloseSecondaryPacketContextQoSL aServerId=%d aPhoneId=%d aPacketServiceId=%d aPrimaryPacketContextId=%d aSecondaryPacketContextId=%d"), aServerId, aPhoneId, aPacketServiceId, aPrimaryPacketContextId, aSecondaryPacketContextId);
|
|
1534 |
RPacketQoS& qos = iSecondaryPacketContextQoSs[aServerId][aPhoneId][aPacketServiceId]
|
|
1535 |
[aPrimaryPacketContextId][aSecondaryPacketContextId];
|
|
1536 |
|
|
1537 |
TRefCountItem& refCount = iSecondaryPacketContextQoSRefs[aPrimaryPacketContextId][aSecondaryPacketContextId];
|
|
1538 |
|
|
1539 |
qos.Close();
|
|
1540 |
refCount.ReleaseL();
|
|
1541 |
}
|
|
1542 |
|
|
1543 |
/**
|
|
1544 |
* Open a RMobileONStore subsession
|
|
1545 |
*/
|
|
1546 |
void CEtelSessionMgr::DoOpenONStoreL(TServerId aServerId, TPhoneId aPhoneId, TONStoreId aONStoreId)
|
|
1547 |
{
|
|
1548 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoOpenONStoreL aServerId=%d aPhoneId=%d aONStoreId=%d"), aServerId, aPhoneId, aONStoreId);
|
|
1549 |
RMobileONStore& ONStore = iONStores[aServerId][aPhoneId][aONStoreId];
|
|
1550 |
User::LeaveIfError(ONStore.Open(iPhones[aServerId][aPhoneId]));
|
|
1551 |
}
|
|
1552 |
|
|
1553 |
/**
|
|
1554 |
* Close a RMobileONStore subsession
|
|
1555 |
*/
|
|
1556 |
void CEtelSessionMgr::DoCloseONStoreL(TServerId aServerId, TPhoneId aPhoneId, TONStoreId aONStoreId)
|
|
1557 |
{
|
|
1558 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoCloseONStoreL aServerId=%d aPhoneId=%d aONStoreId=%d"), aServerId, aPhoneId, aONStoreId);
|
|
1559 |
iONStores[aServerId][aPhoneId][aONStoreId].Close();
|
|
1560 |
}
|
|
1561 |
|
|
1562 |
/**
|
|
1563 |
* Open a RMobileENStore subsession
|
|
1564 |
*/
|
|
1565 |
void CEtelSessionMgr::DoOpenENStoreL(TServerId aServerId, TPhoneId aPhoneId, TENStoreId aENStoreId)
|
|
1566 |
{
|
|
1567 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoOpenENStoreL aServerId=%d aPhoneId=%d aENStoreId=%d"), aServerId, aPhoneId, aENStoreId);
|
|
1568 |
RMobileENStore& ENStore = iENStores[aServerId][aPhoneId][aENStoreId];
|
|
1569 |
User::LeaveIfError(ENStore.Open(iPhones[aServerId][aPhoneId]));
|
|
1570 |
}
|
|
1571 |
|
|
1572 |
/**
|
|
1573 |
* Close a RMobileENStore subsession
|
|
1574 |
*/
|
|
1575 |
void CEtelSessionMgr::DoCloseENStoreL(TServerId aServerId, TPhoneId aPhoneId, TENStoreId aENStoreId)
|
|
1576 |
{
|
|
1577 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoCloseENStoreL aServerId=%d aPhoneId=%d aENStoreId=%d"), aServerId, aPhoneId, aENStoreId);
|
|
1578 |
iENStores[aServerId][aPhoneId][aENStoreId].Close();
|
|
1579 |
}
|
|
1580 |
|
|
1581 |
/**
|
|
1582 |
* Open a RMobilePhoneBookStore subsession
|
|
1583 |
*/
|
|
1584 |
void CEtelSessionMgr::DoOpenPhoneBookStoreL(TServerId aServerId, TPhoneId aPhoneId, TPhoneBookStoreId aPhoneBookStoreId)
|
|
1585 |
{
|
|
1586 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoOpenPhoneBookStoreL aServerId=%d aPhoneId=%d aPhoneBookStoreId=%d"), aServerId, aPhoneId, aPhoneBookStoreId);
|
|
1587 |
RMobilePhoneBookStore& PhoneBookStore = iPhoneBookStores[aServerId][aPhoneId][aPhoneBookStoreId];
|
|
1588 |
User::LeaveIfError(PhoneBookStore.Open(iPhones[aServerId][aPhoneId],iPhoneBookStoreNames[aPhoneBookStoreId]));
|
|
1589 |
}
|
|
1590 |
|
|
1591 |
/**
|
|
1592 |
* Close a RMobilePhoneBookStore subsession
|
|
1593 |
*/
|
|
1594 |
void CEtelSessionMgr::DoClosePhoneBookStoreL(TServerId aServerId, TPhoneId aPhoneId, TPhoneBookStoreId aPhoneBookStoreId)
|
|
1595 |
{
|
|
1596 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoClosePhoneBookStoreL aServerId=%d aPhoneId=%d aPhoneBookStoreId=%d"), aServerId, aPhoneId, aPhoneBookStoreId);
|
|
1597 |
iPhoneBookStores[aServerId][aPhoneId][aPhoneBookStoreId].Close();
|
|
1598 |
}
|
|
1599 |
|
|
1600 |
/**
|
|
1601 |
* Open a RMobileSmsStore subsession
|
|
1602 |
*/
|
|
1603 |
void CEtelSessionMgr::DoOpenSmsStoreL(TServerId aServerId, TPhoneId aPhoneId,
|
|
1604 |
TSmsMessagingId aSmsMessagingId, TSmsStoreId aSmsStoreId)
|
|
1605 |
{
|
|
1606 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::DoOpenSmsStoreL aServerId=%d aPhoneId=%d aSmsMessagingId=%d aSmsStoreId=%d"), aServerId, aPhoneId, aSmsMessagingId, aSmsStoreId);
|
|
1607 |
RMobileSmsStore& SmsStore = iSmsStores[aServerId][aPhoneId][aSmsMessagingId][aSmsStoreId];
|
|
1608 |
User::LeaveIfError(SmsStore.Open(iSmsMessagings[aServerId][aPhoneId][aSmsMessagingId],*iSmsStoreNames[aSmsStoreId]));
|
|
1609 |
}
|
|
1610 |
|
|
1611 |
/**
|
|
1612 |
* Close a RMobileSmsStore subsession
|
|
1613 |
*/
|
|
1614 |
void CEtelSessionMgr::DoCloseSmsStoreL(TServerId aServerId, TPhoneId aPhoneId,
|
|
1615 |
TSmsMessagingId aSmsMessagingId, TSmsStoreId aSmsStoreId)
|
|
1616 |
{
|
|
1617 |
TEST_FRAMEWORK_LOG5(_L("CEtelSessionMgr::DoCloseSmsStoreL aServerId=%d aPhoneId=%d aSmsMessagingId=%d aSmsStoreId=%d"), aServerId, aPhoneId, aSmsMessagingId, aSmsStoreId);
|
|
1618 |
iSmsStores[aServerId][aPhoneId][aSmsMessagingId][aSmsStoreId].Close();
|
|
1619 |
}
|
|
1620 |
|
|
1621 |
/**
|
|
1622 |
* Open a RMobileSmsMessaging subsession
|
|
1623 |
*/
|
|
1624 |
void CEtelSessionMgr::DoOpenSmsMessagingL(TServerId aServerId, TPhoneId aPhoneId, TSmsMessagingId aSmsMessagingId)
|
|
1625 |
{
|
|
1626 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoOpenSmsMessagingL aServerId=%d aPhoneId=%d aSmsMessagingId=%d"), aServerId, aPhoneId, aSmsMessagingId);
|
|
1627 |
RMobileSmsMessaging& SmsMessaging = iSmsMessagings[aServerId][aPhoneId][aSmsMessagingId];
|
|
1628 |
User::LeaveIfError(SmsMessaging.Open(iPhones[aServerId][aPhoneId]));
|
|
1629 |
}
|
|
1630 |
|
|
1631 |
/**
|
|
1632 |
* Close a RMobileSmsMessaging subsession
|
|
1633 |
*/
|
|
1634 |
void CEtelSessionMgr::DoCloseSmsMessagingL(TServerId aServerId, TPhoneId aPhoneId, TSmsMessagingId aSmsMessagingId)
|
|
1635 |
{
|
|
1636 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoCloseSmsMessagingL aServerId=%d aPhoneId=%d aSmsMessagingId=%d"), aServerId, aPhoneId, aSmsMessagingId);
|
|
1637 |
iSmsMessagings[aServerId][aPhoneId][aSmsMessagingId].Close();
|
|
1638 |
}
|
|
1639 |
|
|
1640 |
/**
|
|
1641 |
* Open a RMobileBroadcastMessaging subsession
|
|
1642 |
*/
|
|
1643 |
void CEtelSessionMgr::DoOpenBroadcastMessagingL(TServerId aServerId, TPhoneId aPhoneId, TBroadcastMessagingId aBroadcastMessagingId)
|
|
1644 |
{
|
|
1645 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoOpenBroadcastMessagingL aServerId=%d aPhoneId=%d aBroadcastMessagingId=%d"), aServerId, aPhoneId, aBroadcastMessagingId);
|
|
1646 |
RMobileBroadcastMessaging& BroadcastMessaging = iBroadcastMessagings[aServerId][aPhoneId][aBroadcastMessagingId];
|
|
1647 |
User::LeaveIfError(BroadcastMessaging.Open(iPhones[aServerId][aPhoneId]));
|
|
1648 |
}
|
|
1649 |
|
|
1650 |
/**
|
|
1651 |
* Close a RMobileBroadcastMessaging subsession
|
|
1652 |
*/
|
|
1653 |
void CEtelSessionMgr::DoCloseBroadcastMessagingL(TServerId aServerId, TPhoneId aPhoneId, TBroadcastMessagingId aBroadcastMessagingId)
|
|
1654 |
{
|
|
1655 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoCloseBroadcastMessagingL aServerId=%d aPhoneId=%d aBroadcastMessagingId=%d"), aServerId, aPhoneId, aBroadcastMessagingId);
|
|
1656 |
iBroadcastMessagings[aServerId][aPhoneId][aBroadcastMessagingId].Close();
|
|
1657 |
}
|
|
1658 |
|
|
1659 |
/**
|
|
1660 |
* Open a RMobileUssdMessaging subsession
|
|
1661 |
*/
|
|
1662 |
void CEtelSessionMgr::DoOpenUssdMessagingL(TServerId aServerId, TPhoneId aPhoneId, TUssdMessagingId aUssdMessagingId)
|
|
1663 |
{
|
|
1664 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoOpenUssdMessagingL aServerId=%d aPhoneId=%d aUssdMessagingId=%d"), aServerId, aPhoneId, aUssdMessagingId);
|
|
1665 |
RMobileUssdMessaging& ussdMessaging = iUssdMessagings[aServerId][aPhoneId][aUssdMessagingId];
|
|
1666 |
User::LeaveIfError(ussdMessaging.Open(iPhones[aServerId][aPhoneId]));
|
|
1667 |
}
|
|
1668 |
|
|
1669 |
/**
|
|
1670 |
* Close a RMobileUssdMessaging subsession
|
|
1671 |
*/
|
|
1672 |
void CEtelSessionMgr::DoCloseUssdMessagingL(TServerId aServerId, TPhoneId aPhoneId, TUssdMessagingId aUssdMessagingId)
|
|
1673 |
{
|
|
1674 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoCloseUssdMessagingL aServerId=%d aPhoneId=%d aUssdMessagingId=%d"), aServerId, aPhoneId, aUssdMessagingId);
|
|
1675 |
iUssdMessagings[aServerId][aPhoneId][aUssdMessagingId].Close();
|
|
1676 |
}
|
|
1677 |
|
|
1678 |
/**
|
|
1679 |
* Open a RMmCustomAPI subsession
|
|
1680 |
*/
|
|
1681 |
void CEtelSessionMgr::DoOpenCustomApiL(TServerId aServerId, TPhoneId aPhoneId, TCustomApiId aCustomApiId)
|
|
1682 |
{
|
|
1683 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoOpenCustomApiL aServerId=%d aPhoneId=%d aCustomApiId=%d"), aServerId, aPhoneId, aCustomApiId);
|
|
1684 |
RMmCustomAPI& customApi = iCustomApis[aServerId][aPhoneId][aCustomApiId];
|
|
1685 |
User::LeaveIfError(customApi.Open(iPhones[aServerId][aPhoneId]));
|
|
1686 |
}
|
|
1687 |
|
|
1688 |
/**
|
|
1689 |
* Close a RMmCustomAPI subsession
|
|
1690 |
*/
|
|
1691 |
void CEtelSessionMgr::DoCloseCustomApiL(TServerId aServerId, TPhoneId aPhoneId, TCustomApiId aCustomApiId)
|
|
1692 |
{
|
|
1693 |
TEST_FRAMEWORK_LOG4(_L("CEtelSessionMgr::DoCloseCustomApiL aServerId=%d aPhoneId=%d aCustomApiId=%d"), aServerId, aPhoneId, aCustomApiId);
|
|
1694 |
iCustomApis[aServerId][aPhoneId][aCustomApiId].Close();
|
|
1695 |
}
|
|
1696 |
|
|
1697 |
|
|
1698 |
/**
|
|
1699 |
* Load the line names into our members
|
|
1700 |
*/
|
|
1701 |
void CEtelSessionMgr::DoGetLineNamesL(RPhone& aPhone)
|
|
1702 |
{
|
|
1703 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::DoGetLineNamesL"));
|
|
1704 |
//get line info for the phone
|
|
1705 |
TInt cnt;
|
|
1706 |
User::LeaveIfError(aPhone.EnumerateLines(cnt));
|
|
1707 |
|
|
1708 |
RPhone::TLineInfo info;
|
|
1709 |
for(TInt i = 0; i < cnt; i++)
|
|
1710 |
{
|
|
1711 |
User::LeaveIfError(aPhone.GetLineInfo(i, info));
|
|
1712 |
if(info.iLineCapsFlags & RLine::KCapsData)
|
|
1713 |
{
|
|
1714 |
iLinesName[KDataLine] = info.iName;
|
|
1715 |
}
|
|
1716 |
else if(info.iLineCapsFlags & RLine::KCapsVoice)
|
|
1717 |
{
|
|
1718 |
iLinesName[KVoiceLine] = info.iName;
|
|
1719 |
}
|
|
1720 |
else if(info.iLineCapsFlags & RMobileLine::KCapsAuxVoice)
|
|
1721 |
{
|
|
1722 |
iLinesName[KAuxLine] = info.iName;
|
|
1723 |
}
|
|
1724 |
else if(info.iLineCapsFlags & RLine::KCapsFax)
|
|
1725 |
{
|
|
1726 |
iLinesName[KFaxLine] = info.iName;
|
|
1727 |
}
|
|
1728 |
}
|
|
1729 |
iHaveLineNames = ETrue;
|
|
1730 |
}
|
|
1731 |
|
|
1732 |
|
|
1733 |
/**
|
|
1734 |
* TRefCountItem - C'tor
|
|
1735 |
*/
|
|
1736 |
CEtelSessionMgr::TRefCountItem::TRefCountItem() : iRefCount(0)
|
|
1737 |
{
|
|
1738 |
|
|
1739 |
}
|
|
1740 |
|
|
1741 |
/**
|
|
1742 |
* Returns count before add operation, i.e. zero if new
|
|
1743 |
*/
|
|
1744 |
TInt CEtelSessionMgr::TRefCountItem::AddRef(TDesC &aName)
|
|
1745 |
{
|
|
1746 |
if( !iRefCount )
|
|
1747 |
{
|
|
1748 |
iName = aName;
|
|
1749 |
}
|
|
1750 |
return iRefCount++;
|
|
1751 |
}
|
|
1752 |
|
|
1753 |
/**
|
|
1754 |
* Returns count after release operation, i.e. zero if now unused
|
|
1755 |
* Leaves if the count was already 0
|
|
1756 |
*/
|
|
1757 |
TInt CEtelSessionMgr::TRefCountItem::ReleaseL()
|
|
1758 |
{
|
|
1759 |
if( !iRefCount )
|
|
1760 |
{
|
|
1761 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::TRefCountItem::ReleaseL Leaving with KErrNotFound!"));
|
|
1762 |
User::Leave(KErrNotFound);
|
|
1763 |
}
|
|
1764 |
return --iRefCount;
|
|
1765 |
}
|
|
1766 |
|
|
1767 |
/**
|
|
1768 |
* Returns the reference count
|
|
1769 |
*/
|
|
1770 |
TInt CEtelSessionMgr::TRefCountItem::GetCount() const
|
|
1771 |
{
|
|
1772 |
TEST_FRAMEWORK_LOG1(_L("CEtelSessionMgr::TRefCountItem::GetCount iRefCount"));
|
|
1773 |
return iRefCount;
|
|
1774 |
}
|
|
1775 |
|
|
1776 |
/**
|
|
1777 |
* Returns a reference to the name associated with the ref count
|
|
1778 |
*/
|
|
1779 |
const TName& CEtelSessionMgr::TRefCountItem::GetName() const
|
|
1780 |
{
|
|
1781 |
return iName;
|
|
1782 |
}
|
|
1783 |
|
|
1784 |
void CEtelSessionMgr::AsyncExec(CThreadExec::MFunctor *aFunction)
|
|
1785 |
/**
|
|
1786 |
* Execute a function asynchronously.
|
|
1787 |
* @param aFunction the function to execute
|
|
1788 |
*/
|
|
1789 |
{
|
|
1790 |
iThreadExec->AsyncExec(aFunction);
|
|
1791 |
}
|
|
1792 |
|
|
1793 |
void CEtelSessionMgr::SyncExec(CThreadExec::MFunctor *aFunction)
|
|
1794 |
/**
|
|
1795 |
* Execute a function synchronously from another thread.
|
|
1796 |
* @param aFunction the function to execute
|
|
1797 |
*/
|
|
1798 |
{
|
|
1799 |
iThreadExec->Exec(aFunction);
|
|
1800 |
}
|
|
1801 |
|