24
|
1 |
// Copyright (c) 2006-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 |
|
|
17 |
|
|
18 |
//INCLUDE FILES
|
|
19 |
#include "cmmnettsy.h"
|
|
20 |
#include "cmmphonetsy.h"
|
|
21 |
#include "cmmtsyreqhandlestore.h"
|
|
22 |
#include <ctsy/pluginapi/cmmdatapackage.h>
|
|
23 |
#include "cmmmessagemanagerbase.h"
|
|
24 |
#include "cmmphoneextinterface.h"
|
|
25 |
#include "cmmcalllist.h"
|
|
26 |
#include "cmmcalltsy.h"
|
|
27 |
#include "CMmCommonStaticUtility.h"
|
|
28 |
#include <ctsy/serviceapi/gsmerror.h>
|
|
29 |
|
|
30 |
// ======== MEMBER FUNCTIONS ========
|
|
31 |
|
|
32 |
CMmNetTsy* CMmNetTsy::NewL(
|
|
33 |
CMmPhoneTsy* aPhoneTsy )
|
|
34 |
{
|
|
35 |
CMmNetTsy* const mmNetTsy = new ( ELeave ) CMmNetTsy();
|
|
36 |
CleanupStack::PushL( mmNetTsy );
|
|
37 |
mmNetTsy->iMmPhoneTsy = aPhoneTsy;
|
|
38 |
mmNetTsy->ConstructL();
|
|
39 |
CleanupStack::Pop();
|
|
40 |
return mmNetTsy;
|
|
41 |
}
|
|
42 |
|
|
43 |
CMmNetTsy::CMmNetTsy()
|
|
44 |
{
|
|
45 |
}
|
|
46 |
|
|
47 |
void CMmNetTsy::ConstructL()
|
|
48 |
{
|
|
49 |
TFLOGSTRING("TSY: CMmNetTsy::ConstructL");
|
|
50 |
|
|
51 |
//set current NW mode
|
|
52 |
iMode = RMobilePhone::ENetworkModeUnknown;
|
|
53 |
|
|
54 |
//initialise network related attributes
|
|
55 |
iGetDetectedNetworks = new ( ELeave )
|
|
56 |
CArrayPtrFlat<CListReadAllAttempt>(1);
|
|
57 |
iRetGetDetectedNwSize = NULL;
|
|
58 |
iNWRegistrationStatus = RMobilePhone::ERegistrationUnknown;
|
|
59 |
|
|
60 |
iAuthInfoBuffer = NULL;
|
|
61 |
|
|
62 |
//Network selection setting
|
|
63 |
iNWSelectionSettingMethod = RMobilePhone::ENetworkSelectionUnknown;
|
|
64 |
|
|
65 |
//signal strength not available yet
|
|
66 |
iSignalRssi = 0;
|
|
67 |
|
|
68 |
//no signal Bar information available yet
|
|
69 |
iSignalBars = -1;
|
|
70 |
|
|
71 |
//flag for forcing ciphering indicator off (operator variant specific)
|
|
72 |
iCipheringIndicatorForcedOff = EFalse;
|
|
73 |
|
|
74 |
//read the ini file with the value of operator variant specific flag
|
|
75 |
ReadVariantOptions();
|
|
76 |
|
|
77 |
RMobilePhone::TMobilePhoneCellInfoV9 cellInfo;
|
|
78 |
cellInfo.iMode = RMobilePhone::ECellModeUnknown;
|
|
79 |
iCachedCellInfoV9.SetValue(cellInfo);
|
|
80 |
iCachedCellInfoV9.SetCacheDirty();
|
|
81 |
}
|
|
82 |
|
|
83 |
CMmNetTsy::~CMmNetTsy()
|
|
84 |
{
|
|
85 |
TFLOGSTRING("TSY: CMmNetTsy::~CMmNetTsy");
|
|
86 |
|
|
87 |
// Delete get detected networks list
|
|
88 |
if ( iGetDetectedNetworks )
|
|
89 |
{
|
|
90 |
iGetDetectedNetworks->ResetAndDestroy();
|
|
91 |
delete iGetDetectedNetworks;
|
|
92 |
iGetDetectedNetworks = NULL;
|
|
93 |
}
|
|
94 |
|
|
95 |
if ( iAuthInfoBuffer )
|
|
96 |
{
|
|
97 |
delete iAuthInfoBuffer;
|
|
98 |
iAuthInfoBuffer = NULL;
|
|
99 |
}
|
|
100 |
|
|
101 |
// Closes the arrays and frees all memory allocated to the arrays.
|
|
102 |
iNotifyCurrentNwRequests.Close();
|
|
103 |
iNotifyCurrentNwNoLocationRequests.Close();
|
|
104 |
iCellInfoRequests.Close();
|
|
105 |
iNotifyCellInfoRequests.Close();
|
|
106 |
|
|
107 |
// Destroy array
|
|
108 |
iRegisterationStatusRequests.ResetAndDestroy();
|
|
109 |
}
|
|
110 |
|
|
111 |
|
|
112 |
// ---------------------------------------------------------------------------
|
|
113 |
// CMmNetTsy::DoExtFunc
|
|
114 |
// NET-specific functionality of CMmPhoneTsy::DoExtFuncL
|
|
115 |
// (other items were commented in a header).
|
|
116 |
// ---------------------------------------------------------------------------
|
|
117 |
//
|
|
118 |
TInt CMmNetTsy::DoExtFuncL(
|
|
119 |
const TTsyReqHandle aTsyReqHandle, // Request handle
|
|
120 |
const TInt aIpc, // IPC number of request
|
|
121 |
const TDataPackage& aPackage ) // Contains parameters for request
|
|
122 |
{
|
|
123 |
TFLOGSTRING3("TSY: CMmPhoneTsy::DoExtFuncL.\n \t\t\t IPC:%d\n \t\t\t Handle:%d",
|
|
124 |
aIpc, aTsyReqHandle);
|
|
125 |
|
|
126 |
TInt ret ( KErrNone );
|
|
127 |
|
|
128 |
TAny* dataPtr = aPackage.Ptr1();
|
|
129 |
TAny* dataPtr2 = aPackage.Ptr2();
|
|
130 |
|
|
131 |
switch ( aIpc )
|
|
132 |
{
|
|
133 |
// Get Network Caps
|
|
134 |
case EMobilePhoneGetNetworkCaps:
|
|
135 |
ret = GetNetworkCaps( aTsyReqHandle,
|
|
136 |
reinterpret_cast<TUint32*>( dataPtr ) );
|
|
137 |
break;
|
|
138 |
// Get Network Registration Status
|
|
139 |
case EMobilePhoneGetNetworkRegistrationStatus:
|
|
140 |
ret = GetNetworkRegistrationStatusL( aTsyReqHandle,
|
|
141 |
reinterpret_cast<RMobilePhone::TMobilePhoneRegistrationStatus*>(
|
|
142 |
dataPtr ) );
|
|
143 |
break;
|
|
144 |
// Notify Network Registration Status Change
|
|
145 |
case EMobilePhoneNotifyNetworkRegistrationStatusChange:
|
|
146 |
ret = NotifyNetworkRegistrationStatusChange(
|
|
147 |
reinterpret_cast<RMobilePhone::TMobilePhoneRegistrationStatus*>(
|
|
148 |
dataPtr ));
|
|
149 |
break;
|
|
150 |
// Get Current Network Mode
|
|
151 |
case EMobilePhoneGetCurrentMode:
|
|
152 |
ret = GetCurrentMode( aTsyReqHandle,
|
|
153 |
reinterpret_cast< RMobilePhone::TMobilePhoneNetworkMode*>(
|
|
154 |
dataPtr ) );
|
|
155 |
break;
|
|
156 |
// Notify Network Mode Change
|
|
157 |
case EMobilePhoneNotifyModeChange:
|
|
158 |
ret = NotifyModeChange(
|
|
159 |
reinterpret_cast<RMobilePhone::TMobilePhoneNetworkMode*>(
|
|
160 |
dataPtr ) );
|
|
161 |
break;
|
|
162 |
// Get Current Network
|
|
163 |
case EMobilePhoneGetCurrentNetwork:
|
|
164 |
ret = GetCurrentNetwork( aTsyReqHandle, aPackage.Des1n(),
|
|
165 |
reinterpret_cast<RMobilePhone::TMobilePhoneLocationAreaV1*>(
|
|
166 |
dataPtr2 ) );
|
|
167 |
break;
|
|
168 |
case EMobilePhoneGetNetworkName:
|
|
169 |
TFLOGSTRING("TSY: CMmNetTsy::DoExtFuncL - EMobilePhoneGetNetworkName");
|
|
170 |
ret = GetNetworkName(
|
|
171 |
aTsyReqHandle, aPackage.Des1n(), aPackage.Des2n() );
|
|
172 |
break;
|
|
173 |
// Get Current Network, no location
|
|
174 |
case EMobilePhoneGetCurrentNetworkNoLocation:
|
|
175 |
ret = GetCurrentNetworkNoLocation(
|
|
176 |
aTsyReqHandle, aPackage.Des1n() );
|
|
177 |
break;
|
|
178 |
// Get Cell information
|
|
179 |
case EMobilePhoneGetCellInfo:
|
|
180 |
TFLOGSTRING("TSY: CMmNetTsy::DoExtFuncL - EMobilePhoneGetCellInfo");
|
|
181 |
ret = GetCellInfoL(aTsyReqHandle, aPackage.Des1n());
|
|
182 |
break;
|
|
183 |
// Notify cell information change
|
|
184 |
case EMobilePhoneNotifyCellInfoChange:
|
|
185 |
TFLOGSTRING("TSY: CMmNetTsy::DoExtFuncL - EMobilePhoneNotifyCellInfoChange");
|
|
186 |
ret = NotifyCellInfoChangeL(aTsyReqHandle, aPackage.Des1n());
|
|
187 |
break;
|
|
188 |
// Notify Current Network Change, no location
|
|
189 |
case EMobilePhoneNotifyCurrentNetworkNoLocationChange:
|
|
190 |
ret = NotifyCurrentNetworkNoLocationChangeL(
|
|
191 |
aTsyReqHandle, aPackage.Des1n() );
|
|
192 |
break;
|
|
193 |
// Notify Current Network Change
|
|
194 |
case EMobilePhoneNotifyCurrentNetworkChange:
|
|
195 |
ret = NotifyCurrentNetworkChangeL( aTsyReqHandle, aPackage.Des1n(),
|
|
196 |
reinterpret_cast<RMobilePhone::TMobilePhoneLocationAreaV1*>(
|
|
197 |
dataPtr2 ) );
|
|
198 |
break;
|
|
199 |
// Get Home Network
|
|
200 |
case EMobilePhoneGetHomeNetwork:
|
|
201 |
ret = GetHomeNetwork( aTsyReqHandle, aPackage.Des1n() );
|
|
202 |
break;
|
|
203 |
// Get Detected Networks - Phase1
|
|
204 |
case EMobilePhoneGetDetectedNetworksV2Phase1:
|
|
205 |
ret = GetDetectedNetworksPhase1L( aTsyReqHandle,
|
|
206 |
reinterpret_cast<RMobilePhone::TClientId*>( dataPtr ),
|
|
207 |
reinterpret_cast<TInt*>( dataPtr2) );
|
|
208 |
break;
|
|
209 |
// Get Detected Networks - Phase2
|
|
210 |
case EMobilePhoneGetDetectedNetworksV2Phase2:
|
|
211 |
ret = GetDetectedNetworksPhase2( aTsyReqHandle,
|
|
212 |
reinterpret_cast<RMobilePhone::TClientId*>( dataPtr ),
|
|
213 |
aPackage.Des2n() );
|
|
214 |
break;
|
|
215 |
// Get Network Selection Setting
|
|
216 |
case EMobilePhoneGetNetworkSelectionSetting:
|
|
217 |
ret =
|
|
218 |
GetNetworkSelectionSetting( aTsyReqHandle, aPackage.Des1n());
|
|
219 |
break;
|
|
220 |
// Set Network Selection Setting
|
|
221 |
case EMobilePhoneSetNetworkSelectionSetting:
|
|
222 |
ret = SetNetworkSelectionSettingL( aTsyReqHandle, aPackage );
|
|
223 |
break;
|
|
224 |
// Notify Network Selection Setting Change
|
|
225 |
case EMobilePhoneNotifyNetworkSelectionSettingChange:
|
|
226 |
ret = NotifyNetworkSelectionSettingChange( aPackage.Des1n() );
|
|
227 |
break;
|
|
228 |
// Select Network
|
|
229 |
case EMobilePhoneSelectNetwork:
|
|
230 |
ret = SelectNetworkL( aTsyReqHandle, aPackage );
|
|
231 |
break;
|
|
232 |
// Get NITZ information
|
|
233 |
case EMobilePhoneGetNITZInfo:
|
|
234 |
ret = GetNITZInfo( aTsyReqHandle,
|
|
235 |
reinterpret_cast<RMobilePhone::TMobilePhoneNITZ*>( dataPtr ) );
|
|
236 |
break;
|
|
237 |
// Notify NITZ Information Change
|
|
238 |
case EMobilePhoneNotifyNITZInfoChange:
|
|
239 |
ret = NotifyNITZInfoChange(
|
|
240 |
reinterpret_cast<RMobilePhone::TMobilePhoneNITZ*>( dataPtr ) );
|
|
241 |
break;
|
|
242 |
// Get Signal Capabilities
|
|
243 |
case EMobilePhoneGetSignalCaps:
|
|
244 |
ret = GetSignalCaps( aTsyReqHandle,
|
|
245 |
reinterpret_cast<TUint32*> (dataPtr ) );
|
|
246 |
break;
|
|
247 |
// Get Signal Strength
|
|
248 |
case EMobilePhoneGetSignalStrength:
|
|
249 |
ret = GetSignalStrength( aTsyReqHandle,
|
|
250 |
reinterpret_cast<TInt32*>( dataPtr ),
|
|
251 |
reinterpret_cast<TInt8*>( dataPtr2 ) );
|
|
252 |
break;
|
|
253 |
// Notify Change of Signal Strength
|
|
254 |
case EMobilePhoneNotifySignalStrengthChange:
|
|
255 |
ret = NotifySignalStrengthChange(
|
|
256 |
reinterpret_cast<TInt32*>( dataPtr ),
|
|
257 |
reinterpret_cast<TInt8*>( dataPtr2 ) );
|
|
258 |
break;
|
|
259 |
case EMobilePhoneGetNetworkSecurityLevel:
|
|
260 |
ret = GetNetworkSecurityLevel( aTsyReqHandle,
|
|
261 |
reinterpret_cast<RMobilePhone::TMobilePhoneNetworkSecurity*>(
|
|
262 |
dataPtr ));
|
|
263 |
break;
|
|
264 |
case EMobilePhoneNotifyNetworkSecurityLevelChange:
|
|
265 |
ret = NotifyNetworkSecurityLevelChange(
|
|
266 |
reinterpret_cast<RMobilePhone::TMobilePhoneNetworkSecurity*>(
|
|
267 |
dataPtr ));
|
|
268 |
break;
|
|
269 |
case EMobilePhoneGetCipheringIndicatorStatus:
|
|
270 |
ret = GetCipheringIndicatorStatusL( aTsyReqHandle, aPackage );
|
|
271 |
break;
|
|
272 |
case EMobilePhoneAuthorizationInfoPhase1:
|
|
273 |
ret = GetAuthorizationInfoPhase1L( aTsyReqHandle,
|
|
274 |
reinterpret_cast<RMobilePhone::TClientId*>( dataPtr ),
|
|
275 |
reinterpret_cast<TInt*>( dataPtr2 ) );
|
|
276 |
break;
|
|
277 |
case EMobilePhoneAuthorizationInfoPhase2:
|
|
278 |
ret = GetAuthorizationInfoPhase2L( aTsyReqHandle,
|
|
279 |
reinterpret_cast<RMobilePhone::TClientId*>( dataPtr ),
|
|
280 |
aPackage.Des2n() );
|
|
281 |
break;
|
|
282 |
// Get Current Active USim Application
|
|
283 |
case EMobilePhoneGetCurrentActiveUSimApplication:
|
|
284 |
ret = GetCurrentActiveUSimApplicationL( aTsyReqHandle,
|
|
285 |
reinterpret_cast<RMobilePhone::TAID*>( dataPtr ) );
|
|
286 |
break;
|
|
287 |
default:
|
|
288 |
ret = KErrNotSupported;
|
|
289 |
break;
|
|
290 |
}
|
|
291 |
|
|
292 |
return ret;
|
|
293 |
|
|
294 |
}
|
|
295 |
|
|
296 |
// ---------------------------------------------------------------------------
|
|
297 |
// CMmNetTsy::CancelService
|
|
298 |
// Cancels NET requests
|
|
299 |
// (other items were commented in a header).
|
|
300 |
// ---------------------------------------------------------------------------
|
|
301 |
//
|
|
302 |
TInt CMmNetTsy::CancelService(
|
|
303 |
const TInt aIpc, // IPC number of request.
|
|
304 |
const TTsyReqHandle aTsyReqHandle ) // Request handle of given request.
|
|
305 |
{
|
|
306 |
TFLOGSTRING3("TSY: CMmNetTsy::CancelService IPC: %d ret: %d", aIpc, aTsyReqHandle);
|
|
307 |
TInt ret ( KErrNotSupported );
|
|
308 |
|
|
309 |
//When the clients close their sub-sessions (eg. by calling RLine::Close),
|
|
310 |
//they may not have cancelled all their outstanding asynchronous requests
|
|
311 |
//before closing. It is up to the ETel server to clean up in this
|
|
312 |
//situation, so the server will find the list of outstanding requests
|
|
313 |
//related to that sub-session object and pass these outstanding IPC
|
|
314 |
//request numbers, one at a time, to the CancelService method in the TSY.
|
|
315 |
|
|
316 |
switch ( aIpc )
|
|
317 |
{
|
|
318 |
|
|
319 |
//folllowing methods are handled in CMmPhoneTsy::CancelService
|
|
320 |
//case EMobilePhoneGetSignalStrength:
|
|
321 |
//case EMobilePhoneGetCurrentNetwork:
|
|
322 |
//case EMobilePhoneGetCurrentNetworkNoLocation:
|
|
323 |
//case EMobilePhoneGetHomeNetwork:
|
|
324 |
//case EMobilePhoneSetNetworkSelectionSetting:
|
|
325 |
|
|
326 |
case EMobilePhoneNotifySignalStrengthChange:
|
|
327 |
ret = NotifySignalStrengthChangeCancel( aTsyReqHandle );
|
|
328 |
break;
|
|
329 |
case EMobilePhoneNotifyNetworkRegistrationStatusChange:
|
|
330 |
ret =
|
|
331 |
NotifyNetworkRegistrationStatusChangeCancel( aTsyReqHandle );
|
|
332 |
break;
|
|
333 |
case EMobilePhoneNotifyModeChange:
|
|
334 |
ret = NotifyModeChangeCancel( aTsyReqHandle );
|
|
335 |
break;
|
|
336 |
case EMobilePhoneNotifyCurrentNetworkChange:
|
|
337 |
ret = NotifyCurrentNetworkChangeCancel ( aTsyReqHandle );
|
|
338 |
break;
|
|
339 |
case EMobilePhoneNotifyCurrentNetworkNoLocationChange:
|
|
340 |
ret =
|
|
341 |
NotifyCurrentNetworkNoLocationChangeCancel ( aTsyReqHandle );
|
|
342 |
break;
|
|
343 |
case EMobilePhoneGetCellInfo:
|
|
344 |
ret = GetCellInfoCancel(aTsyReqHandle);
|
|
345 |
break;
|
|
346 |
case EMobilePhoneNotifyCellInfoChange:
|
|
347 |
ret = NotifyCellInfoChangeCancel(aTsyReqHandle);
|
|
348 |
break;
|
|
349 |
case EMobilePhoneNotifyNetworkSelectionSettingChange:
|
|
350 |
ret = NotifyNetworkSelectionSettingChangeCancel( aTsyReqHandle );
|
|
351 |
break;
|
|
352 |
case EMobilePhoneGetNetworkRegistrationStatus:
|
|
353 |
ret = GetNetworkRegistrationStatusCancel( aTsyReqHandle );
|
|
354 |
break;
|
|
355 |
case EMobilePhoneNotifyNITZInfoChange:
|
|
356 |
ret = NotifyNITZInfoChangeCancel( aTsyReqHandle );
|
|
357 |
break;
|
|
358 |
case EMobilePhoneAuthorizationInfoPhase1:
|
|
359 |
ret = GetAuthorizationInfoPhase1Cancel();
|
|
360 |
break;
|
|
361 |
case EMobilePhoneNotifyNetworkSecurityLevelChange:
|
|
362 |
ret = NotifyNetworkSecurityLevelChangeCancel();
|
|
363 |
break;
|
|
364 |
case EMobilePhoneGetCurrentActiveUSimApplication:
|
|
365 |
ret = GetCurrentActiveUSimApplicationCancel();
|
|
366 |
break;
|
|
367 |
case EMobilePhoneGetCipheringIndicatorStatus:
|
|
368 |
ret = GetCipheringIndicatorStatusCancel();
|
|
369 |
break;
|
|
370 |
//the following methods has to be
|
|
371 |
//cancelled in the the DOS side as well.
|
|
372 |
case EMobilePhoneGetDetectedNetworksV2Phase1:
|
|
373 |
case EMobilePhoneSelectNetwork:
|
|
374 |
{
|
|
375 |
// Ensure the ReqHandleType is unset.
|
|
376 |
// This will detect cases where this method indirectly calls itself
|
|
377 |
// (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost).
|
|
378 |
// Such cases are not supported because iReqHandleType is in the context of this class instance,
|
|
379 |
// not this request, and we don't want the values set by the inner request and the outer request
|
|
380 |
// interfering with each other.
|
|
381 |
__ASSERT_DEBUG(iMmPhoneTsy->iReqHandleType==CMmPhoneTsy::EMultimodePhoneReqHandleUnknown, User::Invariant());
|
|
382 |
|
|
383 |
TInt trapError( KErrNone );
|
|
384 |
|
|
385 |
//call cancel handling
|
|
386 |
TRAP( trapError, (ret = CancelToDosL( aIpc )));
|
|
387 |
|
|
388 |
if ( KErrNone != trapError )
|
|
389 |
{
|
|
390 |
//Store trap error to ret.
|
|
391 |
ret = trapError;
|
|
392 |
}
|
|
393 |
|
|
394 |
if ( KErrNone != ret )
|
|
395 |
{
|
|
396 |
//Remove request handle from store because it can not be used
|
|
397 |
//after the request is completed.
|
|
398 |
switch ( aIpc )
|
|
399 |
{
|
|
400 |
case EMobilePhoneGetDetectedNetworksV2Phase1:
|
|
401 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
402 |
CMmPhoneTsy::EMultimodePhoneGetDetectedNetworksPhase1 );
|
|
403 |
break;
|
|
404 |
case EMobilePhoneSelectNetwork:
|
|
405 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
406 |
CMmPhoneTsy::EMultimodePhoneSelectNetwork );
|
|
407 |
break;
|
|
408 |
default:
|
|
409 |
//Do nothing.
|
|
410 |
break;
|
|
411 |
}
|
|
412 |
|
|
413 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
414 |
|
|
415 |
//Request is completed. Return KErrNone to ETel server.
|
|
416 |
ret = KErrNone;
|
|
417 |
}
|
|
418 |
|
|
419 |
//save request handle
|
|
420 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown !=
|
|
421 |
iMmPhoneTsy->iReqHandleType )
|
|
422 |
{
|
|
423 |
iMmPhoneTsy->iTsyReqHandleStore->SetTsyReqHandle(
|
|
424 |
iMmPhoneTsy->iReqHandleType, aTsyReqHandle );
|
|
425 |
|
|
426 |
// We've finished with this value now. Clear it so it doesn't leak
|
|
427 |
// up to any other instances of this method down the call stack
|
|
428 |
iMmPhoneTsy->iReqHandleType=CMmPhoneTsy::EMultimodePhoneReqHandleUnknown;
|
|
429 |
}
|
|
430 |
break;
|
|
431 |
}
|
|
432 |
//Default case
|
|
433 |
default:
|
|
434 |
ret = KErrNone;
|
|
435 |
break;
|
|
436 |
}
|
|
437 |
|
|
438 |
return ret;
|
|
439 |
|
|
440 |
}
|
|
441 |
// ---------------------------------------------------------------------------
|
|
442 |
// CMmNetTsy::CancelToDosL
|
|
443 |
// Forwards a cancel request to the DOS layer
|
|
444 |
// (other items were commented in a header).
|
|
445 |
// ---------------------------------------------------------------------------
|
|
446 |
//
|
|
447 |
TInt CMmNetTsy::CancelToDosL(
|
|
448 |
const TInt aIpc ) // IPC number of request.
|
|
449 |
{
|
|
450 |
TInt ret ( KErrNone );
|
|
451 |
|
|
452 |
switch ( aIpc )
|
|
453 |
{
|
|
454 |
case EMobilePhoneGetDetectedNetworksV2Phase1:
|
|
455 |
ret = iMmPhoneTsy->MessageManager()->HandleRequestL(
|
|
456 |
EMobilePhoneGetDetectedNetworksCancel );
|
|
457 |
break;
|
|
458 |
|
|
459 |
case EMobilePhoneSelectNetwork:
|
|
460 |
ret = iMmPhoneTsy->MessageManager()->HandleRequestL(
|
|
461 |
EMobilePhoneSelectNetworkCancel );
|
|
462 |
break;
|
|
463 |
|
|
464 |
default:
|
|
465 |
break;
|
|
466 |
}
|
|
467 |
|
|
468 |
return ret;
|
|
469 |
}
|
|
470 |
|
|
471 |
// ---------------------------------------------------------------------------
|
|
472 |
// CMmNetTsy::GetSignalCaps
|
|
473 |
// Returns the signal strength and BER capabilities of the phone
|
|
474 |
// (other items were commented in a header).
|
|
475 |
// ---------------------------------------------------------------------------
|
|
476 |
//
|
|
477 |
TInt CMmNetTsy::GetSignalCaps(
|
|
478 |
const TTsyReqHandle aTsyReqHandle, // Tsy request handle
|
|
479 |
TUint32* aCaps ) const // pointer to the capabilities
|
|
480 |
{
|
|
481 |
*aCaps = KMmTsySignalCaps;
|
|
482 |
|
|
483 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNone );
|
|
484 |
return KErrNone;
|
|
485 |
}
|
|
486 |
|
|
487 |
// ---------------------------------------------------------------------------
|
|
488 |
// CMmNetTsy::GetSignalStrength
|
|
489 |
// Returns current signal strength and signal bars
|
|
490 |
// (other items were commented in a header).
|
|
491 |
// ---------------------------------------------------------------------------
|
|
492 |
//
|
|
493 |
TInt CMmNetTsy::GetSignalStrength(
|
|
494 |
const TTsyReqHandle aTsyReqHandle, // Tsy request handle
|
|
495 |
TInt32* aSignalStrength, // signal strength
|
|
496 |
TInt8* aBar ) const // percentage of bars (0-100%)
|
|
497 |
{
|
|
498 |
TInt ret( KErrNotFound );
|
|
499 |
|
|
500 |
// Signal strength is not available yet when value is 0.
|
|
501 |
// Signal bars has no information available when value is -1,
|
|
502 |
// 0 is one of the signal bar values.
|
|
503 |
if ( 0 != iSignalRssi || -1 != iSignalBars )
|
|
504 |
{
|
|
505 |
*aSignalStrength = iSignalRssi;
|
|
506 |
//this is currently a value between 0-100, not absolute number of bars
|
|
507 |
*aBar = iSignalBars;
|
|
508 |
ret = KErrNone;
|
|
509 |
}
|
|
510 |
|
|
511 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
512 |
return KErrNone;
|
|
513 |
}
|
|
514 |
|
|
515 |
// ---------------------------------------------------------------------------
|
|
516 |
// CMmNetTsy::NotifySignalStrengthChange
|
|
517 |
// Notifies the client if the signal strength changes
|
|
518 |
// (other items were commented in a header).
|
|
519 |
// ---------------------------------------------------------------------------
|
|
520 |
//
|
|
521 |
TInt CMmNetTsy::NotifySignalStrengthChange(
|
|
522 |
TInt32* aSignalStrength, // signal strength
|
|
523 |
TInt8* aBar ) // absolute number of bars
|
|
524 |
{
|
|
525 |
iMmPhoneTsy->iReqHandleType =
|
|
526 |
CMmPhoneTsy::EMultimodePhoneNotifySignalStrengthChange;
|
|
527 |
|
|
528 |
//Save the address of client's status variable for future use
|
|
529 |
iRetSignalRssi = aSignalStrength;
|
|
530 |
iRetSignalBars = aBar;
|
|
531 |
|
|
532 |
return KErrNone;
|
|
533 |
}
|
|
534 |
|
|
535 |
// ---------------------------------------------------------------------------
|
|
536 |
// CMmNetTsy::NotifySignalStrengthChangeCancel
|
|
537 |
// Cancels an outstanding NotifySignalStrengthChange request.
|
|
538 |
// (other items were commented in a header).
|
|
539 |
// ---------------------------------------------------------------------------
|
|
540 |
//
|
|
541 |
TInt CMmNetTsy::NotifySignalStrengthChangeCancel(
|
|
542 |
const TTsyReqHandle aTsyReqHandle ) // Tsy request handle
|
|
543 |
{
|
|
544 |
//As cancel is called, the client memory address pointed to is no longer
|
|
545 |
//valid -> NULL it
|
|
546 |
iRetSignalRssi = NULL;
|
|
547 |
iRetSignalBars = NULL;
|
|
548 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
549 |
CMmPhoneTsy::EMultimodePhoneNotifySignalStrengthChange );
|
|
550 |
|
|
551 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
552 |
return KErrNone;
|
|
553 |
}
|
|
554 |
|
|
555 |
// ---------------------------------------------------------------------------
|
|
556 |
// CMmNetTsy::CompleteNotifySignalStrengthChange
|
|
557 |
// Completes NotifySignalStrengthChange to client side
|
|
558 |
// (other items were commented in a header).
|
|
559 |
// ---------------------------------------------------------------------------
|
|
560 |
//
|
|
561 |
void CMmNetTsy::CompleteNotifySignalStrengthChange(
|
|
562 |
CMmDataPackage* aDataPackage ) // Contains information for client side
|
|
563 |
{
|
|
564 |
aDataPackage->UnPackData ( iSignalBars, iSignalRssi );
|
|
565 |
|
|
566 |
//reset req handle. Returns the deleted req handle
|
|
567 |
TTsyReqHandle reqHandle =
|
|
568 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
569 |
CMmPhoneTsy::EMultimodePhoneNotifySignalStrengthChange );
|
|
570 |
|
|
571 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
572 |
{
|
|
573 |
// Update the client side data through pointers
|
|
574 |
*iRetSignalRssi = iSignalRssi;
|
|
575 |
*iRetSignalBars = iSignalBars;
|
|
576 |
|
|
577 |
// Null pointers as notification is completed!
|
|
578 |
// THIS HAS TO BE DONE BEFORE REQCOMPLETED!!
|
|
579 |
iRetSignalRssi = NULL;
|
|
580 |
iRetSignalBars = NULL;
|
|
581 |
|
|
582 |
iMmPhoneTsy->ReqCompleted( reqHandle, KErrNone );
|
|
583 |
}
|
|
584 |
}
|
|
585 |
|
|
586 |
// ---------------------------------------------------------------------------
|
|
587 |
// CMmNetTsy::GetNITZInfo
|
|
588 |
// Returns the current time information received from network.
|
|
589 |
// (other items were commented in a header).
|
|
590 |
// ---------------------------------------------------------------------------
|
|
591 |
//
|
|
592 |
TInt CMmNetTsy::GetNITZInfo(
|
|
593 |
const TTsyReqHandle aTsyReqHandle, // Tsy request handle
|
|
594 |
RMobilePhone::TMobilePhoneNITZ* aNWTimeInfo ) const // NW time info
|
|
595 |
{
|
|
596 |
TInt ret( iMmPhoneTsy->iMmPhoneExtInterface->GetNITZInfo( aNWTimeInfo ) );
|
|
597 |
|
|
598 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
599 |
|
|
600 |
return KErrNone;
|
|
601 |
}
|
|
602 |
|
|
603 |
// ---------------------------------------------------------------------------
|
|
604 |
// CMmNetTsy::NotifyNITZInfoChange
|
|
605 |
// Notifies client when network time and date info changes.
|
|
606 |
// (other items were commented in a header).
|
|
607 |
// ---------------------------------------------------------------------------
|
|
608 |
//
|
|
609 |
TInt CMmNetTsy::NotifyNITZInfoChange(
|
|
610 |
RMobilePhone::TMobilePhoneNITZ* aNWTimeInfo ) // Ptr to NW time info
|
|
611 |
{
|
|
612 |
iMmPhoneTsy->iReqHandleType =
|
|
613 |
CMmPhoneTsy::EMultimodePhoneNotifyNWTimeInfoChange;
|
|
614 |
|
|
615 |
//Save the address of client's status variable for future use
|
|
616 |
iRetNWTimeInfo = aNWTimeInfo;
|
|
617 |
|
|
618 |
return KErrNone;
|
|
619 |
}
|
|
620 |
|
|
621 |
// ---------------------------------------------------------------------------
|
|
622 |
// CMmNetTsy::NotifyNITZInfoChangeCancel
|
|
623 |
// Cancels an outstanding NotifyNITZInfoChange request.
|
|
624 |
// (other items were commented in a header).
|
|
625 |
// ---------------------------------------------------------------------------
|
|
626 |
//
|
|
627 |
TInt CMmNetTsy::NotifyNITZInfoChangeCancel(
|
|
628 |
const TTsyReqHandle aTsyReqHandle ) // Tsy request handle
|
|
629 |
{
|
|
630 |
//As cancel is called, the client memory address pointed to is no longer
|
|
631 |
// valid -> NULL it
|
|
632 |
iRetNWTimeInfo = NULL;
|
|
633 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
634 |
CMmPhoneTsy::EMultimodePhoneNotifyNWTimeInfoChange );
|
|
635 |
|
|
636 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
637 |
return KErrNone;
|
|
638 |
}
|
|
639 |
|
|
640 |
// ---------------------------------------------------------------------------
|
|
641 |
// CMmNetTsy::CompleteNotifyNITZInfoChange
|
|
642 |
// Completes NotifyNITZInfoChange to client side
|
|
643 |
// (other items were commented in a header).
|
|
644 |
// ---------------------------------------------------------------------------
|
|
645 |
//
|
|
646 |
void CMmNetTsy::CompleteNotifyNITZInfoChange(
|
|
647 |
CMmDataPackage* aDataPackage ) // Contains information for client side
|
|
648 |
{
|
|
649 |
//reset req handle. Returns the deleted req handle
|
|
650 |
TTsyReqHandle reqHandle =
|
|
651 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
652 |
CMmPhoneTsy::EMultimodePhoneNotifyNWTimeInfoChange );
|
|
653 |
|
|
654 |
RMobilePhone::TMobilePhoneNITZ* nwTimeInfo = NULL;
|
|
655 |
|
|
656 |
aDataPackage->UnPackData ( &nwTimeInfo );
|
|
657 |
|
|
658 |
//notify the extension about the change
|
|
659 |
iMmPhoneTsy->iMmPhoneExtInterface->ReceivedNITZInfo( *nwTimeInfo );
|
|
660 |
|
|
661 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
662 |
{
|
|
663 |
*iRetNWTimeInfo = *nwTimeInfo;
|
|
664 |
|
|
665 |
// THIS HAS TO BE DONE BEFORE REQCOMPLETED!!
|
|
666 |
iRetNWTimeInfo = NULL;
|
|
667 |
|
|
668 |
iMmPhoneTsy->ReqCompleted( reqHandle, KErrNone );
|
|
669 |
}
|
|
670 |
}
|
|
671 |
|
|
672 |
// ---------------------------------------------------------------------------
|
|
673 |
// CMmNetTsy::GetCurrentMode
|
|
674 |
// Returns information about the current network mode to client side
|
|
675 |
// (other items were commented in a header).
|
|
676 |
// ---------------------------------------------------------------------------
|
|
677 |
//
|
|
678 |
TInt CMmNetTsy::GetCurrentMode(
|
|
679 |
const TTsyReqHandle aTsyReqHandle,
|
|
680 |
RMobilePhone::TMobilePhoneNetworkMode* aNWMode ) const
|
|
681 |
{
|
|
682 |
*aNWMode = iMode;
|
|
683 |
|
|
684 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNone );
|
|
685 |
|
|
686 |
return KErrNone;
|
|
687 |
}
|
|
688 |
|
|
689 |
// ---------------------------------------------------------------------------
|
|
690 |
// CMmNetTsy::NotifyModeChange
|
|
691 |
// Notifies client of changes in the current network mode.
|
|
692 |
// (other items were commented in a header).
|
|
693 |
// ---------------------------------------------------------------------------
|
|
694 |
//
|
|
695 |
TInt CMmNetTsy::NotifyModeChange(
|
|
696 |
RMobilePhone::TMobilePhoneNetworkMode* aNWMode )
|
|
697 |
{
|
|
698 |
iMmPhoneTsy->iReqHandleType =
|
|
699 |
CMmPhoneTsy::EMultimodePhoneNotifyModeChange;
|
|
700 |
|
|
701 |
iRetNWMode = aNWMode;
|
|
702 |
|
|
703 |
return KErrNone;
|
|
704 |
}
|
|
705 |
|
|
706 |
// ---------------------------------------------------------------------------
|
|
707 |
// CMmNetTsy::NotifyModeChangeCancel
|
|
708 |
// Cancels an outstanding NotifyModeChange method.
|
|
709 |
// (other items were commented in a header).
|
|
710 |
// ---------------------------------------------------------------------------
|
|
711 |
//
|
|
712 |
TInt CMmNetTsy::NotifyModeChangeCancel(
|
|
713 |
const TTsyReqHandle aTsyReqHandle )
|
|
714 |
{
|
|
715 |
// As cancel is called, the client memory address pointed to is no longer
|
|
716 |
// valid -> NULL it
|
|
717 |
iRetNWMode = NULL;
|
|
718 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
719 |
CMmPhoneTsy::EMultimodePhoneNotifyModeChange );
|
|
720 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
721 |
return KErrNone;
|
|
722 |
}
|
|
723 |
|
|
724 |
// ---------------------------------------------------------------------------
|
|
725 |
// CMmNetTsy::CompleteNotifyModeChange
|
|
726 |
// Completes NotifyModeChange to client side. Updates the TSY's internal state
|
|
727 |
// according to the new mode.
|
|
728 |
// (other items were commented in a header).
|
|
729 |
// ---------------------------------------------------------------------------
|
|
730 |
//
|
|
731 |
void CMmNetTsy::CompleteNotifyModeChange(
|
|
732 |
CMmDataPackage* aDataPackage, // Contains information for client side
|
|
733 |
TInt aResult ) // success code
|
|
734 |
{
|
|
735 |
//unpack data
|
|
736 |
RMobilePhone::TMobilePhoneNetworkMode* mode = NULL;
|
|
737 |
aDataPackage->UnPackData ( &mode );
|
|
738 |
|
|
739 |
//continue only if mode has changed
|
|
740 |
if ( iMode != *mode )
|
|
741 |
{
|
|
742 |
//save the mode in the phone
|
|
743 |
iMode = *mode;
|
|
744 |
|
|
745 |
//reset req handle. Returns the deleted req handle
|
|
746 |
TTsyReqHandle reqHandle =
|
|
747 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
748 |
CMmPhoneTsy::EMultimodePhoneNotifyModeChange );
|
|
749 |
|
|
750 |
//check if any client is interested in notification
|
|
751 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
752 |
{
|
|
753 |
//set the mode for return
|
|
754 |
*iRetNWMode = *mode;
|
|
755 |
// Null ret pointer
|
|
756 |
iRetNWMode = NULL;
|
|
757 |
// Complete the client request
|
|
758 |
iMmPhoneTsy->ReqCompleted( reqHandle, aResult );
|
|
759 |
}
|
|
760 |
}
|
|
761 |
}
|
|
762 |
|
|
763 |
// ---------------------------------------------------------------------------
|
|
764 |
// CMmNetTsy::GetNetworkSelectionSetting
|
|
765 |
// Returns the current network selection setting.
|
|
766 |
// (other items were commented in a header).
|
|
767 |
// ---------------------------------------------------------------------------
|
|
768 |
//
|
|
769 |
TInt CMmNetTsy::GetNetworkSelectionSetting(
|
|
770 |
const TTsyReqHandle aTsyReqHandle,
|
|
771 |
TDes8* aSettingPckg )
|
|
772 |
{
|
|
773 |
TInt ret = KErrArgument;
|
|
774 |
|
|
775 |
if ( sizeof( RMobilePhone::TMobilePhoneNetworkSelectionV1 ) ==
|
|
776 |
aSettingPckg->MaxLength() )
|
|
777 |
{
|
|
778 |
TPckg<RMobilePhone::TMobilePhoneNetworkSelectionV1>* networkSettingPckg =
|
|
779 |
( TPckg<RMobilePhone::TMobilePhoneNetworkSelectionV1>* ) aSettingPckg;
|
|
780 |
RMobilePhone::TMobilePhoneNetworkSelectionV1& setting =
|
|
781 |
( *networkSettingPckg )();
|
|
782 |
|
|
783 |
// Set the common information
|
|
784 |
setting.iMethod = iNWSelectionSettingMethod;
|
|
785 |
// set the CDMA information to default values
|
|
786 |
setting.iBandClass = RMobilePhone::ENetworkBandClassUnknown;
|
|
787 |
setting.iOperationMode = RMobilePhone::ENetworkOperationUnknown;
|
|
788 |
|
|
789 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNone );
|
|
790 |
|
|
791 |
ret = KErrNone;
|
|
792 |
}
|
|
793 |
|
|
794 |
return ret;
|
|
795 |
}
|
|
796 |
|
|
797 |
// ---------------------------------------------------------------------------
|
|
798 |
// CMmNetTsy::SetNetworkSelectionSettingL
|
|
799 |
// Sets a new network selection setting
|
|
800 |
// (other items were commented in a header).
|
|
801 |
// ---------------------------------------------------------------------------
|
|
802 |
//
|
|
803 |
TInt CMmNetTsy::SetNetworkSelectionSettingL(
|
|
804 |
const TTsyReqHandle aTsyReqHandle, // request handle
|
|
805 |
const TDataPackage& aDataPackage ) // new setting mode
|
|
806 |
{
|
|
807 |
TDes8* settingPckg = aDataPackage.Des1n ();
|
|
808 |
|
|
809 |
if ( sizeof( RMobilePhone::TMobilePhoneNetworkSelectionV1 ) >
|
|
810 |
settingPckg->MaxLength() )
|
|
811 |
{
|
|
812 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrArgument );
|
|
813 |
return KErrNone;
|
|
814 |
}
|
|
815 |
|
|
816 |
TPckg<RMobilePhone::TMobilePhoneNetworkSelectionV1>* networkSettingPckg =
|
|
817 |
( TPckg<RMobilePhone::TMobilePhoneNetworkSelectionV1>* )settingPckg;
|
|
818 |
RMobilePhone::TMobilePhoneNetworkSelectionV1& setting =
|
|
819 |
( *networkSettingPckg )();
|
|
820 |
|
|
821 |
TInt ret( KErrNone );
|
|
822 |
|
|
823 |
// If unknown selection, return KErrNotSupported
|
|
824 |
if ( setting.iMethod == RMobilePhone::ENetworkSelectionUnknown )
|
|
825 |
{
|
|
826 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNotSupported );
|
|
827 |
}
|
|
828 |
//proceed only if value is changed
|
|
829 |
else if ( setting.iMethod != iNWSelectionSettingMethod )
|
|
830 |
{
|
|
831 |
//forward request to the extension
|
|
832 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->SetNetworkSelectionSettingL(
|
|
833 |
aDataPackage );
|
|
834 |
|
|
835 |
// And handle error conditions here
|
|
836 |
if ( KErrNone != ret )
|
|
837 |
{
|
|
838 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
839 |
}
|
|
840 |
else
|
|
841 |
{
|
|
842 |
iMmPhoneTsy->iReqHandleType =
|
|
843 |
CMmPhoneTsy::EMultimodePhoneSetNWSelectionSetting;
|
|
844 |
}
|
|
845 |
}
|
|
846 |
// Client requested to change to the same setting, complete request.
|
|
847 |
else
|
|
848 |
{
|
|
849 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
850 |
}
|
|
851 |
|
|
852 |
return KErrNone;
|
|
853 |
}
|
|
854 |
|
|
855 |
// ---------------------------------------------------------------------------
|
|
856 |
// CMmNetTsy::CompleteSetNetworkSelectionSetting
|
|
857 |
// Completes SetNetworkSelectionSetting to client side
|
|
858 |
// (other items were commented in a header).
|
|
859 |
// ---------------------------------------------------------------------------
|
|
860 |
//
|
|
861 |
void CMmNetTsy::CompleteSetNetworkSelectionSetting(
|
|
862 |
TInt aSuccessCode )
|
|
863 |
{
|
|
864 |
//reset req handle. Returns the deleted req handle
|
|
865 |
TTsyReqHandle setNetworkSelectionSettingHandle =
|
|
866 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
867 |
CMmPhoneTsy::EMultimodePhoneSetNWSelectionSetting );
|
|
868 |
|
|
869 |
//check the availability of the handler
|
|
870 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown !=
|
|
871 |
setNetworkSelectionSettingHandle )
|
|
872 |
{
|
|
873 |
iMmPhoneTsy->ReqCompleted(
|
|
874 |
setNetworkSelectionSettingHandle, aSuccessCode );
|
|
875 |
}
|
|
876 |
}
|
|
877 |
|
|
878 |
// ---------------------------------------------------------------------------
|
|
879 |
// CMmNetTsy::NotifyNetworkSelectionSettingChange
|
|
880 |
// Notifies client of changes in the network selection setting.
|
|
881 |
// (other items were commented in a header).
|
|
882 |
// ---------------------------------------------------------------------------
|
|
883 |
//
|
|
884 |
TInt CMmNetTsy::NotifyNetworkSelectionSettingChange(
|
|
885 |
TDes8* aSettingPckg ) // pointer to the setting
|
|
886 |
{
|
|
887 |
TPckg<RMobilePhone::TMobilePhoneNetworkSelectionV1>* networkSettingPckg =
|
|
888 |
( TPckg<RMobilePhone::TMobilePhoneNetworkSelectionV1>* ) aSettingPckg;
|
|
889 |
RMobilePhone::TMobilePhoneNetworkSelectionV1& setting =
|
|
890 |
( *networkSettingPckg )();
|
|
891 |
|
|
892 |
//save the handle and the request type
|
|
893 |
iMmPhoneTsy->iReqHandleType =
|
|
894 |
CMmPhoneTsy::EMultimodePhoneNotifyNWSelectionSettingChange;
|
|
895 |
|
|
896 |
//Save the address of client's status variable for future use
|
|
897 |
iRetNWSelectionSetting = &setting;
|
|
898 |
|
|
899 |
return KErrNone;
|
|
900 |
}
|
|
901 |
|
|
902 |
// ---------------------------------------------------------------------------
|
|
903 |
// CMmNetTsy::NotifyNetworkSelectionSettingChangeCancel
|
|
904 |
// Cancels an outstanding NotifyNetworkSelectionSettingChange request
|
|
905 |
// (other items were commented in a header).
|
|
906 |
// ---------------------------------------------------------------------------
|
|
907 |
//
|
|
908 |
TInt CMmNetTsy::NotifyNetworkSelectionSettingChangeCancel(
|
|
909 |
const TTsyReqHandle aTsyReqHandle ) // Tsy request handle
|
|
910 |
{
|
|
911 |
// As cancel is called, the client memory address pointed to is no longer
|
|
912 |
// valid -> NULL it
|
|
913 |
iRetNWSelectionSetting = NULL;
|
|
914 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
915 |
CMmPhoneTsy::EMultimodePhoneNotifyNWSelectionSettingChange );
|
|
916 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
917 |
return KErrNone;
|
|
918 |
}
|
|
919 |
|
|
920 |
// ---------------------------------------------------------------------------
|
|
921 |
// CMmNetTsy::CompleteNotifyNetworkSelectionSettingChange
|
|
922 |
// Completes a NotifyNetworkSelectionSettingChange request to client side
|
|
923 |
// (other items were commented in a header).
|
|
924 |
// ---------------------------------------------------------------------------
|
|
925 |
//
|
|
926 |
void CMmNetTsy::CompleteNotifyNetworkSelectionSettingChange(
|
|
927 |
CMmDataPackage* aDataPackage ) // Contains information for client side
|
|
928 |
{
|
|
929 |
RMobilePhone::TMobilePhoneNetworkSelectionV1* settings = NULL;
|
|
930 |
|
|
931 |
aDataPackage->UnPackData( &settings );
|
|
932 |
|
|
933 |
// continue only if the new selection is different than the old one
|
|
934 |
if ( (*settings).iMethod != iNWSelectionSettingMethod )
|
|
935 |
{
|
|
936 |
iNWSelectionSettingMethod = (*settings).iMethod;
|
|
937 |
// set the CDMA information to default values
|
|
938 |
(*settings).iBandClass = RMobilePhone::ENetworkBandClassUnknown;
|
|
939 |
(*settings).iOperationMode = RMobilePhone::ENetworkOperationUnknown;
|
|
940 |
|
|
941 |
//reset req handle. Returns the deleted req handle
|
|
942 |
TTsyReqHandle reqHandle =
|
|
943 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
944 |
CMmPhoneTsy::EMultimodePhoneNotifyNWSelectionSettingChange );
|
|
945 |
|
|
946 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
947 |
{
|
|
948 |
// Update the client side data through pointer
|
|
949 |
*iRetNWSelectionSetting = *settings;
|
|
950 |
|
|
951 |
// Null pointer as notification is completed!
|
|
952 |
iRetNWSelectionSetting = NULL;
|
|
953 |
|
|
954 |
iMmPhoneTsy->ReqCompleted( reqHandle, KErrNone );
|
|
955 |
}
|
|
956 |
}
|
|
957 |
}
|
|
958 |
|
|
959 |
// ---------------------------------------------------------------------------
|
|
960 |
// CMmNetTsy::SelectNetworkL
|
|
961 |
// Selects a new network to register to
|
|
962 |
// (other items were commented in a header).
|
|
963 |
// ---------------------------------------------------------------------------
|
|
964 |
//
|
|
965 |
TInt CMmNetTsy::SelectNetworkL(
|
|
966 |
const TTsyReqHandle aTsyReqHandle, // Request handle
|
|
967 |
const TDataPackage& aDataPackage ) // Contains parameters for request
|
|
968 |
{
|
|
969 |
//call the extension to handle the request
|
|
970 |
TInt ret( iMmPhoneTsy->iMmPhoneExtInterface->SelectNetworkL(
|
|
971 |
aDataPackage ));
|
|
972 |
|
|
973 |
//check result of previous call
|
|
974 |
if ( KErrNone != ret )
|
|
975 |
{
|
|
976 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
977 |
}
|
|
978 |
else
|
|
979 |
{
|
|
980 |
//save the handle and the request type
|
|
981 |
iMmPhoneTsy->iReqHandleType =
|
|
982 |
CMmPhoneTsy::EMultimodePhoneSelectNetwork;
|
|
983 |
}
|
|
984 |
|
|
985 |
return KErrNone;
|
|
986 |
}
|
|
987 |
|
|
988 |
// ---------------------------------------------------------------------------
|
|
989 |
// CMmNetTsy::SelectNetworkCancelL
|
|
990 |
// Cancels via DOS TSY an outstanding asynchronous SetNetwork request.
|
|
991 |
// (other items were commented in a header).
|
|
992 |
// ---------------------------------------------------------------------------
|
|
993 |
//
|
|
994 |
TInt CMmNetTsy::SelectNetworkCancelL(
|
|
995 |
const TTsyReqHandle aTsyReqHandle )
|
|
996 |
{
|
|
997 |
// First check if it is still possible to cancel the request!
|
|
998 |
TTsyReqHandle cancelSelectNetworkHandle =
|
|
999 |
iMmPhoneTsy->iTsyReqHandleStore->GetTsyReqHandle(
|
|
1000 |
CMmPhoneTsy::EMultimodePhoneSelectNetwork );
|
|
1001 |
|
|
1002 |
// Reset handle only if cancel is successful! See completition.
|
|
1003 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown !=
|
|
1004 |
cancelSelectNetworkHandle )
|
|
1005 |
{
|
|
1006 |
// Send cancel message
|
|
1007 |
TInt ret( iMmPhoneTsy->iMmPhoneExtInterface->SelectNetworkCancelL() );
|
|
1008 |
|
|
1009 |
if ( KErrNone != ret )
|
|
1010 |
{
|
|
1011 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
1012 |
}
|
|
1013 |
}
|
|
1014 |
// Not possible to cancel, complete request.
|
|
1015 |
else
|
|
1016 |
{
|
|
1017 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNotFound );
|
|
1018 |
}
|
|
1019 |
return KErrNone;
|
|
1020 |
}
|
|
1021 |
|
|
1022 |
// ---------------------------------------------------------------------------
|
|
1023 |
// CMmNetTsy::CompleteSelectNetwork
|
|
1024 |
// Completes a SelectNetwork request to client side
|
|
1025 |
// (other items were commented in a header).
|
|
1026 |
// ---------------------------------------------------------------------------
|
|
1027 |
//
|
|
1028 |
void CMmNetTsy::CompleteSelectNetwork(
|
|
1029 |
TInt aErrorCode ) // Error code
|
|
1030 |
{
|
|
1031 |
//reset req handle. Returns the deleted req handle
|
|
1032 |
TTsyReqHandle reqHandle =
|
|
1033 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1034 |
CMmPhoneTsy::EMultimodePhoneSelectNetwork );
|
|
1035 |
|
|
1036 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
1037 |
{
|
|
1038 |
iMmPhoneTsy->ReqCompleted( reqHandle, aErrorCode );
|
|
1039 |
}
|
|
1040 |
}
|
|
1041 |
|
|
1042 |
// ---------------------------------------------------------------------------
|
|
1043 |
// CMmNetTsy::CompleteSelectNetworkCancel
|
|
1044 |
// Completes a SelectNetworkCancel request to client side
|
|
1045 |
// (other items were commented in a header).
|
|
1046 |
// ---------------------------------------------------------------------------
|
|
1047 |
//
|
|
1048 |
void CMmNetTsy::CompleteSelectNetworkCancel(
|
|
1049 |
TInt aErrorCode ) // Error code
|
|
1050 |
{
|
|
1051 |
//reset req handle. Returns the deleted req handle
|
|
1052 |
TTsyReqHandle completeSelectNetworkHandle =
|
|
1053 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1054 |
CMmPhoneTsy::EMultimodePhoneSelectNetwork );
|
|
1055 |
|
|
1056 |
// check if the SelectNetwork has already been completed
|
|
1057 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown !=
|
|
1058 |
completeSelectNetworkHandle )
|
|
1059 |
{
|
|
1060 |
|
|
1061 |
// If cancel succeeded, complete req with KErrCancel
|
|
1062 |
if ( KErrNone == aErrorCode )
|
|
1063 |
{
|
|
1064 |
aErrorCode = KErrCancel;
|
|
1065 |
}
|
|
1066 |
iMmPhoneTsy->ReqCompleted( completeSelectNetworkHandle, aErrorCode );
|
|
1067 |
}
|
|
1068 |
}
|
|
1069 |
|
|
1070 |
// ---------------------------------------------------------------------------
|
|
1071 |
// CMmNetTsy::GetNetworkCaps
|
|
1072 |
// Gets the network capabilities of the phone.
|
|
1073 |
// (other items were commented in a header).
|
|
1074 |
// ---------------------------------------------------------------------------
|
|
1075 |
//
|
|
1076 |
TInt CMmNetTsy::GetNetworkCaps(
|
|
1077 |
const TTsyReqHandle aTsyReqHandle, //Tsy request handle
|
|
1078 |
TUint32* aCaps ) const // Capabilities parameter
|
|
1079 |
|
|
1080 |
{
|
|
1081 |
// Get capabilities of the current mode
|
|
1082 |
TInt ret ( iMmPhoneTsy->iMmPhoneExtInterface->GetNetworkCaps( aCaps ));
|
|
1083 |
//Complete the request using the return value from extension
|
|
1084 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
1085 |
return KErrNone;
|
|
1086 |
}
|
|
1087 |
|
|
1088 |
// ---------------------------------------------------------------------------
|
|
1089 |
// CMmNetTsy::GetHomeNetwork
|
|
1090 |
// Gets the home network information
|
|
1091 |
// (other items were commented in a header).
|
|
1092 |
// ---------------------------------------------------------------------------
|
|
1093 |
//
|
|
1094 |
TInt CMmNetTsy::GetHomeNetwork(
|
|
1095 |
const TTsyReqHandle aTsyReqHandle,
|
|
1096 |
TDes8* aNetworkInfoPckg ) const
|
|
1097 |
{
|
|
1098 |
TFLOGSTRING("TSY: CMmNetTsy::GetHomeNetwork" );
|
|
1099 |
|
|
1100 |
TInt ret ( KErrNotSupported );
|
|
1101 |
|
|
1102 |
if ( sizeof( RMobilePhone::TMobilePhoneNetworkInfoV1Pckg ) > aNetworkInfoPckg->MaxLength() )
|
|
1103 |
{
|
|
1104 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrArgument );
|
|
1105 |
return KErrNone;
|
|
1106 |
}
|
|
1107 |
|
|
1108 |
TPckg<RMobilePhone::TMultimodeType>* networkInfoTempPckg =
|
|
1109 |
REINTERPRET_CAST( TPckg<RMobilePhone::TMultimodeType>*,
|
|
1110 |
aNetworkInfoPckg );
|
|
1111 |
RMobilePhone::TMultimodeType& networkinfotemp =
|
|
1112 |
( *networkInfoTempPckg )();
|
|
1113 |
|
|
1114 |
if ( KETelExtMultimodeV1 == networkinfotemp.ExtensionId() )
|
|
1115 |
{
|
|
1116 |
// create reference in to data on the end of the clients pointer
|
|
1117 |
RMobilePhone::TMobilePhoneNetworkInfoV1Pckg* networkInfoV1Pckg =
|
|
1118 |
( RMobilePhone::TMobilePhoneNetworkInfoV1Pckg* ) aNetworkInfoPckg;
|
|
1119 |
RMobilePhone::TMobilePhoneNetworkInfoV1& networkInfoV1 =
|
|
1120 |
( *networkInfoV1Pckg )();
|
|
1121 |
|
|
1122 |
//get the data from the extension
|
|
1123 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->GetHomeNetworkV1(
|
|
1124 |
&networkInfoV1 );
|
|
1125 |
}
|
|
1126 |
else if ( KETelExtMultimodeV2 == networkinfotemp.ExtensionId() )
|
|
1127 |
{
|
|
1128 |
RMobilePhone::TMobilePhoneNetworkInfoV2Pckg* networkInfoV2Pckg =
|
|
1129 |
( RMobilePhone::TMobilePhoneNetworkInfoV2Pckg* ) aNetworkInfoPckg;
|
|
1130 |
RMobilePhone::TMobilePhoneNetworkInfoV2& networkInfoV2 =
|
|
1131 |
( *networkInfoV2Pckg )();
|
|
1132 |
|
|
1133 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->GetHomeNetworkV2(
|
|
1134 |
&networkInfoV2 );
|
|
1135 |
}
|
|
1136 |
else if ( KEtelExtMultimodeV5 == networkinfotemp.ExtensionId() )
|
|
1137 |
{
|
|
1138 |
RMobilePhone::TMobilePhoneNetworkInfoV5Pckg* networkInfoV5Pckg =
|
|
1139 |
( RMobilePhone::TMobilePhoneNetworkInfoV5Pckg* ) aNetworkInfoPckg;
|
|
1140 |
RMobilePhone::TMobilePhoneNetworkInfoV5& networkInfoV5 =
|
|
1141 |
( *networkInfoV5Pckg )();
|
|
1142 |
|
|
1143 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->GetHomeNetworkV5(
|
|
1144 |
&networkInfoV5 );
|
|
1145 |
}
|
|
1146 |
else if ( KEtelExtMultimodeV8 == networkinfotemp.ExtensionId() )
|
|
1147 |
{
|
|
1148 |
RMobilePhone::TMobilePhoneNetworkInfoV8Pckg* networkInfoV8Pckg =
|
|
1149 |
( RMobilePhone::TMobilePhoneNetworkInfoV8Pckg* ) aNetworkInfoPckg;
|
|
1150 |
RMobilePhone::TMobilePhoneNetworkInfoV8& networkInfoV8 =
|
|
1151 |
( *networkInfoV8Pckg )();
|
|
1152 |
|
|
1153 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->GetHomeNetwork(
|
|
1154 |
&networkInfoV8 );
|
|
1155 |
}
|
|
1156 |
|
|
1157 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
1158 |
|
|
1159 |
return KErrNone;
|
|
1160 |
}
|
|
1161 |
|
|
1162 |
// ---------------------------------------------------------------------------
|
|
1163 |
// CMmNetTsy::GetCurrentNetwork
|
|
1164 |
// Gets information about the currently registered network.
|
|
1165 |
// (other items were commented in a header).
|
|
1166 |
// ---------------------------------------------------------------------------
|
|
1167 |
//
|
|
1168 |
TInt CMmNetTsy::GetCurrentNetwork(
|
|
1169 |
const TTsyReqHandle aTsyReqHandle,
|
|
1170 |
TDes8* aNetworkInfoPckg,
|
|
1171 |
RMobilePhone::TMobilePhoneLocationAreaV1* aArea ) const
|
|
1172 |
{
|
|
1173 |
TFLOGSTRING("TSY: CMmNetTsy::GetCurrentNetwork");
|
|
1174 |
|
|
1175 |
TInt ret( KErrArgument );
|
|
1176 |
if ( ERfsStateInfoInactive == iMmPhoneTsy->GetRfStateInfo() )
|
|
1177 |
{
|
|
1178 |
TFLOGSTRING ("TSY: CMmNetTsy::GetCurrentNetwork Offline mode ON, request is not allowed! ");
|
|
1179 |
ret = CMmCommonStaticUtility::EpocErrorCode( KErrGeneral,
|
|
1180 |
KErrGsmOfflineOpNotAllowed );
|
|
1181 |
|
|
1182 |
// Complete the request with appropiate error
|
|
1183 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
1184 |
}
|
|
1185 |
else
|
|
1186 |
{
|
|
1187 |
if ( sizeof( RMobilePhone::TMobilePhoneNetworkInfoV1Pckg ) <=
|
|
1188 |
aNetworkInfoPckg->MaxLength() )
|
|
1189 |
{
|
|
1190 |
TPckg<RMobilePhone::TMultimodeType>* networkInfoTempPckg =
|
|
1191 |
REINTERPRET_CAST( TPckg<RMobilePhone::TMultimodeType>*,
|
|
1192 |
aNetworkInfoPckg );
|
|
1193 |
RMobilePhone::TMultimodeType& networkinfotemp =
|
|
1194 |
( *networkInfoTempPckg )();
|
|
1195 |
|
|
1196 |
if ( KETelExtMultimodeV1 == networkinfotemp.ExtensionId() )
|
|
1197 |
{
|
|
1198 |
// create reference in to data on the end of the clients pointer
|
|
1199 |
RMobilePhone::TMobilePhoneNetworkInfoV1Pckg* networkInfoV1Pckg =
|
|
1200 |
( RMobilePhone::TMobilePhoneNetworkInfoV1Pckg* )
|
|
1201 |
aNetworkInfoPckg;
|
|
1202 |
RMobilePhone::TMobilePhoneNetworkInfoV1& networkInfoV1 =
|
|
1203 |
( *networkInfoV1Pckg )();
|
|
1204 |
|
|
1205 |
// get the data from the extension
|
|
1206 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->GetCurrentNetworkV1(
|
|
1207 |
&networkInfoV1, aArea );
|
|
1208 |
}
|
|
1209 |
else if ( KETelExtMultimodeV2 == networkinfotemp.ExtensionId() )
|
|
1210 |
{
|
|
1211 |
RMobilePhone::TMobilePhoneNetworkInfoV2Pckg* networkInfoV2Pckg =
|
|
1212 |
( RMobilePhone::TMobilePhoneNetworkInfoV2Pckg* )
|
|
1213 |
aNetworkInfoPckg;
|
|
1214 |
RMobilePhone::TMobilePhoneNetworkInfoV2& networkInfoV2 =
|
|
1215 |
( *networkInfoV2Pckg )();
|
|
1216 |
|
|
1217 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->GetCurrentNetworkV2(
|
|
1218 |
&networkInfoV2, aArea );
|
|
1219 |
}
|
|
1220 |
else if ( KEtelExtMultimodeV5 == networkinfotemp.ExtensionId() )
|
|
1221 |
{
|
|
1222 |
RMobilePhone::TMobilePhoneNetworkInfoV5Pckg* networkInfoV5Pckg =
|
|
1223 |
( RMobilePhone::TMobilePhoneNetworkInfoV5Pckg* )
|
|
1224 |
aNetworkInfoPckg;
|
|
1225 |
RMobilePhone::TMobilePhoneNetworkInfoV5& networkInfoV5 =
|
|
1226 |
( *networkInfoV5Pckg )();
|
|
1227 |
|
|
1228 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->GetCurrentNetworkV5(
|
|
1229 |
&networkInfoV5, aArea );
|
|
1230 |
}
|
|
1231 |
else if ( KEtelExtMultimodeV8 == networkinfotemp.ExtensionId() )
|
|
1232 |
{
|
|
1233 |
RMobilePhone::TMobilePhoneNetworkInfoV8Pckg* networkInfoV8Pckg =
|
|
1234 |
( RMobilePhone::TMobilePhoneNetworkInfoV8Pckg* )
|
|
1235 |
aNetworkInfoPckg;
|
|
1236 |
RMobilePhone::TMobilePhoneNetworkInfoV8& networkInfoV8 =
|
|
1237 |
( *networkInfoV8Pckg )();
|
|
1238 |
|
|
1239 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->GetCurrentNetwork(
|
|
1240 |
&networkInfoV8, aArea );
|
|
1241 |
}
|
|
1242 |
else
|
|
1243 |
{
|
|
1244 |
ret = KErrNotSupported;
|
|
1245 |
}
|
|
1246 |
}
|
|
1247 |
|
|
1248 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
1249 |
}
|
|
1250 |
return KErrNone;
|
|
1251 |
}
|
|
1252 |
|
|
1253 |
// ---------------------------------------------------------------------------
|
|
1254 |
// CMmNetTsy::GetCellInfoL
|
|
1255 |
// Gets information about the currently cell.
|
|
1256 |
// (other items were commented in a header).
|
|
1257 |
// ---------------------------------------------------------------------------
|
|
1258 |
//
|
|
1259 |
TInt CMmNetTsy::GetCellInfoL(const TTsyReqHandle aTsyReqHandle, TDes8* aCellInfoPckg)
|
|
1260 |
{
|
|
1261 |
TFLOGSTRING2("TSY: CMmNetTsy::GetCellInfoL; Handle : %d", aTsyReqHandle);
|
|
1262 |
if(sizeof(RMobilePhone::TMobilePhoneCellInfoV9) > aCellInfoPckg->MaxLength())
|
|
1263 |
{
|
|
1264 |
TFLOGSTRING ("TSY: CMmNetTsy::GetCellInfo Bad size argument");
|
|
1265 |
// Complete the request with appropiate error
|
|
1266 |
return KErrArgument;
|
|
1267 |
}
|
|
1268 |
TPckg<RMobilePhone::TMultimodeType>* cellInfoTempPckg =
|
|
1269 |
reinterpret_cast<TPckg<RMobilePhone::TMultimodeType>*> (aCellInfoPckg);
|
|
1270 |
RMobilePhone::TMultimodeType& cellInfoTemp = ( *cellInfoTempPckg )();
|
|
1271 |
if(cellInfoTemp.ExtensionId()!=KEtelExtMultimodeV9)
|
|
1272 |
{
|
|
1273 |
TFLOGSTRING ("TSY: CMmNetTsy::GetCellInfo Bad version argument");
|
|
1274 |
// Complete the request with appropiate error
|
|
1275 |
return KErrArgument;
|
|
1276 |
}
|
|
1277 |
TInt ret( KErrNotSupported );
|
|
1278 |
if ( ERfsStateInfoInactive == iMmPhoneTsy->GetRfStateInfo() )
|
|
1279 |
{
|
|
1280 |
TFLOGSTRING ("TSY: CMmNetTsy::GetCellInfo Offline mode ON, request is not allowed! ");
|
|
1281 |
ret = CMmCommonStaticUtility::EpocErrorCode( KErrGeneral, KErrGsmOfflineOpNotAllowed );
|
|
1282 |
|
|
1283 |
// Complete the request with appropiate error
|
|
1284 |
if(ret == KErrNone)
|
|
1285 |
{
|
|
1286 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
1287 |
}
|
|
1288 |
return ret;
|
|
1289 |
}
|
|
1290 |
|
|
1291 |
// if cell info is cached, return the cached value straight away
|
|
1292 |
if (iCachedCellInfoV9.IsCacheValid())
|
|
1293 |
{
|
|
1294 |
// return cached information to client
|
|
1295 |
if(cellInfoTemp.ExtensionId() == KEtelExtMultimodeV9)
|
|
1296 |
{
|
|
1297 |
TPckg<RMobilePhone::TMobilePhoneCellInfoV9>* cellInfoPckg =
|
|
1298 |
reinterpret_cast<TPckg<RMobilePhone::TMobilePhoneCellInfoV9>*> (aCellInfoPckg);
|
|
1299 |
(*cellInfoPckg)() = iCachedCellInfoV9.Value();
|
|
1300 |
}
|
|
1301 |
// Complete the request
|
|
1302 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNone );
|
|
1303 |
return KErrNone;
|
|
1304 |
}
|
|
1305 |
else if (iCachedCellInfoV9.CacheAbility() == ECacheUnknown)
|
|
1306 |
{
|
|
1307 |
// we don't know about the cache ability, so we have to send and IndReq to the LTSY as well.
|
|
1308 |
// The cache status (clean/dirty) is irrelevant, as we don't know how reliable it is.
|
|
1309 |
TInt ret(KErrNone);
|
|
1310 |
ret = DoNotifyCellInfoChangeL(aTsyReqHandle);
|
|
1311 |
if(ret == KErrNone)
|
|
1312 |
{
|
|
1313 |
ret = DoGetCellInfoReqL(aTsyReqHandle, cellInfoTempPckg);
|
|
1314 |
}
|
|
1315 |
return ret;
|
|
1316 |
}
|
|
1317 |
else
|
|
1318 |
{ // cache is disabled or dirty, so need to send the request to the LTSY
|
|
1319 |
// send request
|
|
1320 |
TInt ret = DoGetCellInfoReqL(aTsyReqHandle, cellInfoTempPckg);
|
|
1321 |
return ret;
|
|
1322 |
}
|
|
1323 |
}
|
|
1324 |
|
|
1325 |
// ---------------------------------------------------------------------------
|
|
1326 |
// CMmNetTsy::DoGetCellInfoReqL
|
|
1327 |
// Gets information about the currently cell.
|
|
1328 |
// (other items were commented in a header).
|
|
1329 |
// ---------------------------------------------------------------------------
|
|
1330 |
//
|
|
1331 |
TInt CMmNetTsy::DoGetCellInfoReqL(const TTsyReqHandle aTsyReqHandle,
|
|
1332 |
TPckg<RMobilePhone::TMultimodeType>* aCellInfoPckg)
|
|
1333 |
{
|
|
1334 |
// send request
|
|
1335 |
TInt ret(KErrNone);
|
|
1336 |
TTsyReqHandle reqHandle = iMmPhoneTsy->iTsyReqHandleStore->
|
|
1337 |
GetTsyReqHandle( CMmPhoneTsy::EMultimodePhoneGetCellInfo );
|
|
1338 |
|
|
1339 |
if (0 >= reqHandle )
|
|
1340 |
{ //The request is not already in processing because of previous request
|
|
1341 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->GetCellInfoL();
|
|
1342 |
if ( KErrNone == ret )
|
|
1343 |
{
|
|
1344 |
//save tsy req handle type
|
|
1345 |
iMmPhoneTsy->iReqHandleType = CMmPhoneTsy::EMultimodePhoneGetCellInfo;
|
|
1346 |
}
|
|
1347 |
}
|
|
1348 |
if( ret == KErrNone )
|
|
1349 |
{
|
|
1350 |
TCellInformationRequest req;
|
|
1351 |
req.iReqHandle = aTsyReqHandle;
|
|
1352 |
req.iCellInfoPckg = aCellInfoPckg;
|
|
1353 |
iCellInfoRequests.AppendL( req );
|
|
1354 |
|
|
1355 |
}
|
|
1356 |
return ret;
|
|
1357 |
}
|
|
1358 |
|
|
1359 |
// ---------------------------------------------------------------------------
|
|
1360 |
// CMmNetTsy::DoNotifyCellInfoChangeL
|
|
1361 |
// Register notifier for cell information change event.
|
|
1362 |
// (other items were commented in a header).
|
|
1363 |
// ---------------------------------------------------------------------------
|
|
1364 |
//
|
|
1365 |
TInt CMmNetTsy::DoNotifyCellInfoChangeL(const TTsyReqHandle aTsyReqHandle)
|
|
1366 |
{
|
|
1367 |
TInt ret = KErrNone;
|
|
1368 |
TTsyReqHandle reqHandle = iMmPhoneTsy->iTsyReqHandleStore->
|
|
1369 |
GetTsyReqHandle( CMmPhoneTsy::EMultimodePhoneNotifyCellInfoChange );
|
|
1370 |
|
|
1371 |
if (0 >= reqHandle )
|
|
1372 |
{
|
|
1373 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->NotifyCellInfoChangeL();
|
|
1374 |
if ( KErrNone == ret )
|
|
1375 |
{
|
|
1376 |
//save tsy req handle type
|
|
1377 |
iMmPhoneTsy->SetTypeOfResponse( CMmPhoneTsy::EMultimodePhoneNotifyCellInfoChange, aTsyReqHandle );
|
|
1378 |
}
|
|
1379 |
}
|
|
1380 |
return ret;
|
|
1381 |
}
|
|
1382 |
|
|
1383 |
|
|
1384 |
// ---------------------------------------------------------------------------
|
|
1385 |
// CMmNetTsy::CompleteCellInfoReq
|
|
1386 |
// The LTSY has completed a cell information get request.
|
|
1387 |
// (other items were commented in a header).
|
|
1388 |
// ---------------------------------------------------------------------------
|
|
1389 |
//
|
|
1390 |
void CMmNetTsy::CompleteCellInfoReq(
|
|
1391 |
CMmDataPackage* aDataPackage,
|
|
1392 |
TInt aError )
|
|
1393 |
{
|
|
1394 |
//reset req handle. Returns the deleted req handle
|
|
1395 |
TTsyReqHandle reqHandle =
|
|
1396 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(CMmPhoneTsy::EMultimodePhoneGetCellInfo);
|
|
1397 |
|
|
1398 |
// Check the validity of the handler
|
|
1399 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
1400 |
{
|
|
1401 |
HandleCellInfoUpdate(aDataPackage,aError,iCellInfoRequests);
|
|
1402 |
}
|
|
1403 |
HandleCellInfoUpdate(aDataPackage,aError,iNotifyCellInfoRequests);
|
|
1404 |
}
|
|
1405 |
|
|
1406 |
// ---------------------------------------------------------------------------
|
|
1407 |
// CMmNetTsy::CompleteCellInfoIndReq
|
|
1408 |
// The LTSY has completed a request for notifications of changes in the cell information.
|
|
1409 |
// (other items were commented in a header).
|
|
1410 |
// ---------------------------------------------------------------------------
|
|
1411 |
//
|
|
1412 |
void CMmNetTsy::CompleteCellInfoIndReq(CMmDataPackage* aDataPackage, TInt aError)
|
|
1413 |
{
|
|
1414 |
//reset req handle. Returns the deleted req handle
|
|
1415 |
TTsyReqHandle reqHandle =
|
|
1416 |
iMmPhoneTsy->iTsyReqHandleStore->GetTsyReqHandle(CMmPhoneTsy::EMultimodePhoneNotifyCellInfoChange );
|
|
1417 |
|
|
1418 |
// update cache ability according to aError
|
|
1419 |
if (aError == KErrNone)
|
|
1420 |
{
|
|
1421 |
iCachedCellInfoV9.SetCacheEnabled();
|
|
1422 |
}
|
|
1423 |
else
|
|
1424 |
{
|
|
1425 |
iCachedCellInfoV9.SetCacheDisabled();
|
|
1426 |
HandleCellInfoUpdate(aDataPackage,aError,iNotifyCellInfoRequests);
|
|
1427 |
}
|
|
1428 |
|
|
1429 |
}
|
|
1430 |
|
|
1431 |
// ---------------------------------------------------------------------------
|
|
1432 |
// CMmNetTsy::HandleCellInfoUpdate
|
|
1433 |
// This functions is called when new cell information is received. It updates
|
|
1434 |
// the cache and completes the client requests.
|
|
1435 |
// (other items were commented in a header).
|
|
1436 |
// ---------------------------------------------------------------------------
|
|
1437 |
//
|
|
1438 |
void CMmNetTsy::HandleCellInfoUpdate(CMmDataPackage* aDataPackage,
|
|
1439 |
TInt aError,
|
|
1440 |
RArray< TCellInformationRequest >& aRequests)
|
|
1441 |
{
|
|
1442 |
RMobilePhone::TMobilePhoneCellInfoV9 cellInfo;
|
|
1443 |
if (aError == KErrNone)
|
|
1444 |
{
|
|
1445 |
aDataPackage->UnPackData ( cellInfo );
|
|
1446 |
|
|
1447 |
// update cache
|
|
1448 |
iCachedCellInfoV9.SetValue(cellInfo);
|
|
1449 |
}
|
|
1450 |
else
|
|
1451 |
{
|
|
1452 |
iCachedCellInfoV9.SetCacheDirty();
|
|
1453 |
}
|
|
1454 |
|
|
1455 |
// complete clients
|
|
1456 |
const TInt KRequestCount = aRequests.Count();
|
|
1457 |
for ( TInt i=0; i < KRequestCount; i++ )
|
|
1458 |
{
|
|
1459 |
TCellInformationRequest req = aRequests[ i ];
|
|
1460 |
|
|
1461 |
if (aError == KErrNone)
|
|
1462 |
{
|
|
1463 |
//set value in client side
|
|
1464 |
if((*req.iCellInfoPckg)().ExtensionId() == KEtelExtMultimodeV9)
|
|
1465 |
{
|
|
1466 |
|
|
1467 |
RMobilePhone::TMobilePhoneCellInfoV9Pckg* clientCellInfoPckgPtr =
|
|
1468 |
reinterpret_cast<RMobilePhone::TMobilePhoneCellInfoV9Pckg*>(req.iCellInfoPckg);
|
|
1469 |
(*clientCellInfoPckgPtr)() = cellInfo;
|
|
1470 |
}
|
|
1471 |
}
|
|
1472 |
|
|
1473 |
//Complete the client request
|
|
1474 |
TFLOGSTRING3("TSY: CMmNetTsy::CompleteCellInfoReq client: %d; Handle: %d", i, req.iReqHandle );
|
|
1475 |
iMmPhoneTsy->ReqCompleted( req.iReqHandle, aError );
|
|
1476 |
}
|
|
1477 |
// Destroy array
|
|
1478 |
for ( TInt i=0; i < KRequestCount; i++ ) // Remove only the completed ones.
|
|
1479 |
// During the ReqCompleted ETEL
|
|
1480 |
// reposts notifiers, so the array might
|
|
1481 |
// be bigger then KRequestCount and we must remove
|
|
1482 |
// only the ones that completed.
|
|
1483 |
{
|
|
1484 |
aRequests.Remove(0);
|
|
1485 |
}
|
|
1486 |
if(KRequestCount>0)
|
|
1487 |
{
|
|
1488 |
aRequests.Compress();
|
|
1489 |
}
|
|
1490 |
}
|
|
1491 |
|
|
1492 |
// ---------------------------------------------------------------------------
|
|
1493 |
// CMmNetTsy::GetNetworkName
|
|
1494 |
// Gets name information about the currently registered network.
|
|
1495 |
// (other items were commented in a header).
|
|
1496 |
// ---------------------------------------------------------------------------
|
|
1497 |
//
|
|
1498 |
TInt CMmNetTsy::GetNetworkName(
|
|
1499 |
const TTsyReqHandle aTsyReqHandle,
|
|
1500 |
TDes8* aNetworkNamePckg,
|
|
1501 |
TDes8* aPlmnPckg ) const
|
|
1502 |
{
|
|
1503 |
TFLOGSTRING("TSY: CMmNetTsy::GetNetworkName");
|
|
1504 |
TInt ret ( KErrGeneral );
|
|
1505 |
|
|
1506 |
if( sizeof(RMobilePhone::TMobilePhoneNetworkNameV3) > aNetworkNamePckg->MaxLength() ||
|
|
1507 |
sizeof(RMobilePhone::TMobilePhoneOPlmnV3) > aPlmnPckg->MaxLength() )
|
|
1508 |
{
|
|
1509 |
TFLOGSTRING ("TSY: CMmNetTsy::GetNetworkName bad size argument");
|
|
1510 |
// Complete the request with appropiate error
|
|
1511 |
ret = KErrArgument;
|
|
1512 |
}
|
|
1513 |
|
|
1514 |
else
|
|
1515 |
{
|
|
1516 |
//unpack the paramters
|
|
1517 |
TPckg<RMobilePhone::TMobilePhoneNetworkNameV3>* networknamePckg =
|
|
1518 |
( TPckg<RMobilePhone::TMobilePhoneNetworkNameV3>* ) aNetworkNamePckg;
|
|
1519 |
RMobilePhone::TMobilePhoneNetworkNameV3& networkName =
|
|
1520 |
( *networknamePckg )();
|
|
1521 |
|
|
1522 |
TPckg<RMobilePhone::TMobilePhoneOPlmnV3>* plmnPckg =
|
|
1523 |
( TPckg<RMobilePhone::TMobilePhoneOPlmnV3>* ) aPlmnPckg;
|
|
1524 |
RMobilePhone::TMobilePhoneOPlmnV3& plmn = ( *plmnPckg )();
|
|
1525 |
|
|
1526 |
RMobilePhone::TMobilePhoneNetworkInfoV8 networkInfo;
|
|
1527 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1528 |
GetCurrentNetworkNoLocation( &networkInfo );
|
|
1529 |
|
|
1530 |
networkName.iLongName.Copy( networkInfo.iLongName );
|
|
1531 |
networkName.iShortName.Copy( networkInfo.iShortName );
|
|
1532 |
plmn.iCountryCode.Copy( networkInfo.iCountryCode );
|
|
1533 |
plmn.iNetworkId.Copy( networkInfo.iNetworkId );
|
|
1534 |
TFLOGSTRING2("TSY: CMmNetTsy::GetNetworkName, iLongName: %S", &networkName.iLongName);
|
|
1535 |
|
|
1536 |
if( KErrNone == ret )
|
|
1537 |
{
|
|
1538 |
TFLOGSTRING2("TSY: CMmNetTsy::GetNetworkName - completing, ret: %d", ret);
|
|
1539 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
1540 |
}
|
|
1541 |
}
|
|
1542 |
|
|
1543 |
return ret;
|
|
1544 |
}
|
|
1545 |
|
|
1546 |
// ---------------------------------------------------------------------------
|
|
1547 |
// CMmNetTsy::GetCurrentNetworkNoLocation
|
|
1548 |
// Gets information about the currently registered network, but not about the
|
|
1549 |
// location (LAC and Cell Id).
|
|
1550 |
// (other items were commented in a header).
|
|
1551 |
// ---------------------------------------------------------------------------
|
|
1552 |
//
|
|
1553 |
TInt CMmNetTsy::GetCurrentNetworkNoLocation(
|
|
1554 |
const TTsyReqHandle aTsyReqHandle,
|
|
1555 |
TDes8* aNetworkInfoPckg ) const
|
|
1556 |
{
|
|
1557 |
TFLOGSTRING("TSY: CMmNetTsy::GetCurrentNetworkNoLocation");
|
|
1558 |
|
|
1559 |
TInt ret( KErrNotSupported );
|
|
1560 |
|
|
1561 |
TPckg<RMobilePhone::TMultimodeType>* networkInfoTempPckg =
|
|
1562 |
REINTERPRET_CAST( TPckg<RMobilePhone::TMultimodeType>*,
|
|
1563 |
aNetworkInfoPckg );
|
|
1564 |
RMobilePhone::TMultimodeType& networkinfotemp =
|
|
1565 |
( *networkInfoTempPckg )();
|
|
1566 |
|
|
1567 |
if ( KETelExtMultimodeV1 == networkinfotemp.ExtensionId() )
|
|
1568 |
{
|
|
1569 |
// create reference in to data on the end of the clients pointer
|
|
1570 |
RMobilePhone::TMobilePhoneNetworkInfoV1Pckg* networkInfoV1Pckg =
|
|
1571 |
( RMobilePhone::TMobilePhoneNetworkInfoV1Pckg* ) aNetworkInfoPckg;
|
|
1572 |
RMobilePhone::TMobilePhoneNetworkInfoV1& networkInfoV1 =
|
|
1573 |
( *networkInfoV1Pckg )();
|
|
1574 |
|
|
1575 |
//get the data from the extension
|
|
1576 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1577 |
GetCurrentNetworkNoLocationV1( &networkInfoV1 );
|
|
1578 |
}
|
|
1579 |
else if ( KETelExtMultimodeV2 == networkinfotemp.ExtensionId() )
|
|
1580 |
{
|
|
1581 |
RMobilePhone::TMobilePhoneNetworkInfoV2Pckg* networkInfoV2Pckg =
|
|
1582 |
( RMobilePhone::TMobilePhoneNetworkInfoV2Pckg* ) aNetworkInfoPckg;
|
|
1583 |
RMobilePhone::TMobilePhoneNetworkInfoV2& networkInfoV2 =
|
|
1584 |
( *networkInfoV2Pckg )();
|
|
1585 |
|
|
1586 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1587 |
GetCurrentNetworkNoLocationV2( &networkInfoV2 );
|
|
1588 |
}
|
|
1589 |
else if ( KEtelExtMultimodeV5 == networkinfotemp.ExtensionId() )
|
|
1590 |
{
|
|
1591 |
RMobilePhone::TMobilePhoneNetworkInfoV5Pckg* networkInfoV5Pckg =
|
|
1592 |
( RMobilePhone::TMobilePhoneNetworkInfoV5Pckg* ) aNetworkInfoPckg;
|
|
1593 |
RMobilePhone::TMobilePhoneNetworkInfoV5& networkInfoV5 =
|
|
1594 |
( *networkInfoV5Pckg )();
|
|
1595 |
|
|
1596 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1597 |
GetCurrentNetworkNoLocationV5( &networkInfoV5 );
|
|
1598 |
}
|
|
1599 |
else if ( KEtelExtMultimodeV8 == networkinfotemp.ExtensionId() )
|
|
1600 |
{
|
|
1601 |
RMobilePhone::TMobilePhoneNetworkInfoV8Pckg* networkInfoV8Pckg =
|
|
1602 |
( RMobilePhone::TMobilePhoneNetworkInfoV8Pckg* ) aNetworkInfoPckg;
|
|
1603 |
RMobilePhone::TMobilePhoneNetworkInfoV8& networkInfoV8 =
|
|
1604 |
( *networkInfoV8Pckg )();
|
|
1605 |
|
|
1606 |
ret = iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1607 |
GetCurrentNetworkNoLocation( &networkInfoV8 );
|
|
1608 |
}
|
|
1609 |
|
|
1610 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
1611 |
|
|
1612 |
return KErrNone;
|
|
1613 |
}
|
|
1614 |
|
|
1615 |
// ---------------------------------------------------------------------------
|
|
1616 |
// CMmNetTsy::NotifyCurrentNetworkNoLocationChangeL
|
|
1617 |
// Notifies client of changes to the current network
|
|
1618 |
// (other items were commented in a header).
|
|
1619 |
// ---------------------------------------------------------------------------
|
|
1620 |
//
|
|
1621 |
TInt CMmNetTsy::NotifyCurrentNetworkNoLocationChangeL(
|
|
1622 |
const TTsyReqHandle aTsyReqHandle,
|
|
1623 |
TDes8* aNetworkInfoPckg )
|
|
1624 |
{
|
|
1625 |
TFLOGSTRING("TSY: CMmNetTsy::NotifyCurrentNetworkNoLocationChangeL");
|
|
1626 |
|
|
1627 |
// save the handle and the request type
|
|
1628 |
iMmPhoneTsy->iReqHandleType =
|
|
1629 |
CMmPhoneTsy::EMultimodePhoneNotifyCurrentNetworkNoLocationChange;
|
|
1630 |
|
|
1631 |
// save request handle in queue
|
|
1632 |
TNwInfoRequest req;
|
|
1633 |
req.iReqHandle = aTsyReqHandle;
|
|
1634 |
req.iRetNwInfoPckg = REINTERPRET_CAST(
|
|
1635 |
TPckg<RMobilePhone::TMultimodeType>*, aNetworkInfoPckg );
|
|
1636 |
iNotifyCurrentNwNoLocationRequests.AppendL( req );
|
|
1637 |
|
|
1638 |
return KErrNone;
|
|
1639 |
}
|
|
1640 |
|
|
1641 |
// ---------------------------------------------------------------------------
|
|
1642 |
// CMmNetTsy::NotifyCurrentNetworkNoLocationChangeCancel
|
|
1643 |
// Cancels an outstanding NotifyCurrentNetworkChange request
|
|
1644 |
// (other items were commented in a header).
|
|
1645 |
// ---------------------------------------------------------------------------
|
|
1646 |
//
|
|
1647 |
TInt CMmNetTsy::NotifyCurrentNetworkNoLocationChangeCancel(
|
|
1648 |
const TTsyReqHandle aTsyReqHandle )
|
|
1649 |
{
|
|
1650 |
TFLOGSTRING("TSY: CMmNetTsy::NotifyCurrentNetworkNoLocationChangeCancel");
|
|
1651 |
|
|
1652 |
// find the correct ReqHandle...
|
|
1653 |
for ( TInt i = 0; i < iNotifyCurrentNwNoLocationRequests.Count(); i++ )
|
|
1654 |
{
|
|
1655 |
if ( aTsyReqHandle ==
|
|
1656 |
iNotifyCurrentNwNoLocationRequests[i].iReqHandle )
|
|
1657 |
{
|
|
1658 |
iMmPhoneTsy->iTsyReqHandleStore->
|
|
1659 |
ResetTsyReqHandle( CMmPhoneTsy
|
|
1660 |
::EMultimodePhoneNotifyCurrentNetworkNoLocationChange );
|
|
1661 |
|
|
1662 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
1663 |
|
|
1664 |
iNotifyCurrentNwNoLocationRequests.Remove( i );
|
|
1665 |
iNotifyCurrentNwNoLocationRequests.Compress();
|
|
1666 |
// end the FOR-loop, there can be only one identical reqhandle
|
|
1667 |
// so there is no reason why the array-loop should continue
|
|
1668 |
break;
|
|
1669 |
}
|
|
1670 |
}
|
|
1671 |
|
|
1672 |
return KErrNone;
|
|
1673 |
}
|
|
1674 |
|
|
1675 |
// ---------------------------------------------------------------------------
|
|
1676 |
// CMmNetTsy::NotifyCurrentNetworkChangeL
|
|
1677 |
// Notifies client of changes to the current network
|
|
1678 |
// (other items were commented in a header).
|
|
1679 |
// ---------------------------------------------------------------------------
|
|
1680 |
//
|
|
1681 |
TInt CMmNetTsy::NotifyCurrentNetworkChangeL(
|
|
1682 |
const TTsyReqHandle aTsyReqHandle,
|
|
1683 |
TDes8* aNetworkInfoPckg,
|
|
1684 |
RMobilePhone::TMobilePhoneLocationAreaV1* aArea )
|
|
1685 |
{
|
|
1686 |
TFLOGSTRING("TSY: CMmNetTsy::NotifyCurrentNetworkChangeL");
|
|
1687 |
|
|
1688 |
TInt ret = KErrArgument;
|
|
1689 |
TInt length = aNetworkInfoPckg->MaxLength();
|
|
1690 |
|
|
1691 |
if ( sizeof( RMobilePhone::TMobilePhoneNetworkInfoV1 ) == length ||
|
|
1692 |
sizeof( RMobilePhone::TMobilePhoneNetworkInfoV2 ) == length ||
|
|
1693 |
sizeof( RMobilePhone::TMobilePhoneNetworkInfoV5 ) == length ||
|
|
1694 |
sizeof( RMobilePhone::TMobilePhoneNetworkInfoV8 ) == length )
|
|
1695 |
{
|
|
1696 |
ret = KErrNone;
|
|
1697 |
// save the handle and the request type
|
|
1698 |
iMmPhoneTsy->iReqHandleType =
|
|
1699 |
CMmPhoneTsy::EMultimodePhoneNotifyCurrentNetworkChange;
|
|
1700 |
|
|
1701 |
// save request handle and client-side pointer and append
|
|
1702 |
// it in to a queue
|
|
1703 |
TNwInfoRequestWithLocation req;
|
|
1704 |
req.iReqHandle = aTsyReqHandle;
|
|
1705 |
req.iRetNwInfoPckg = REINTERPRET_CAST(
|
|
1706 |
TPckg<RMobilePhone::TMultimodeType>*, aNetworkInfoPckg );
|
|
1707 |
req.iRetLocationArea = REINTERPRET_CAST(
|
|
1708 |
RMobilePhone::TMobilePhoneLocationAreaV1*, aArea );
|
|
1709 |
iNotifyCurrentNwRequests.AppendL( req );
|
|
1710 |
}
|
|
1711 |
|
|
1712 |
return ret;
|
|
1713 |
}
|
|
1714 |
|
|
1715 |
// ---------------------------------------------------------------------------
|
|
1716 |
// CMmNetTsy::NotifyCurrentNetworkChangeCancel
|
|
1717 |
// Cancels an outstanding NotifyCurrentNetworkChange request
|
|
1718 |
// (other items were commented in a header).
|
|
1719 |
// ---------------------------------------------------------------------------
|
|
1720 |
//
|
|
1721 |
TInt CMmNetTsy::NotifyCurrentNetworkChangeCancel(
|
|
1722 |
const TTsyReqHandle aTsyReqHandle )
|
|
1723 |
{
|
|
1724 |
TFLOGSTRING("TSY: CMmNetTsy::NotifyCurrentNetworkChangeCancel");
|
|
1725 |
|
|
1726 |
// find the correct ReqHandle...
|
|
1727 |
for ( TInt i = 0; i < iNotifyCurrentNwRequests.Count(); i++ )
|
|
1728 |
{
|
|
1729 |
if ( aTsyReqHandle == iNotifyCurrentNwRequests[i].iReqHandle )
|
|
1730 |
{
|
|
1731 |
// cancel the request...
|
|
1732 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1733 |
CMmPhoneTsy::EMultimodePhoneNotifyCurrentNetworkChange );
|
|
1734 |
|
|
1735 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
1736 |
|
|
1737 |
// remove the request from the queue
|
|
1738 |
iNotifyCurrentNwRequests.Remove( i );
|
|
1739 |
iNotifyCurrentNwRequests.Compress();
|
|
1740 |
// end the FOR-loop, there can be only one identical reqhandle
|
|
1741 |
// so there is no reason why the array-loop should continue
|
|
1742 |
break;
|
|
1743 |
}
|
|
1744 |
}
|
|
1745 |
return KErrNone;
|
|
1746 |
}
|
|
1747 |
|
|
1748 |
// ---------------------------------------------------------------------------
|
|
1749 |
// CMmNetTsy::CompleteNotifyCurrentNetworkChange
|
|
1750 |
// Completes a NotifyCurrentNetworkChange request to client side
|
|
1751 |
// Completes a NotifyCurrentNetworkNoLocationChange request to client side
|
|
1752 |
// (other items were commented in a header).
|
|
1753 |
// ---------------------------------------------------------------------------
|
|
1754 |
//
|
|
1755 |
void CMmNetTsy::CompleteNotifyCurrentNetworkChange(
|
|
1756 |
CMmDataPackage* aDataPackage,
|
|
1757 |
TInt aResult )
|
|
1758 |
{
|
|
1759 |
TFLOGSTRING("TSY: CMmNetTsy::CompleteNotifyCurrentNetworkChange");
|
|
1760 |
|
|
1761 |
// create a copy of the NW info sended by the LTSY
|
|
1762 |
RMobilePhone::TMobilePhoneNetworkInfoV8 networkInfo;
|
|
1763 |
RMobilePhone::TMobilePhoneLocationAreaV1 locationArea;
|
|
1764 |
|
|
1765 |
aDataPackage->UnPackData ( networkInfo, locationArea );
|
|
1766 |
TFLOGSTRING2("TSY: CMmNetTsy::CompleteNotifyCurrentNetworkChange, new extension ID: %d", networkInfo.ExtensionId() );
|
|
1767 |
|
|
1768 |
// empty additional extension information...
|
|
1769 |
if ( KETelExtMultimodeV1 == networkInfo.ExtensionId() )
|
|
1770 |
{
|
|
1771 |
networkInfo.iAccess = RMobilePhone::ENetworkAccessUnknown;
|
|
1772 |
networkInfo.iHsdpaAvailableIndicator = EFalse;
|
|
1773 |
networkInfo.iEgprsAvailableIndicator = EFalse;
|
|
1774 |
networkInfo.iHsupaAvailableIndicator = EFalse;
|
|
1775 |
}
|
|
1776 |
else if ( KETelExtMultimodeV2 == networkInfo.ExtensionId() )
|
|
1777 |
{
|
|
1778 |
networkInfo.iHsdpaAvailableIndicator = EFalse;
|
|
1779 |
networkInfo.iEgprsAvailableIndicator = EFalse;
|
|
1780 |
networkInfo.iHsupaAvailableIndicator = EFalse;
|
|
1781 |
}
|
|
1782 |
else if ( KEtelExtMultimodeV5 == networkInfo.ExtensionId() )
|
|
1783 |
{
|
|
1784 |
networkInfo.iHsupaAvailableIndicator = EFalse;
|
|
1785 |
}
|
|
1786 |
|
|
1787 |
// Get the previous NW information
|
|
1788 |
RMobilePhone::TMobilePhoneNetworkInfoV8 previousInfo;
|
|
1789 |
RMobilePhone::TMobilePhoneLocationAreaV1 previousLocationArea;
|
|
1790 |
|
|
1791 |
iMmPhoneTsy->iMmPhoneExtInterface->GetCurrentNetwork( &previousInfo,
|
|
1792 |
&previousLocationArea );
|
|
1793 |
|
|
1794 |
// continue only if values have changed; NW and location information
|
|
1795 |
if ( IsNetworkInfoChanged( previousInfo, networkInfo ) ||
|
|
1796 |
IsAreaInfoChanged( previousLocationArea, locationArea ) )
|
|
1797 |
{
|
|
1798 |
if ( KErrNone == aResult )
|
|
1799 |
{
|
|
1800 |
// inform the extension of the network change
|
|
1801 |
iMmPhoneTsy->iMmPhoneExtInterface->SetCurrentNetwork(
|
|
1802 |
networkInfo, locationArea );
|
|
1803 |
}
|
|
1804 |
// reset req handle. Returns the deleted req handle
|
|
1805 |
TTsyReqHandle reqHandle =
|
|
1806 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1807 |
CMmPhoneTsy::EMultimodePhoneNotifyCurrentNetworkChange );
|
|
1808 |
TFLOGSTRING2("TSY: CMmNetTsy::CompleteNotifyCurrentNetworkChange, req handler =%u", reqHandle );
|
|
1809 |
|
|
1810 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
1811 |
{
|
|
1812 |
TInt requestCount = iNotifyCurrentNwRequests.Count();
|
|
1813 |
TFLOGSTRING2("TSY: CMmNetTsy::CompleteNotifyCurrentNetworkChange, requestCount: %d ", requestCount );
|
|
1814 |
|
|
1815 |
// Complete all notification requests...
|
|
1816 |
for ( TInt i = 0; i < requestCount; i++ )
|
|
1817 |
{
|
|
1818 |
TFLOGSTRING2("TSY: CMmNetTsy::CompleteNotifyCurrentNetworkChange, Loc; array: %d ", i );
|
|
1819 |
|
|
1820 |
// copy the infromation to client, 0 = first index
|
|
1821 |
switch ( ( *( iNotifyCurrentNwRequests[ 0 ].
|
|
1822 |
iRetNwInfoPckg ) )().ExtensionId() )
|
|
1823 |
{
|
|
1824 |
case KETelExtMultimodeV1:
|
|
1825 |
{
|
|
1826 |
// create reference to the client side data
|
|
1827 |
// 0 = first and current index of the array
|
|
1828 |
RMobilePhone::TMobilePhoneNetworkInfoV1&
|
|
1829 |
retNetworkInfoV1 = ( *( REINTERPRET_CAST(
|
|
1830 |
TPckg<RMobilePhone::TMobilePhoneNetworkInfoV1>*,
|
|
1831 |
iNotifyCurrentNwRequests[ 0 ].
|
|
1832 |
iRetNwInfoPckg ) ) )();
|
|
1833 |
|
|
1834 |
iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1835 |
GetCurrentNetworkNoLocationV1(
|
|
1836 |
&retNetworkInfoV1 );
|
|
1837 |
} break;
|
|
1838 |
case KETelExtMultimodeV2:
|
|
1839 |
{
|
|
1840 |
// 0 = first and current index of the array
|
|
1841 |
RMobilePhone::TMobilePhoneNetworkInfoV2&
|
|
1842 |
retNetworkInfoV2 = ( *( REINTERPRET_CAST(
|
|
1843 |
TPckg<RMobilePhone::TMobilePhoneNetworkInfoV2>*,
|
|
1844 |
iNotifyCurrentNwRequests[ 0 ].
|
|
1845 |
iRetNwInfoPckg ) ) )();
|
|
1846 |
|
|
1847 |
iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1848 |
GetCurrentNetworkNoLocationV2(
|
|
1849 |
&retNetworkInfoV2 );
|
|
1850 |
} break;
|
|
1851 |
case KEtelExtMultimodeV5:
|
|
1852 |
{
|
|
1853 |
// 0 = first and current index of the array
|
|
1854 |
RMobilePhone::TMobilePhoneNetworkInfoV5&
|
|
1855 |
retNetworkInfoV5 = ( *( REINTERPRET_CAST(
|
|
1856 |
TPckg<RMobilePhone::TMobilePhoneNetworkInfoV5>*,
|
|
1857 |
iNotifyCurrentNwRequests[ 0 ].
|
|
1858 |
iRetNwInfoPckg ) ) )();
|
|
1859 |
|
|
1860 |
iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1861 |
GetCurrentNetworkNoLocationV5(
|
|
1862 |
&retNetworkInfoV5 );
|
|
1863 |
} break;
|
|
1864 |
case KEtelExtMultimodeV8:
|
|
1865 |
{
|
|
1866 |
// 0 = first and current index of the array
|
|
1867 |
RMobilePhone::TMobilePhoneNetworkInfoV8&
|
|
1868 |
retNetworkInfoV8 = (*(reinterpret_cast<TPckg<RMobilePhone::TMobilePhoneNetworkInfoV8>*>
|
|
1869 |
(iNotifyCurrentNwRequests[ 0 ].iRetNwInfoPckg)))();
|
|
1870 |
|
|
1871 |
iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1872 |
GetCurrentNetworkNoLocation(&retNetworkInfoV8 );
|
|
1873 |
} break;
|
|
1874 |
default:
|
|
1875 |
// error case, complete with not supported
|
|
1876 |
aResult = KErrNotSupported;
|
|
1877 |
break;
|
|
1878 |
}
|
|
1879 |
// copy location data to client side
|
|
1880 |
// 0 = first and also current index of the array
|
|
1881 |
iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1882 |
GetCurrentNetwork( NULL,
|
|
1883 |
iNotifyCurrentNwRequests[ 0 ].iRetLocationArea );
|
|
1884 |
|
|
1885 |
// completing will start automatically new notification,
|
|
1886 |
// this will be appended to the end of the array
|
|
1887 |
// 0 = first and also current index of the array
|
|
1888 |
iMmPhoneTsy->ReqCompleted( iNotifyCurrentNwRequests[ 0 ].
|
|
1889 |
iReqHandle, aResult );
|
|
1890 |
|
|
1891 |
// remove the current notification from the array
|
|
1892 |
// 0 = first and also current index of the array
|
|
1893 |
iNotifyCurrentNwRequests.Remove( 0 );
|
|
1894 |
}
|
|
1895 |
// compress the array
|
|
1896 |
iNotifyCurrentNwRequests.Compress();
|
|
1897 |
}
|
|
1898 |
}
|
|
1899 |
|
|
1900 |
// also complete the CompleteNotifyCurrentNetworkNoLocationChange
|
|
1901 |
if ( IsNetworkInfoChanged( previousInfo, networkInfo ) )
|
|
1902 |
{
|
|
1903 |
//reset req handle. Returns the deleted req handle
|
|
1904 |
TTsyReqHandle reqHandle =
|
|
1905 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
1906 |
CMmPhoneTsy::EMultimodePhoneNotifyCurrentNetworkNoLocationChange );
|
|
1907 |
TFLOGSTRING2("TSY: CMmNetTsy::CompleteNotifyCurrentNetworkChange, req handler NoLoc =%u", reqHandle );
|
|
1908 |
|
|
1909 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
1910 |
{
|
|
1911 |
TInt requestCount = iNotifyCurrentNwNoLocationRequests.Count();
|
|
1912 |
TFLOGSTRING2("TSY: CMmNetTsy::CompleteNotifyCurrentNetworkChange, requestCount NoLoc: %d ", requestCount );
|
|
1913 |
|
|
1914 |
// Complete all requests...
|
|
1915 |
for ( TInt indx = 0; indx < requestCount; indx++ )
|
|
1916 |
{
|
|
1917 |
TFLOGSTRING2("TSY: CMmNetTsy::CompleteNotifyCurrentNetworkChange, NoLoc; array: %d ", indx );
|
|
1918 |
|
|
1919 |
// copy the infromation to client, 0 = first index
|
|
1920 |
switch ( ( *( iNotifyCurrentNwNoLocationRequests[ 0 ].
|
|
1921 |
iRetNwInfoPckg ) )().ExtensionId() )
|
|
1922 |
{
|
|
1923 |
case KETelExtMultimodeV1:
|
|
1924 |
{
|
|
1925 |
// create reference to the client side data
|
|
1926 |
// 0 = first and current index of the array
|
|
1927 |
RMobilePhone::TMobilePhoneNetworkInfoV1&
|
|
1928 |
retNetworkInfoV1 = ( *( REINTERPRET_CAST(
|
|
1929 |
TPckg<RMobilePhone::TMobilePhoneNetworkInfoV1>*,
|
|
1930 |
iNotifyCurrentNwNoLocationRequests[ 0 ].
|
|
1931 |
iRetNwInfoPckg ) ) )();
|
|
1932 |
|
|
1933 |
iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1934 |
GetCurrentNetworkNoLocationV1 (
|
|
1935 |
&retNetworkInfoV1 );
|
|
1936 |
} break;
|
|
1937 |
case KETelExtMultimodeV2:
|
|
1938 |
{
|
|
1939 |
// 0 = first and current index of the array
|
|
1940 |
RMobilePhone::TMobilePhoneNetworkInfoV2&
|
|
1941 |
retNetworkInfoV2 = ( *( REINTERPRET_CAST(
|
|
1942 |
TPckg<RMobilePhone::TMobilePhoneNetworkInfoV2>*,
|
|
1943 |
iNotifyCurrentNwNoLocationRequests[ 0 ].
|
|
1944 |
iRetNwInfoPckg ) ) )();
|
|
1945 |
|
|
1946 |
iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1947 |
GetCurrentNetworkNoLocationV2 (
|
|
1948 |
&retNetworkInfoV2 );
|
|
1949 |
} break;
|
|
1950 |
case KEtelExtMultimodeV5:
|
|
1951 |
{
|
|
1952 |
// 0 = first and current index of the array
|
|
1953 |
RMobilePhone::TMobilePhoneNetworkInfoV5&
|
|
1954 |
retNetworkInfoV5 = ( *( REINTERPRET_CAST(
|
|
1955 |
TPckg<RMobilePhone::TMobilePhoneNetworkInfoV5>*,
|
|
1956 |
iNotifyCurrentNwNoLocationRequests[ 0 ].
|
|
1957 |
iRetNwInfoPckg ) ) )();
|
|
1958 |
iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1959 |
GetCurrentNetworkNoLocationV5 ( &retNetworkInfoV5 );
|
|
1960 |
} break;
|
|
1961 |
case KEtelExtMultimodeV8:
|
|
1962 |
{
|
|
1963 |
// 0 = first and current index of the array
|
|
1964 |
RMobilePhone::TMobilePhoneNetworkInfoV8&
|
|
1965 |
retNetworkInfoV8 = (*(reinterpret_cast<TPckg<RMobilePhone::TMobilePhoneNetworkInfoV8>*>
|
|
1966 |
(iNotifyCurrentNwNoLocationRequests[ 0 ].iRetNwInfoPckg)))();
|
|
1967 |
|
|
1968 |
iMmPhoneTsy->iMmPhoneExtInterface->
|
|
1969 |
GetCurrentNetworkNoLocation ( &retNetworkInfoV8 );
|
|
1970 |
|
|
1971 |
|
|
1972 |
} break;
|
|
1973 |
default:
|
|
1974 |
// error case, complete with not supported
|
|
1975 |
aResult = KErrNotSupported;
|
|
1976 |
break;
|
|
1977 |
}
|
|
1978 |
// completing will start automatically new notification,
|
|
1979 |
// this will be appended to the end of the array
|
|
1980 |
// 0 = first and also current index of the array
|
|
1981 |
iMmPhoneTsy->ReqCompleted(
|
|
1982 |
iNotifyCurrentNwNoLocationRequests[ 0 ].
|
|
1983 |
iReqHandle, aResult );
|
|
1984 |
|
|
1985 |
// remove the current notification from the array
|
|
1986 |
// 0 = first and also current index of the array
|
|
1987 |
iNotifyCurrentNwNoLocationRequests.Remove( 0 );
|
|
1988 |
}
|
|
1989 |
// compress the array
|
|
1990 |
iNotifyCurrentNwNoLocationRequests.Compress();
|
|
1991 |
}
|
|
1992 |
}
|
|
1993 |
}
|
|
1994 |
|
|
1995 |
// ---------------------------------------------------------------------------
|
|
1996 |
// CMmNetTsy::NotifyCellInfoChangeL
|
|
1997 |
// Notifies client of changes to the cell information
|
|
1998 |
// (other items were commented in a header).
|
|
1999 |
// ---------------------------------------------------------------------------
|
|
2000 |
//
|
|
2001 |
TInt CMmNetTsy::NotifyCellInfoChangeL(
|
|
2002 |
const TTsyReqHandle aTsyReqHandle,
|
|
2003 |
TDes8* aCellInfoPckg)
|
|
2004 |
{
|
|
2005 |
TFLOGSTRING2("TSY: CMmNetTsy::NotifyCellInfoChangeL; Handel: %d", aTsyReqHandle);
|
|
2006 |
if(sizeof(RMobilePhone::TMobilePhoneCellInfoV9) > aCellInfoPckg->MaxLength())
|
|
2007 |
{
|
|
2008 |
TFLOGSTRING ("TSY: CMmNetTsy::NotifyCellInfoChangeL Bad size argument");
|
|
2009 |
// Complete the request with appropiate error
|
|
2010 |
return KErrArgument;
|
|
2011 |
}
|
|
2012 |
TPckg<RMobilePhone::TMultimodeType>* cellInfoTempPckg =
|
|
2013 |
reinterpret_cast< TPckg<RMobilePhone::TMultimodeType>*> (aCellInfoPckg );
|
|
2014 |
RMobilePhone::TMultimodeType& cellInfoTemp = ( *cellInfoTempPckg )();
|
|
2015 |
if(cellInfoTemp.ExtensionId()!=KEtelExtMultimodeV9)
|
|
2016 |
{
|
|
2017 |
TFLOGSTRING ("TSY: CMmNetTsy::GetCellInfo Bad version argument");
|
|
2018 |
// Complete the request with appropiate error
|
|
2019 |
return KErrArgument;
|
|
2020 |
}
|
|
2021 |
TInt ret = KErrNone;
|
|
2022 |
if (iCachedCellInfoV9.CacheAbility() == ECacheUnknown)
|
|
2023 |
{
|
|
2024 |
ret = DoNotifyCellInfoChangeL(aTsyReqHandle);
|
|
2025 |
}
|
|
2026 |
else if (iCachedCellInfoV9.CacheAbility() == ECacheDisabled)
|
|
2027 |
{
|
|
2028 |
ret = KErrNotSupported;
|
|
2029 |
}
|
|
2030 |
if(ret == KErrNone)
|
|
2031 |
{
|
|
2032 |
TCellInformationRequest req;
|
|
2033 |
req.iReqHandle = aTsyReqHandle;
|
|
2034 |
req.iCellInfoPckg = cellInfoTempPckg;
|
|
2035 |
iNotifyCellInfoRequests.AppendL( req );
|
|
2036 |
}
|
|
2037 |
return ret;
|
|
2038 |
}
|
|
2039 |
|
|
2040 |
|
|
2041 |
// ---------------------------------------------------------------------------
|
|
2042 |
// CMmNetTsy::GetCellInfoCancel
|
|
2043 |
// Cancels an outstanding cell information getter request
|
|
2044 |
// (other items were commented in a header).
|
|
2045 |
// ---------------------------------------------------------------------------
|
|
2046 |
//
|
|
2047 |
TInt CMmNetTsy::GetCellInfoCancel(
|
|
2048 |
const TTsyReqHandle aTsyReqHandle )
|
|
2049 |
{
|
|
2050 |
TFLOGSTRING2("TSY: CMmNetTsy::GetCellInfoCancel; Handle: %d", aTsyReqHandle);
|
|
2051 |
// find the correct ReqHandle...
|
|
2052 |
const TInt KReqCount = iCellInfoRequests.Count();
|
|
2053 |
for ( TInt i = 0; i < KReqCount; i++ )
|
|
2054 |
{
|
|
2055 |
if ( aTsyReqHandle == iCellInfoRequests[i].iReqHandle )
|
|
2056 |
{
|
|
2057 |
// cancel the request
|
|
2058 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2059 |
CMmPhoneTsy::EMultimodePhoneGetCellInfo );
|
|
2060 |
|
|
2061 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
2062 |
|
|
2063 |
// remove the request from the queue
|
|
2064 |
iCellInfoRequests.Remove( i );
|
|
2065 |
iCellInfoRequests.Compress();
|
|
2066 |
// end the FOR-loop, there can be only one identical reqhandle
|
|
2067 |
// so there is no reason why the array-loop should continue
|
|
2068 |
break;
|
|
2069 |
}
|
|
2070 |
}
|
|
2071 |
return KErrNone;
|
|
2072 |
}
|
|
2073 |
|
|
2074 |
// ---------------------------------------------------------------------------
|
|
2075 |
// CMmNetTsy::NotifyCurrentNetworkChangeCancel
|
|
2076 |
// Cancels an outstanding NotifyCurrentNetworkChange request
|
|
2077 |
// (other items were commented in a header).
|
|
2078 |
// ---------------------------------------------------------------------------
|
|
2079 |
//
|
|
2080 |
TInt CMmNetTsy::NotifyCellInfoChangeCancel(
|
|
2081 |
const TTsyReqHandle aTsyReqHandle )
|
|
2082 |
{
|
|
2083 |
TFLOGSTRING2("TSY: CMmNetTsy::NotifyCellInfoChangeCancel; Handle: %d", aTsyReqHandle);
|
|
2084 |
|
|
2085 |
// find the correct ReqHandle...
|
|
2086 |
const TInt KReqCount = iNotifyCellInfoRequests.Count();
|
|
2087 |
for ( TInt i = 0; i < KReqCount; i++ )
|
|
2088 |
{
|
|
2089 |
if ( aTsyReqHandle == iNotifyCellInfoRequests[i].iReqHandle )
|
|
2090 |
{
|
|
2091 |
// cancel the request
|
|
2092 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2093 |
CMmPhoneTsy::EMultimodePhoneNotifyCellInfoChange );
|
|
2094 |
|
|
2095 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
2096 |
|
|
2097 |
// remove the request from the queue
|
|
2098 |
iNotifyCellInfoRequests.Remove( i );
|
|
2099 |
iNotifyCellInfoRequests.Compress();
|
|
2100 |
// end the FOR-loop, there can be only one identical reqhandle
|
|
2101 |
// so there is no reason why the array-loop should continue
|
|
2102 |
break;
|
|
2103 |
}
|
|
2104 |
}
|
|
2105 |
return KErrNone;
|
|
2106 |
}
|
|
2107 |
|
|
2108 |
// ---------------------------------------------------------------------------
|
|
2109 |
// CMmNetTsy::GetNetworkRegistrationStatusL
|
|
2110 |
// Gets the current network registration status.
|
|
2111 |
// (other items were commented in a header).
|
|
2112 |
// ---------------------------------------------------------------------------
|
|
2113 |
//
|
|
2114 |
TInt CMmNetTsy::GetNetworkRegistrationStatusL(
|
|
2115 |
const TTsyReqHandle aTsyReqHandle,
|
|
2116 |
RMobilePhone::TMobilePhoneRegistrationStatus* aStatus )
|
|
2117 |
{
|
|
2118 |
TFLOGSTRING2("TSY: CMmNetTsy::GetNetworkRegistrationStatusL Handle: %d", aTsyReqHandle);
|
|
2119 |
|
|
2120 |
// If the modem is not ready (Common TSY has not received EMmTsyBootNotifyModemStatusReadyIPC
|
|
2121 |
// from LTSY), we don't need to ask. Update registration status and complete client immediately.
|
|
2122 |
if (!iMmPhoneTsy->IsModemStatusReady())
|
|
2123 |
{
|
|
2124 |
iNWRegistrationStatus = RMobilePhone::ERegistrationUnknown;
|
|
2125 |
*aStatus = iNWRegistrationStatus;
|
|
2126 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNone );
|
|
2127 |
return KErrNone;
|
|
2128 |
}
|
|
2129 |
|
|
2130 |
if (RMobilePhone::ERegistrationUnknown == iNWRegistrationStatus) // modem is ready
|
|
2131 |
{
|
|
2132 |
TTsyReqHandle reqHandle = iMmPhoneTsy->iTsyReqHandleStore->
|
|
2133 |
GetTsyReqHandle( CMmPhoneTsy::EMultimodePhoneGetNetworkRegistrationStatus );
|
|
2134 |
|
|
2135 |
if (0 < reqHandle )
|
|
2136 |
{
|
|
2137 |
//The request is already in processing because of previous request
|
|
2138 |
TGetNetworkRegisterationRequest* req =
|
|
2139 |
new (ELeave) TGetNetworkRegisterationRequest();
|
|
2140 |
req->iReqHandle = aTsyReqHandle;
|
|
2141 |
req->iRetGetNWRegistrationStatus = aStatus;
|
|
2142 |
iRegisterationStatusRequests.AppendL( req );
|
|
2143 |
}
|
|
2144 |
else
|
|
2145 |
{
|
|
2146 |
//get mode specific information
|
|
2147 |
TInt ret ( iMmPhoneTsy->iMmPhoneExtInterface->
|
|
2148 |
GetNetworkRegistrationStatusL() );
|
|
2149 |
|
|
2150 |
if ( KErrNone != ret )
|
|
2151 |
{
|
|
2152 |
TFLOGSTRING2("TSY: CMmNetTsy::GetNetworkRegistrationStatusL - Complete with error %d", ret );
|
|
2153 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
2154 |
}
|
|
2155 |
else
|
|
2156 |
{
|
|
2157 |
TFLOGSTRING("TSY: CMmNetTsy::GetNetworkRegistrationStatusL - Client to buffer" );
|
|
2158 |
// save request handle in queue
|
|
2159 |
TGetNetworkRegisterationRequest* req =
|
|
2160 |
new (ELeave) TGetNetworkRegisterationRequest();
|
|
2161 |
req->iReqHandle = aTsyReqHandle;
|
|
2162 |
req->iRetGetNWRegistrationStatus = aStatus;
|
|
2163 |
|
|
2164 |
iRegisterationStatusRequests.AppendL( req );
|
|
2165 |
|
|
2166 |
//save tsy req handle type
|
|
2167 |
iMmPhoneTsy->iReqHandleType =
|
|
2168 |
CMmPhoneTsy::EMultimodePhoneGetNetworkRegistrationStatus;
|
|
2169 |
}
|
|
2170 |
}
|
|
2171 |
}
|
|
2172 |
else
|
|
2173 |
{
|
|
2174 |
*aStatus = iNWRegistrationStatus;
|
|
2175 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNone );
|
|
2176 |
}
|
|
2177 |
|
|
2178 |
return KErrNone;
|
|
2179 |
}
|
|
2180 |
|
|
2181 |
// ---------------------------------------------------------------------------
|
|
2182 |
// CMmNetTsy::GetNetworkRegistrationStatusCancel
|
|
2183 |
// Cancels an outstanding GetNetworkRegistrationStatus request
|
|
2184 |
// (other items were commented in a header).
|
|
2185 |
// ---------------------------------------------------------------------------
|
|
2186 |
//
|
|
2187 |
TInt CMmNetTsy::GetNetworkRegistrationStatusCancel(
|
|
2188 |
const TTsyReqHandle aTsyReqHandle )
|
|
2189 |
{
|
|
2190 |
TFLOGSTRING2("TSY: CMmNetTsy::GetNetworkRegistrationStatusCancel Handle: %d", aTsyReqHandle);
|
|
2191 |
|
|
2192 |
TInt requestCount = iRegisterationStatusRequests.Count();
|
|
2193 |
|
|
2194 |
if( 1 == requestCount )
|
|
2195 |
{
|
|
2196 |
TFLOGSTRING("TSY: CMmNetTsy::GetNetworkRegistrationStatusCancel 1 == requestCount ");
|
|
2197 |
//reset the req handle
|
|
2198 |
TTsyReqHandle reqHandle = iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2199 |
CMmPhoneTsy::EMultimodePhoneGetNetworkRegistrationStatus );
|
|
2200 |
}
|
|
2201 |
|
|
2202 |
for ( TInt i = 0; i < requestCount; i++ )
|
|
2203 |
{
|
|
2204 |
TGetNetworkRegisterationRequest* req = iRegisterationStatusRequests[ i ];
|
|
2205 |
|
|
2206 |
if( aTsyReqHandle == req->iReqHandle )
|
|
2207 |
{
|
|
2208 |
// Complete request with cancel
|
|
2209 |
iMmPhoneTsy->ReqCompleted( req->iReqHandle, KErrCancel );
|
|
2210 |
delete iRegisterationStatusRequests[ i ];
|
|
2211 |
iRegisterationStatusRequests.Remove(i);
|
|
2212 |
break;
|
|
2213 |
}
|
|
2214 |
}
|
|
2215 |
|
|
2216 |
return KErrNone;
|
|
2217 |
}
|
|
2218 |
|
|
2219 |
// ---------------------------------------------------------------------------
|
|
2220 |
// CMmNetTsy::CompleteGetNetworkRegistrationStatus
|
|
2221 |
// Completes a GetNetworkRegistrationStatus request to client side
|
|
2222 |
// (other items were commented in a header).
|
|
2223 |
// ---------------------------------------------------------------------------
|
|
2224 |
//
|
|
2225 |
void CMmNetTsy::CompleteGetNetworkRegistrationStatus(
|
|
2226 |
TInt aErrorValue )
|
|
2227 |
{
|
|
2228 |
TFLOGSTRING("TSY: CMmNetTsy::CompleteGetNetworkRegistrationStatus");
|
|
2229 |
// Reset the req handle
|
|
2230 |
TTsyReqHandle reqHandle =
|
|
2231 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2232 |
CMmPhoneTsy::EMultimodePhoneGetNetworkRegistrationStatus );
|
|
2233 |
|
|
2234 |
// Check the validity of the handler
|
|
2235 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
2236 |
{
|
|
2237 |
TInt requestCount = iRegisterationStatusRequests.Count();
|
|
2238 |
|
|
2239 |
for ( TInt i=0; i < requestCount; i++ )
|
|
2240 |
{
|
|
2241 |
TGetNetworkRegisterationRequest* req =
|
|
2242 |
iRegisterationStatusRequests[ i ];
|
|
2243 |
|
|
2244 |
//set value in client side
|
|
2245 |
*(req->iRetGetNWRegistrationStatus) = iNWRegistrationStatus;
|
|
2246 |
TFLOGSTRING2("TSY: CMmNetTsy::CompleteGetNetworkRegistrationStatus client: %d", i );
|
|
2247 |
|
|
2248 |
//Complete the client request
|
|
2249 |
iMmPhoneTsy->ReqCompleted( req->iReqHandle, aErrorValue );
|
|
2250 |
}
|
|
2251 |
}
|
|
2252 |
|
|
2253 |
// Destroy array
|
|
2254 |
iRegisterationStatusRequests.ResetAndDestroy();
|
|
2255 |
}
|
|
2256 |
// ---------------------------------------------------------------------------
|
|
2257 |
// CMmNetTsy::NotifyNetworkRegistrationStatusChange
|
|
2258 |
// Notifies of changes in current network registration status.
|
|
2259 |
// (other items were commented in a header).
|
|
2260 |
// ---------------------------------------------------------------------------
|
|
2261 |
//
|
|
2262 |
TInt CMmNetTsy::NotifyNetworkRegistrationStatusChange(
|
|
2263 |
RMobilePhone::TMobilePhoneRegistrationStatus* aStatus ) // Reg status
|
|
2264 |
{
|
|
2265 |
//save the handle type
|
|
2266 |
iMmPhoneTsy->iReqHandleType =
|
|
2267 |
CMmPhoneTsy::EMultimodePhoneNotifyNetworkRegistrationStatusChange;
|
|
2268 |
|
|
2269 |
// Save the pointer of client's status variable for future use
|
|
2270 |
iRetNWRegistrationStatus = aStatus;
|
|
2271 |
return KErrNone;
|
|
2272 |
}
|
|
2273 |
|
|
2274 |
// ---------------------------------------------------------------------------
|
|
2275 |
// CMmNetTsy::NotifyNetworkRegistrationStatusChangeCancel
|
|
2276 |
// Cancels an outstanding NotifyNetworkRegistrationStatusChange request
|
|
2277 |
// (other items were commented in a header).
|
|
2278 |
// ---------------------------------------------------------------------------
|
|
2279 |
//
|
|
2280 |
TInt CMmNetTsy::NotifyNetworkRegistrationStatusChangeCancel(
|
|
2281 |
const TTsyReqHandle aTsyReqHandle ) //Tsy request handle
|
|
2282 |
{
|
|
2283 |
// As cancel is called, the client memory address pointed to is no longer
|
|
2284 |
// valid -> NULL it
|
|
2285 |
iRetNWRegistrationStatus = NULL;
|
|
2286 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2287 |
CMmPhoneTsy::EMultimodePhoneNotifyNetworkRegistrationStatusChange );
|
|
2288 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrCancel );
|
|
2289 |
return KErrNone;
|
|
2290 |
}
|
|
2291 |
|
|
2292 |
// ---------------------------------------------------------------------------
|
|
2293 |
// CMmNetTsy::CompleteNotifyNetworkRegistrationStatusChange
|
|
2294 |
// Completes a NotifyNetworkRegistrationStatusChange request to client side
|
|
2295 |
// (other items were commented in a header).
|
|
2296 |
// ---------------------------------------------------------------------------
|
|
2297 |
//
|
|
2298 |
void CMmNetTsy::CompleteNotifyNetworkRegistrationStatusChange(
|
|
2299 |
CMmDataPackage* aDataPackage, //Contains information for client side
|
|
2300 |
TInt aResult ) // result code
|
|
2301 |
{
|
|
2302 |
TFLOGSTRING( "TSY: CMmNetTsy::CompleteNotifyNetworkRegistrationStatusChange" );
|
|
2303 |
|
|
2304 |
RMobilePhone::TMobilePhoneRegistrationStatus* regStatus = NULL;
|
|
2305 |
RMobilePhone::TMobilePhoneNetworkStatus* nwStatus = NULL;
|
|
2306 |
|
|
2307 |
aDataPackage->UnPackData ( ®Status, &nwStatus );
|
|
2308 |
|
|
2309 |
if ( *regStatus != iNWRegistrationStatus )
|
|
2310 |
{
|
|
2311 |
// Inform extension about the change
|
|
2312 |
iMmPhoneTsy->iMmPhoneExtInterface->
|
|
2313 |
CompleteNotifyNetworkRegistrationStatusChange( *regStatus );
|
|
2314 |
|
|
2315 |
// Store NEW registration status
|
|
2316 |
iNWRegistrationStatus = *regStatus;
|
|
2317 |
TFLOGSTRING2("TSY: CMmNetTsy::CompleteNotifyNetworkRegistrationStatusChange, status: %d", iNWRegistrationStatus );
|
|
2318 |
|
|
2319 |
//reset req handle. Returns the deleted req handle
|
|
2320 |
TTsyReqHandle reqHandle = iMmPhoneTsy->iTsyReqHandleStore->
|
|
2321 |
ResetTsyReqHandle(
|
|
2322 |
CMmPhoneTsy::EMultimodePhoneNotifyNetworkRegistrationStatusChange );
|
|
2323 |
|
|
2324 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
2325 |
{
|
|
2326 |
//Fill the pointer with phone capabilities
|
|
2327 |
*iRetNWRegistrationStatus = *regStatus;
|
|
2328 |
//Set pointer to NULL.
|
|
2329 |
iRetNWRegistrationStatus = NULL;
|
|
2330 |
//Complete the client request
|
|
2331 |
iMmPhoneTsy->ReqCompleted( reqHandle, aResult );
|
|
2332 |
}
|
|
2333 |
}
|
|
2334 |
}
|
|
2335 |
|
|
2336 |
// ---------------------------------------------------------------------------
|
|
2337 |
// CMmNetTsy::GetDetectedNetworksPhase1L
|
|
2338 |
// First phase of fetching detected networks. Starts the search via DOS layer
|
|
2339 |
// (other items were commented in a header).
|
|
2340 |
// ---------------------------------------------------------------------------
|
|
2341 |
//
|
|
2342 |
TInt CMmNetTsy::GetDetectedNetworksPhase1L(
|
|
2343 |
const TTsyReqHandle aTsyReqHandle, // Tsy request handle
|
|
2344 |
RMobilePhone::TClientId* aClient, // Client id
|
|
2345 |
TInt* aBufSize ) // Pointer to the buffer size
|
|
2346 |
{
|
|
2347 |
TTsyReqHandle getDetectedNetworksPhase1Handle =
|
|
2348 |
iMmPhoneTsy->iTsyReqHandleStore->GetTsyReqHandle(
|
|
2349 |
CMmPhoneTsy::EMultimodePhoneGetDetectedNetworksPhase1 );
|
|
2350 |
|
|
2351 |
//Check if operation is already ongoing, flow control done by TSY
|
|
2352 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown !=
|
|
2353 |
getDetectedNetworksPhase1Handle )
|
|
2354 |
{
|
|
2355 |
//Complete request with status value informing the client about
|
|
2356 |
//the situation.
|
|
2357 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
2358 |
}
|
|
2359 |
else
|
|
2360 |
{
|
|
2361 |
//forward request to the extension
|
|
2362 |
TInt ret ( iMmPhoneTsy->iMmPhoneExtInterface->
|
|
2363 |
GetDetectedNetworksPhase1L());
|
|
2364 |
|
|
2365 |
// Check if error occured
|
|
2366 |
if ( KErrNone != ret )
|
|
2367 |
{
|
|
2368 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
2369 |
}
|
|
2370 |
else
|
|
2371 |
{
|
|
2372 |
// Save the address of the client attribute
|
|
2373 |
iRetGetDetectedNwSize = aBufSize;
|
|
2374 |
// Presently internal attribute, used only by this method.
|
|
2375 |
iRetDetectedNwClientId = aClient;
|
|
2376 |
|
|
2377 |
//save the handle and the request type
|
|
2378 |
iMmPhoneTsy->iReqHandleType =
|
|
2379 |
CMmPhoneTsy::EMultimodePhoneGetDetectedNetworksPhase1;
|
|
2380 |
}
|
|
2381 |
}
|
|
2382 |
|
|
2383 |
// Otherwise complete request when response is received from DOS side.
|
|
2384 |
return KErrNone;
|
|
2385 |
}
|
|
2386 |
|
|
2387 |
// ---------------------------------------------------------------------------
|
|
2388 |
// CMmNetTsy::ProcessGetDetectedNetworksPhase1L
|
|
2389 |
// Processes the list gathered as result of GetDetectedNetworksPhase1
|
|
2390 |
// calculates its size and completes this information to client side. Caches
|
|
2391 |
// the list for future completion in GetDetectedNetworksPhase2
|
|
2392 |
// (other items were commented in a header).
|
|
2393 |
// ---------------------------------------------------------------------------
|
|
2394 |
//
|
|
2395 |
TInt CMmNetTsy::ProcessGetDetectedNetworksPhase1L(
|
|
2396 |
CMmDataPackage* aDataPackage, // Contains information for client side
|
|
2397 |
TInt aErrorCode ) // Error code
|
|
2398 |
{
|
|
2399 |
// Fetch the request handle from array
|
|
2400 |
TTsyReqHandle reqHandle =
|
|
2401 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2402 |
CMmPhoneTsy::EMultimodePhoneGetDetectedNetworksPhase1 );
|
|
2403 |
|
|
2404 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
2405 |
{
|
|
2406 |
// retrieve detected networks from phone,
|
|
2407 |
// store each network as a list entry,
|
|
2408 |
// stream the list and then return size of this buffer to client
|
|
2409 |
if ( KErrNone == aErrorCode )
|
|
2410 |
{
|
|
2411 |
// Store the streamed list and the client ID
|
|
2412 |
CListReadAllAttempt* read =
|
|
2413 |
CListReadAllAttempt::NewL( iRetDetectedNwClientId );
|
|
2414 |
CleanupStack::PushL( read );
|
|
2415 |
//unpack the data from DOS TSY,
|
|
2416 |
//cleanup of this data is done in DOS TSY
|
|
2417 |
CMobilePhoneNetworkListV2* list = NULL;
|
|
2418 |
aDataPackage->UnPackData ( list );
|
|
2419 |
read->iListBuf = list->StoreLC();
|
|
2420 |
CleanupStack::Pop(); // pop the CBufFlat allocated by StoreLC
|
|
2421 |
__ASSERT_DEBUG( iGetDetectedNetworks, MmTsyPanic( EPtrNull ) );
|
|
2422 |
iGetDetectedNetworks->AppendL( read );
|
|
2423 |
CleanupStack::Pop(); // pop the CListReadAllAttempt
|
|
2424 |
// return the CBufFlat's size to client
|
|
2425 |
*iRetGetDetectedNwSize = ( read->iListBuf )->Size();
|
|
2426 |
// Complete first phase of list retrieval
|
|
2427 |
iMmPhoneTsy->ReqCompleted( reqHandle, KErrNone );
|
|
2428 |
}
|
|
2429 |
// If something went wrong while receiving ISI message,
|
|
2430 |
// then handle the error situation here
|
|
2431 |
else
|
|
2432 |
{
|
|
2433 |
// Complete first phase of list retrieval with error
|
|
2434 |
iMmPhoneTsy->ReqCompleted( reqHandle, aErrorCode );
|
|
2435 |
}
|
|
2436 |
}
|
|
2437 |
return KErrNone;
|
|
2438 |
}
|
|
2439 |
|
|
2440 |
// ---------------------------------------------------------------------------
|
|
2441 |
// CMmNetTsy::GetDetectedNetworksPhase2
|
|
2442 |
// Completes the GetDetectedNetworks request initiated in
|
|
2443 |
// GetDetectedNetworksPhase1. Copies the cached detected network list to the
|
|
2444 |
// client side.
|
|
2445 |
// (other items were commented in a header).
|
|
2446 |
// ---------------------------------------------------------------------------
|
|
2447 |
//
|
|
2448 |
TInt CMmNetTsy::GetDetectedNetworksPhase2(
|
|
2449 |
const TTsyReqHandle aTsyReqHandle, // Tsy request handle
|
|
2450 |
RMobilePhone::TClientId* aClient, // Client id
|
|
2451 |
TDes8* aBuf ) // Buffer
|
|
2452 |
{
|
|
2453 |
CListReadAllAttempt* read = NULL;
|
|
2454 |
// Find the get detected network attempt from this client
|
|
2455 |
__ASSERT_DEBUG( iGetDetectedNetworks, MmTsyPanic( EPtrNull ) );
|
|
2456 |
for ( TInt i = 0; i < iGetDetectedNetworks->Count(); ++i )
|
|
2457 |
{
|
|
2458 |
read = iGetDetectedNetworks->At( i );
|
|
2459 |
if ( ( read->iClient.iSessionHandle == aClient->iSessionHandle ) &&
|
|
2460 |
( read->iClient.iSubSessionHandle == aClient->iSubSessionHandle ) )
|
|
2461 |
{
|
|
2462 |
TPtr8 bufPtr( ( read->iListBuf )->Ptr( 0 ) );
|
|
2463 |
// Copy the streamed list to the client
|
|
2464 |
aBuf->Copy( bufPtr );
|
|
2465 |
delete read;
|
|
2466 |
iGetDetectedNetworks->Delete( i );
|
|
2467 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNone );
|
|
2468 |
return KErrNone;
|
|
2469 |
}
|
|
2470 |
}
|
|
2471 |
// Should handle error case of not finding the matching client from
|
|
2472 |
// read all phase 1
|
|
2473 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNotFound );
|
|
2474 |
return KErrNone;
|
|
2475 |
}
|
|
2476 |
|
|
2477 |
// ---------------------------------------------------------------------------
|
|
2478 |
// CMmNetTsy::GetDetectedNetworksCancelL
|
|
2479 |
// Cancels via DOS TSY an outstanding GetDetectedNetworks request
|
|
2480 |
// (other items were commented in a header).
|
|
2481 |
// ---------------------------------------------------------------------------
|
|
2482 |
//
|
|
2483 |
TInt CMmNetTsy::GetDetectedNetworksCancelL(
|
|
2484 |
const TTsyReqHandle aTsyReqHandle ) const // Tsy request handle
|
|
2485 |
{
|
|
2486 |
// Fetch the request handle from array
|
|
2487 |
TTsyReqHandle processGetDetNwPhase1Handle =
|
|
2488 |
iMmPhoneTsy->iTsyReqHandleStore->GetTsyReqHandle(
|
|
2489 |
CMmPhoneTsy::EMultimodePhoneGetDetectedNetworksPhase1 );
|
|
2490 |
|
|
2491 |
// is there a network detection ongoing?
|
|
2492 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown !=
|
|
2493 |
processGetDetNwPhase1Handle )
|
|
2494 |
{
|
|
2495 |
// forward message to the extension
|
|
2496 |
TInt ret (
|
|
2497 |
iMmPhoneTsy->iMmPhoneExtInterface->GetDetectedNetworksCancelL() );
|
|
2498 |
|
|
2499 |
// Check out for message allocation failure
|
|
2500 |
if ( KErrNone != ret )
|
|
2501 |
{
|
|
2502 |
// Complete the failed request to client
|
|
2503 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
2504 |
}
|
|
2505 |
}
|
|
2506 |
else
|
|
2507 |
{
|
|
2508 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNotFound );
|
|
2509 |
}
|
|
2510 |
return KErrNone;
|
|
2511 |
}
|
|
2512 |
|
|
2513 |
// ---------------------------------------------------------------------------
|
|
2514 |
// CMmNetTsy::CompleteGetDetectedNetworksCancel
|
|
2515 |
// Completes a GetDetectedNetworksCancel request
|
|
2516 |
// (other items were commented in a header).
|
|
2517 |
// ---------------------------------------------------------------------------
|
|
2518 |
//
|
|
2519 |
void CMmNetTsy::CompleteGetDetectedNetworksCancel(
|
|
2520 |
TInt aErrorCode ) const // Error code
|
|
2521 |
{
|
|
2522 |
// get & reset the req handle
|
|
2523 |
TTsyReqHandle reqHandle =
|
|
2524 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2525 |
CMmPhoneTsy::EMultimodePhoneGetDetectedNetworksPhase1);
|
|
2526 |
|
|
2527 |
// Check if request handle exists
|
|
2528 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
2529 |
{
|
|
2530 |
// If cancel succeeded, complete req with KErrCancel
|
|
2531 |
if ( KErrNone == aErrorCode )
|
|
2532 |
{
|
|
2533 |
aErrorCode = KErrCancel;
|
|
2534 |
}
|
|
2535 |
|
|
2536 |
iMmPhoneTsy->ReqCompleted( reqHandle, aErrorCode );
|
|
2537 |
}
|
|
2538 |
}
|
|
2539 |
|
|
2540 |
// ---------------------------------------------------------------------------
|
|
2541 |
// CMmNetTsy::GetNetworkMode
|
|
2542 |
// Returns pointer to iMode internal attribute
|
|
2543 |
// (other items were commented in a header).
|
|
2544 |
// ---------------------------------------------------------------------------
|
|
2545 |
//
|
|
2546 |
RMobilePhone::TMobilePhoneNetworkMode CMmNetTsy::GetNetworkMode() const
|
|
2547 |
{
|
|
2548 |
return iMode;
|
|
2549 |
}
|
|
2550 |
|
|
2551 |
// ---------------------------------------------------------------------------
|
|
2552 |
// CMmNetTsy::GetNetworkRegistrationStatus
|
|
2553 |
// Returns the known network status
|
|
2554 |
// (other items were commented in a header).
|
|
2555 |
// ---------------------------------------------------------------------------
|
|
2556 |
//
|
|
2557 |
RMobilePhone::TMobilePhoneRegistrationStatus
|
|
2558 |
CMmNetTsy::GetNetworkRegistrationStatus() const
|
|
2559 |
{
|
|
2560 |
TFLOGSTRING2("TSY: CMmNetTsy::GetNetworkRegistrationStatus: %d", iNWRegistrationStatus );
|
|
2561 |
return iNWRegistrationStatus;
|
|
2562 |
}
|
|
2563 |
|
|
2564 |
// ---------------------------------------------------------------------------
|
|
2565 |
// CMmNetTsy::GetNetworkSecurityLevel
|
|
2566 |
// Gets the security level of the current network
|
|
2567 |
// (other items were commented in a header).
|
|
2568 |
// ---------------------------------------------------------------------------
|
|
2569 |
//
|
|
2570 |
TInt CMmNetTsy::GetNetworkSecurityLevel(
|
|
2571 |
const TTsyReqHandle aTsyReqHandle, // Request handle
|
|
2572 |
RMobilePhone::TMobilePhoneNetworkSecurity*
|
|
2573 |
aNetworkSecurityLevel ) const //Network security level
|
|
2574 |
|
|
2575 |
{
|
|
2576 |
TFLOGSTRING("TSY: CMmNetTsy::GetNetworkSecurityLevel");
|
|
2577 |
iMmPhoneTsy->PhoneExtInterface()->GetNetworkSecurityLevel (
|
|
2578 |
*aNetworkSecurityLevel );
|
|
2579 |
|
|
2580 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNone );
|
|
2581 |
return KErrNone;
|
|
2582 |
}
|
|
2583 |
|
|
2584 |
// ---------------------------------------------------------------------------
|
|
2585 |
// CMmNetTsy::NotifyNetworkSecurityLevelChange
|
|
2586 |
// Notifies of the network security level change
|
|
2587 |
// (other items were commented in a header).
|
|
2588 |
// ---------------------------------------------------------------------------
|
|
2589 |
//
|
|
2590 |
TInt CMmNetTsy::NotifyNetworkSecurityLevelChange(
|
|
2591 |
RMobilePhone::TMobilePhoneNetworkSecurity*
|
|
2592 |
aNetworkSecurityLevel )
|
|
2593 |
{
|
|
2594 |
TFLOGSTRING("TSY: CMmNetTsy::NotifyNetworkSecurityLevelChange");
|
|
2595 |
iMmPhoneTsy->iReqHandleType =
|
|
2596 |
CMmPhoneTsy::EMultimodePhoneNotifyNetworkSecurityLevelChange;
|
|
2597 |
iRetNetworkSecurityLevel = aNetworkSecurityLevel;
|
|
2598 |
return KErrNone;
|
|
2599 |
}
|
|
2600 |
// ---------------------------------------------------------------------------
|
|
2601 |
// CMmNetTsy::NotifyNetworkSecurityLevelChangeCancel
|
|
2602 |
// Returns pointer to iMode internal attribute
|
|
2603 |
// ---------------------------------------------------------------------------
|
|
2604 |
//
|
|
2605 |
TInt CMmNetTsy::NotifyNetworkSecurityLevelChangeCancel()
|
|
2606 |
{
|
|
2607 |
TFLOGSTRING("TSY: CMmNetTsy::NotifyNetworkSecurityLevelChangeCancel");
|
|
2608 |
iRetNetworkSecurityLevel = NULL;
|
|
2609 |
TTsyReqHandle reqHandle =
|
|
2610 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2611 |
CMmPhoneTsy::EMultimodePhoneNotifyNetworkSecurityLevelChange );
|
|
2612 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle)
|
|
2613 |
{
|
|
2614 |
iMmPhoneTsy->ReqCompleted( reqHandle, KErrCancel );
|
|
2615 |
}
|
|
2616 |
return KErrNone;
|
|
2617 |
}
|
|
2618 |
|
|
2619 |
// ---------------------------------------------------------------------------
|
|
2620 |
// CMmNetTsy::CompleteNotifyNetworkSecurityLevelChange
|
|
2621 |
// Completes an outstanding NotifyNetworkSecurityLevelChange
|
|
2622 |
// (other items were commented in a header).
|
|
2623 |
// ---------------------------------------------------------------------------
|
|
2624 |
//
|
|
2625 |
void CMmNetTsy::CompleteNotifyNetworkSecurityLevelChange(
|
|
2626 |
CMmDataPackage *aDataPackage )
|
|
2627 |
{
|
|
2628 |
RMobilePhone::TMobilePhoneNetworkSecurity* currentSecurityLevel = NULL;
|
|
2629 |
aDataPackage->UnPackData ( ¤tSecurityLevel );
|
|
2630 |
|
|
2631 |
//check the previous value of the security
|
|
2632 |
RMobilePhone::TMobilePhoneNetworkSecurity previousSecurityLevel;
|
|
2633 |
iMmPhoneTsy->PhoneExtInterface()->GetNetworkSecurityLevel (
|
|
2634 |
previousSecurityLevel );
|
|
2635 |
|
|
2636 |
if ( previousSecurityLevel != *currentSecurityLevel )
|
|
2637 |
{
|
|
2638 |
//set the new level in the extension
|
|
2639 |
iMmPhoneTsy->PhoneExtInterface()->SetNetworkSecurityLevel (
|
|
2640 |
*currentSecurityLevel );
|
|
2641 |
//reset req handle. Returns the deleted req handle
|
|
2642 |
TTsyReqHandle reqHandle =
|
|
2643 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2644 |
CMmPhoneTsy::EMultimodePhoneNotifyNetworkSecurityLevelChange );
|
|
2645 |
|
|
2646 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
2647 |
{
|
|
2648 |
|
|
2649 |
// Update the client side data through pointers
|
|
2650 |
*iRetNetworkSecurityLevel = *currentSecurityLevel;
|
|
2651 |
iRetNetworkSecurityLevel = NULL;
|
|
2652 |
|
|
2653 |
iMmPhoneTsy->ReqCompleted( reqHandle, KErrNone );
|
|
2654 |
}
|
|
2655 |
}
|
|
2656 |
}
|
|
2657 |
|
|
2658 |
// ---------------------------------------------------------------------------
|
|
2659 |
// CMmNetTsy::GetCipheringIndicatorStatusL
|
|
2660 |
// Gets the status of the ciphering indicator
|
|
2661 |
// (other items were commented in a header).
|
|
2662 |
// ---------------------------------------------------------------------------
|
|
2663 |
//
|
|
2664 |
TInt CMmNetTsy::GetCipheringIndicatorStatusL(
|
|
2665 |
const TTsyReqHandle aTsyReqHandle,
|
|
2666 |
const TDataPackage& aDataPackage )
|
|
2667 |
{
|
|
2668 |
|
|
2669 |
if ( CipheringIndicatorForcedOff() )
|
|
2670 |
{
|
|
2671 |
//unpack the pointer
|
|
2672 |
iRetCipheringIndicator =
|
|
2673 |
reinterpret_cast<RMobilePhone::TMobileCallCipheringIndicator*>(
|
|
2674 |
aDataPackage.Ptr1() );
|
|
2675 |
|
|
2676 |
*iRetCipheringIndicator = RMobilePhone::ECipheringDisplayOff;
|
|
2677 |
iRetCipheringIndicator = NULL;
|
|
2678 |
|
|
2679 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrNone );
|
|
2680 |
}
|
|
2681 |
|
|
2682 |
else //normal ciphering proceeds
|
|
2683 |
{
|
|
2684 |
//Save pointer to the client side
|
|
2685 |
iRetCipheringIndicator =
|
|
2686 |
reinterpret_cast<RMobilePhone::TMobileCallCipheringIndicator*>(
|
|
2687 |
aDataPackage.Ptr1() );
|
|
2688 |
|
|
2689 |
//Forward the request to the interface
|
|
2690 |
TInt ret = iMmPhoneTsy->iMmPhoneExtInterface->
|
|
2691 |
GetCipheringIndicatorStatusL( &aDataPackage );
|
|
2692 |
|
|
2693 |
if ( KErrNone != ret )
|
|
2694 |
{
|
|
2695 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
2696 |
}
|
|
2697 |
else
|
|
2698 |
{
|
|
2699 |
//save the handle and the request type
|
|
2700 |
iMmPhoneTsy->iReqHandleType =
|
|
2701 |
CMmPhoneTsy::EMultimodePhoneGetCipheringIndicatorStatus;
|
|
2702 |
}
|
|
2703 |
}
|
|
2704 |
|
|
2705 |
return KErrNone;
|
|
2706 |
}
|
|
2707 |
|
|
2708 |
// ---------------------------------------------------------------------------
|
|
2709 |
// CMmNetTsy::GetCipheringIndicatorStatusCancel
|
|
2710 |
// Returns pointer to iMode internal attribute
|
|
2711 |
// (other items were commented in a header).
|
|
2712 |
// ---------------------------------------------------------------------------
|
|
2713 |
//
|
|
2714 |
TInt CMmNetTsy::GetCipheringIndicatorStatusCancel()
|
|
2715 |
{
|
|
2716 |
iRetCipheringIndicator = NULL;
|
|
2717 |
TTsyReqHandle reqHandle =
|
|
2718 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2719 |
CMmPhoneTsy::EMultimodePhoneGetCipheringIndicatorStatus);
|
|
2720 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle)
|
|
2721 |
{
|
|
2722 |
iMmPhoneTsy->ReqCompleted ( reqHandle, KErrCancel );
|
|
2723 |
}
|
|
2724 |
return KErrNone;
|
|
2725 |
}
|
|
2726 |
|
|
2727 |
// ---------------------------------------------------------------------------
|
|
2728 |
// CMmNetTsy::CompleteGetCipheringIndicatorStatus
|
|
2729 |
// Completes an outstanding GetCipheringIndicatorStatus
|
|
2730 |
// (other items were commented in a header).
|
|
2731 |
// ---------------------------------------------------------------------------
|
|
2732 |
//
|
|
2733 |
void CMmNetTsy::CompleteGetCipheringIndicatorStatus(
|
|
2734 |
CMmDataPackage* aDataPackage,
|
|
2735 |
TInt aError )
|
|
2736 |
{
|
|
2737 |
//reset req handle. Returns the deleted req handle
|
|
2738 |
TTsyReqHandle reqHandle =
|
|
2739 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2740 |
CMmPhoneTsy::EMultimodePhoneGetCipheringIndicatorStatus);
|
|
2741 |
|
|
2742 |
//check the availability of the handler
|
|
2743 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
2744 |
{
|
|
2745 |
//unpack the data
|
|
2746 |
RMobilePhone::TMobileCallCipheringIndicator* ciphIndicator = NULL;
|
|
2747 |
aDataPackage->UnPackData ( &ciphIndicator );
|
|
2748 |
|
|
2749 |
*iRetCipheringIndicator = *ciphIndicator;
|
|
2750 |
iRetCipheringIndicator = NULL;
|
|
2751 |
|
|
2752 |
iMmPhoneTsy->ReqCompleted( reqHandle, aError );
|
|
2753 |
}
|
|
2754 |
}
|
|
2755 |
|
|
2756 |
// ---------------------------------------------------------------------------
|
|
2757 |
// CMmNetTsy::ReceivedCallPrivacyInformation
|
|
2758 |
// Get the call privacy information and informs all active calls
|
|
2759 |
// (other items were commented in a header).
|
|
2760 |
// ---------------------------------------------------------------------------
|
|
2761 |
//
|
|
2762 |
void CMmNetTsy::ReceivedCallPrivacyInformation(
|
|
2763 |
CMmDataPackage* aDataPackage )
|
|
2764 |
{
|
|
2765 |
//unpack the data
|
|
2766 |
RMobilePhone::TMobilePhonePrivacy* privacy = NULL;
|
|
2767 |
aDataPackage->UnPackData ( &privacy );
|
|
2768 |
|
|
2769 |
//Send privacy confirmation to all active call objects
|
|
2770 |
for ( TInt i = 0; i<iMmPhoneTsy->CallList()->GetNumberOfObjects(); i++ )
|
|
2771 |
{
|
|
2772 |
CMmCallTsy* mmCall = iMmPhoneTsy->CallList()->GetMmCallByIndex(i);
|
|
2773 |
if ( mmCall->MobileCallStatus() != RMobileCall::EStatusUnknown ||
|
|
2774 |
mmCall->MobileCallStatus() != RMobileCall::EStatusIdle )
|
|
2775 |
{
|
|
2776 |
mmCall->CompleteNotifyPrivacyConfirmation( *privacy );
|
|
2777 |
}
|
|
2778 |
}
|
|
2779 |
}
|
|
2780 |
|
|
2781 |
// ---------------------------------------------------------------------------
|
|
2782 |
// CMmNetTsy::IsNetworkInfoChanged
|
|
2783 |
// Checks if two TMobilePhoneNetworkInfoV8 differs
|
|
2784 |
// (other items were commented in a header).
|
|
2785 |
// ---------------------------------------------------------------------------
|
|
2786 |
//
|
|
2787 |
TBool CMmNetTsy::IsNetworkInfoChanged(
|
|
2788 |
const RMobilePhone::TMobilePhoneNetworkInfoV8& previousNetInfo,
|
|
2789 |
const RMobilePhone::TMobilePhoneNetworkInfoV8& newNetInfo )
|
|
2790 |
{
|
|
2791 |
TFLOGSTRING("TSY: CMmNetTsy::IsNetworkInfoChanged" );
|
|
2792 |
|
|
2793 |
TBool ret ( ETrue );
|
|
2794 |
|
|
2795 |
if ( previousNetInfo.iMode == newNetInfo.iMode &&
|
|
2796 |
previousNetInfo.iStatus == newNetInfo.iStatus &&
|
|
2797 |
previousNetInfo.iCountryCode == newNetInfo.iCountryCode &&
|
|
2798 |
previousNetInfo.iNetworkId == newNetInfo.iNetworkId &&
|
|
2799 |
previousNetInfo.iDisplayTag == newNetInfo.iDisplayTag &&
|
|
2800 |
previousNetInfo.iShortName == newNetInfo.iShortName &&
|
|
2801 |
previousNetInfo.iLongName == newNetInfo.iLongName &&
|
|
2802 |
// version 2 specific
|
|
2803 |
previousNetInfo.iAccess == newNetInfo.iAccess &&
|
|
2804 |
// version 5 specific
|
|
2805 |
previousNetInfo.iHsdpaAvailableIndicator ==
|
|
2806 |
newNetInfo.iHsdpaAvailableIndicator &&
|
|
2807 |
previousNetInfo.iEgprsAvailableIndicator ==
|
|
2808 |
newNetInfo.iEgprsAvailableIndicator &&
|
|
2809 |
// version 8 specific
|
|
2810 |
previousNetInfo.iHsupaAvailableIndicator ==
|
|
2811 |
newNetInfo.iHsupaAvailableIndicator
|
|
2812 |
)
|
|
2813 |
{
|
|
2814 |
ret = EFalse;
|
|
2815 |
}
|
|
2816 |
|
|
2817 |
return ret;
|
|
2818 |
}
|
|
2819 |
|
|
2820 |
// ---------------------------------------------------------------------------
|
|
2821 |
// CMmNetTsy::IsAreaInfoChanged
|
|
2822 |
// Checks if two TMobilePhoneLocationAreaV1 differs
|
|
2823 |
// (other items were commented in a header).
|
|
2824 |
// ---------------------------------------------------------------------------
|
|
2825 |
//
|
|
2826 |
TBool CMmNetTsy::IsAreaInfoChanged(
|
|
2827 |
const RMobilePhone::TMobilePhoneLocationAreaV1& previousAreaInfo,
|
|
2828 |
const RMobilePhone::TMobilePhoneLocationAreaV1& newAreaInfo )
|
|
2829 |
{
|
|
2830 |
TBool ret ( ETrue );
|
|
2831 |
|
|
2832 |
if ( previousAreaInfo.iAreaKnown == newAreaInfo.iAreaKnown &&
|
|
2833 |
previousAreaInfo.iLocationAreaCode == newAreaInfo.iLocationAreaCode
|
|
2834 |
&& previousAreaInfo.iCellId == newAreaInfo.iCellId )
|
|
2835 |
{
|
|
2836 |
ret = EFalse;
|
|
2837 |
}
|
|
2838 |
return ret;
|
|
2839 |
}
|
|
2840 |
|
|
2841 |
// ---------------------------------------------------------------------------
|
|
2842 |
// CMmNetTsy::ReadVariantOptions
|
|
2843 |
// Reads from ini file the values of the variant flags.
|
|
2844 |
// (other items were commented in a header).
|
|
2845 |
// ---------------------------------------------------------------------------
|
|
2846 |
//
|
|
2847 |
void CMmNetTsy::ReadVariantOptions()
|
|
2848 |
{
|
|
2849 |
RFs fs;
|
|
2850 |
RFile file;
|
|
2851 |
TBuf8<1> flagStatus;
|
|
2852 |
// file path. c32.exe SID is 101F7989.
|
|
2853 |
_LIT(KVariantsConfFileName,
|
|
2854 |
"Z:\\private\\101f7989\\operatorVariants.ini");
|
|
2855 |
|
|
2856 |
//connect to the File server
|
|
2857 |
if ( KErrNone == fs.Connect() )
|
|
2858 |
{
|
|
2859 |
TInt err = file.Open( fs, KVariantsConfFileName, EFileStream |
|
|
2860 |
EFileRead );
|
|
2861 |
if ( KErrNone == err )
|
|
2862 |
{
|
|
2863 |
TInt readStatus( KErrNone );
|
|
2864 |
|
|
2865 |
//currently we need only to read the first line
|
|
2866 |
readStatus = file.Read( flagStatus );
|
|
2867 |
|
|
2868 |
if ( readStatus == KErrNone &&
|
|
2869 |
flagStatus.Length() != 0 )
|
|
2870 |
{
|
|
2871 |
//check if value is one
|
|
2872 |
if ( (flagStatus[ 0 ] - '0') == 1 )
|
|
2873 |
{
|
|
2874 |
//set the flag on
|
|
2875 |
iCipheringIndicatorForcedOff = ETrue;
|
|
2876 |
}
|
|
2877 |
}
|
|
2878 |
//close the file
|
|
2879 |
file.Close();
|
|
2880 |
TFLOGSTRING("TSY:CMmNetTsy::ReadVariantOptions:File successfully read.");
|
|
2881 |
}
|
|
2882 |
else
|
|
2883 |
{
|
|
2884 |
TFLOGSTRING2("TSY:CMmNetTsy::ReadVariantOptions:Could not open file Z:\\private\\101f7989\\operatorVariants.ini, error=%d",err);
|
|
2885 |
}
|
|
2886 |
|
|
2887 |
// close connection to file server
|
|
2888 |
fs.Close();
|
|
2889 |
}
|
|
2890 |
else
|
|
2891 |
{
|
|
2892 |
TFLOGSTRING("TSY:CMmNetTsy::ReadVariantOptions:Could not connect to file server.");
|
|
2893 |
}
|
|
2894 |
TFLOGSTRING2("TSY:CMmNetTsy::ReadVariantOptions:iCipheringIndicatorForcedOff=%d",iCipheringIndicatorForcedOff);
|
|
2895 |
}
|
|
2896 |
|
|
2897 |
// ---------------------------------------------------------------------------
|
|
2898 |
// CMmNetTsy::CipheringIndicatorForcedOff
|
|
2899 |
// Returns ETrue if the ciphering indication is forced off.
|
|
2900 |
// (other items were commented in a header).
|
|
2901 |
// ---------------------------------------------------------------------------
|
|
2902 |
//
|
|
2903 |
TBool CMmNetTsy::CipheringIndicatorForcedOff()
|
|
2904 |
{
|
|
2905 |
TFLOGSTRING2("TSY:CMmNetTsy::CipheringIndicatorForcedOff:iCipheringIndicatorForcedOff=%d",iCipheringIndicatorForcedOff);
|
|
2906 |
return iCipheringIndicatorForcedOff;
|
|
2907 |
}
|
|
2908 |
|
|
2909 |
// ---------------------------------------------------------------------------
|
|
2910 |
// CMmNetTsy::AuthorizationInfoPhase1
|
|
2911 |
// Processes AuthorizationInfoPhase1 request
|
|
2912 |
// (other items were commented in a header).
|
|
2913 |
// ---------------------------------------------------------------------------
|
|
2914 |
//
|
|
2915 |
TInt CMmNetTsy::GetAuthorizationInfoPhase1L(
|
|
2916 |
const TTsyReqHandle aTsyReqHandle,
|
|
2917 |
RMobilePhone::TClientId* aClient,
|
|
2918 |
TInt* aBufSize )
|
|
2919 |
{
|
|
2920 |
TFLOGSTRING("TSY: CMmNetTsy::AuthorizationInfoPhase1L");
|
|
2921 |
|
|
2922 |
TTsyReqHandle getAuthorizationInfoPhase1Handle =
|
|
2923 |
iMmPhoneTsy->iTsyReqHandleStore->GetTsyReqHandle(
|
|
2924 |
CMmPhoneTsy::EMultimodePhoneGetAuthorizationInfoPhase1 );
|
|
2925 |
|
|
2926 |
// Check if operation is already ongoing
|
|
2927 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown !=
|
|
2928 |
getAuthorizationInfoPhase1Handle )
|
|
2929 |
{
|
|
2930 |
// Complete request with KErrServerBusy
|
|
2931 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
2932 |
}
|
|
2933 |
else
|
|
2934 |
{
|
|
2935 |
// Get the authorization data
|
|
2936 |
TInt ret = iMmPhoneTsy->MessageManager()->HandleRequestL(
|
|
2937 |
EMobilePhoneAuthorizationInfoPhase1 );
|
|
2938 |
|
|
2939 |
// Check if request for authorization data was sent successfully
|
|
2940 |
if ( KErrNone != ret )
|
|
2941 |
{
|
|
2942 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
2943 |
}
|
|
2944 |
else
|
|
2945 |
{
|
|
2946 |
// Save the address of the client attribute
|
|
2947 |
iAuthorizationInfoBufferSize = aBufSize;
|
|
2948 |
// Presently internal attribute, used only by this method.
|
|
2949 |
iAuthorizationInfoClientId = *aClient;
|
|
2950 |
|
|
2951 |
//save the handle and the request type
|
|
2952 |
iMmPhoneTsy->iReqHandleType =
|
|
2953 |
CMmPhoneTsy::EMultimodePhoneGetAuthorizationInfoPhase1;
|
|
2954 |
}
|
|
2955 |
}
|
|
2956 |
|
|
2957 |
return KErrNone;
|
|
2958 |
}
|
|
2959 |
|
|
2960 |
// ---------------------------------------------------------------------------
|
|
2961 |
// CMmNetTsy::ProcessAuthorizationInfoPhase1
|
|
2962 |
// Completes AuthorizationInfoPhase1 request
|
|
2963 |
// (other items were commented in a header).
|
|
2964 |
// ---------------------------------------------------------------------------
|
|
2965 |
//
|
|
2966 |
void CMmNetTsy::ProcessGetAuthorizationInfoPhase1L(
|
|
2967 |
CMmDataPackage* aDataPackage,
|
|
2968 |
TInt aError )
|
|
2969 |
{
|
|
2970 |
TFLOGSTRING("TSY: CMmNetTsy::ProcessGetAuthorizationInfoPhase1L");
|
|
2971 |
|
|
2972 |
// Fetch the request handle
|
|
2973 |
TTsyReqHandle reqHandle =
|
|
2974 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
2975 |
CMmPhoneTsy::EMultimodePhoneGetAuthorizationInfoPhase1 );
|
|
2976 |
|
|
2977 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
2978 |
{
|
|
2979 |
// Check if authorization data response was received successfully
|
|
2980 |
if ( KErrNone != aError )
|
|
2981 |
{
|
|
2982 |
// Error occured, complete authorization info request with error
|
|
2983 |
iMmPhoneTsy->ReqCompleted( reqHandle, aError );
|
|
2984 |
}
|
|
2985 |
else
|
|
2986 |
{
|
|
2987 |
RMobilePhone::CImsAuthorizationInfoV5* imsAuthorizationInfo =
|
|
2988 |
NULL;
|
|
2989 |
aDataPackage->UnPackData( imsAuthorizationInfo );
|
|
2990 |
|
|
2991 |
// Serialize data (RMobilePhone::CImsAuthorizationInfoV5)
|
|
2992 |
// into iAuthInfoBuffer
|
|
2993 |
imsAuthorizationInfo->ExternalizeL( iAuthInfoBuffer );
|
|
2994 |
|
|
2995 |
*iAuthorizationInfoBufferSize = iAuthInfoBuffer->Length();
|
|
2996 |
|
|
2997 |
// Complete request
|
|
2998 |
iMmPhoneTsy->ReqCompleted( reqHandle, KErrNone );
|
|
2999 |
}
|
|
3000 |
}
|
|
3001 |
}
|
|
3002 |
|
|
3003 |
// ---------------------------------------------------------------------------
|
|
3004 |
// CMmNetTsy::GetAuthorizationInfoPhase2
|
|
3005 |
// Completes AuthorizationInfoPhase2 request
|
|
3006 |
// ---------------------------------------------------------------------------
|
|
3007 |
//
|
|
3008 |
TInt CMmNetTsy::GetAuthorizationInfoPhase2L(
|
|
3009 |
TTsyReqHandle aTsyReqHandle,
|
|
3010 |
RMobilePhone::TClientId* aClient,
|
|
3011 |
TDes8* aBuffer )
|
|
3012 |
{
|
|
3013 |
TFLOGSTRING("TSY: CMmNetTsy::GetAuthorizationInfoPhase2L");
|
|
3014 |
|
|
3015 |
TInt error = KErrNone;
|
|
3016 |
|
|
3017 |
// Check client id
|
|
3018 |
if ( (aClient->iSessionHandle != iAuthorizationInfoClientId.iSessionHandle )
|
|
3019 |
|| ( aClient->iSubSessionHandle !=
|
|
3020 |
iAuthorizationInfoClientId.iSubSessionHandle ) )
|
|
3021 |
{
|
|
3022 |
error = KErrBadHandle;
|
|
3023 |
}
|
|
3024 |
else
|
|
3025 |
{
|
|
3026 |
if ( iAuthInfoBuffer )
|
|
3027 |
{
|
|
3028 |
// Copy data to client buffer
|
|
3029 |
TPtr8 bufPtr = iAuthInfoBuffer->Des();
|
|
3030 |
if ( bufPtr.Length() <= aBuffer->Length() )
|
|
3031 |
{
|
|
3032 |
aBuffer->Copy( bufPtr );
|
|
3033 |
}
|
|
3034 |
else
|
|
3035 |
{
|
|
3036 |
error = KErrArgument;
|
|
3037 |
}
|
|
3038 |
|
|
3039 |
// delete the buffer
|
|
3040 |
|
|
3041 |
delete iAuthInfoBuffer;
|
|
3042 |
iAuthInfoBuffer = NULL;
|
|
3043 |
}
|
|
3044 |
else
|
|
3045 |
{
|
|
3046 |
error = KErrArgument;
|
|
3047 |
}
|
|
3048 |
}
|
|
3049 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, error );
|
|
3050 |
return KErrNone;
|
|
3051 |
}
|
|
3052 |
|
|
3053 |
// ---------------------------------------------------------------------------
|
|
3054 |
// CMmNetTsy::GetAuthorizationInfoPhase1Cancel
|
|
3055 |
// Cancels AuthorizationInfoPhase1 request
|
|
3056 |
// ---------------------------------------------------------------------------
|
|
3057 |
//
|
|
3058 |
TInt CMmNetTsy::GetAuthorizationInfoPhase1Cancel()
|
|
3059 |
{
|
|
3060 |
// reset all request related pointers to client space
|
|
3061 |
iAuthorizationInfoBufferSize = NULL;
|
|
3062 |
|
|
3063 |
|
|
3064 |
// delete the buffer
|
|
3065 |
if ( iAuthInfoBuffer )
|
|
3066 |
{
|
|
3067 |
delete iAuthInfoBuffer;
|
|
3068 |
iAuthInfoBuffer = NULL;
|
|
3069 |
}
|
|
3070 |
|
|
3071 |
// reset the req handle
|
|
3072 |
TTsyReqHandle reqHandle =
|
|
3073 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
3074 |
CMmPhoneTsy::EMultimodePhoneGetAuthorizationInfoPhase1 );
|
|
3075 |
|
|
3076 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle)
|
|
3077 |
{
|
|
3078 |
iMmPhoneTsy->ReqCompleted( reqHandle, KErrCancel );
|
|
3079 |
}
|
|
3080 |
|
|
3081 |
return KErrNone;
|
|
3082 |
}
|
|
3083 |
|
|
3084 |
// ---------------------------------------------------------------------------
|
|
3085 |
// CMmNetTsy::GetCurrentActiveUSimApplicationL
|
|
3086 |
// Gets current active USim application
|
|
3087 |
// (other items were commented in a header).
|
|
3088 |
// ---------------------------------------------------------------------------
|
|
3089 |
//
|
|
3090 |
TInt CMmNetTsy::GetCurrentActiveUSimApplicationL(
|
|
3091 |
const TTsyReqHandle aTsyReqHandle,
|
|
3092 |
RMobilePhone::TAID* aAID )
|
|
3093 |
{
|
|
3094 |
TFLOGSTRING("TSY:CMmNetTsy::GetCurrentActiveUSimApplicationL");
|
|
3095 |
TTsyReqHandle getCurrentActiveUSimApplicationHandle =
|
|
3096 |
iMmPhoneTsy->iTsyReqHandleStore->GetTsyReqHandle(
|
|
3097 |
CMmPhoneTsy::EMultimodePhoneGetCurrentActiveUSimApplication );
|
|
3098 |
|
|
3099 |
// Check if operation is already ongoing
|
|
3100 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown !=
|
|
3101 |
getCurrentActiveUSimApplicationHandle )
|
|
3102 |
{
|
|
3103 |
// Complete request with KErrServerBusy
|
|
3104 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, KErrServerBusy );
|
|
3105 |
}
|
|
3106 |
else
|
|
3107 |
{
|
|
3108 |
// Current active USim application Id has to be asynchronously requested from LTSY layer
|
|
3109 |
TInt ret = iMmPhoneTsy->MessageManager()->HandleRequestL( EMobilePhoneGetCurrentActiveUSimApplication );
|
|
3110 |
|
|
3111 |
if ( KErrNone == ret )
|
|
3112 |
{
|
|
3113 |
// call to LTSY layer successful, save request handle and return pointer
|
|
3114 |
// for completion
|
|
3115 |
iRetCurrentActiveUSimApplication = aAID;
|
|
3116 |
iMmPhoneTsy->iReqHandleType =
|
|
3117 |
CMmPhoneTsy::EMultimodePhoneGetCurrentActiveUSimApplication;
|
|
3118 |
}
|
|
3119 |
else
|
|
3120 |
{
|
|
3121 |
// call to LTSY layer failed, immediately complete with error
|
|
3122 |
iMmPhoneTsy->ReqCompleted( aTsyReqHandle, ret );
|
|
3123 |
}
|
|
3124 |
}
|
|
3125 |
|
|
3126 |
return KErrNone;
|
|
3127 |
}
|
|
3128 |
|
|
3129 |
// ---------------------------------------------------------------------------
|
|
3130 |
// CMmNetTsy::GetCurrentActiveUSimApplicationCancel
|
|
3131 |
// Cancels an outstanding GetCurrentActiveUSimApplication request
|
|
3132 |
// (other items were commented in a header).
|
|
3133 |
// ---------------------------------------------------------------------------
|
|
3134 |
//
|
|
3135 |
TInt CMmNetTsy::GetCurrentActiveUSimApplicationCancel()
|
|
3136 |
{
|
|
3137 |
TFLOGSTRING("TSY: CMmNetTsy::GetCurrentActiveUSimApplicationCancel");
|
|
3138 |
//reset the req handle
|
|
3139 |
TTsyReqHandle reqHandle =
|
|
3140 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
3141 |
CMmPhoneTsy::EMultimodePhoneGetCurrentActiveUSimApplication );
|
|
3142 |
|
|
3143 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
3144 |
{
|
|
3145 |
// reset the pointer to client data
|
|
3146 |
iRetCurrentActiveUSimApplication = NULL;
|
|
3147 |
iMmPhoneTsy->ReqCompleted( reqHandle, KErrCancel );
|
|
3148 |
}
|
|
3149 |
return KErrNone;
|
|
3150 |
}
|
|
3151 |
|
|
3152 |
// ---------------------------------------------------------------------------
|
|
3153 |
// CMmNetTsy::CompleteGetCurrentActiveUSimApplication
|
|
3154 |
// Completes a GetCurrentActiveUSimApplication request to client side
|
|
3155 |
// (other items were commented in a header).
|
|
3156 |
// ---------------------------------------------------------------------------
|
|
3157 |
//
|
|
3158 |
void CMmNetTsy::CompleteGetCurrentActiveUSimApplication(
|
|
3159 |
CMmDataPackage* aDataPackage,
|
|
3160 |
TInt aErrorValue )
|
|
3161 |
{
|
|
3162 |
TFLOGSTRING("TSY: CMmNetTsy::CompleteGetCurrentActiveUSimApplication");
|
|
3163 |
//reset req handle. Returns the deleted req handle
|
|
3164 |
TTsyReqHandle reqHandle =
|
|
3165 |
iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(
|
|
3166 |
CMmPhoneTsy::EMultimodePhoneGetCurrentActiveUSimApplication );
|
|
3167 |
|
|
3168 |
//check the validity of the handler
|
|
3169 |
if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle )
|
|
3170 |
{
|
|
3171 |
//unpack the data
|
|
3172 |
RMobilePhone::TAID* aid = NULL;
|
|
3173 |
aDataPackage->UnPackData ( &aid );
|
|
3174 |
|
|
3175 |
*iRetCurrentActiveUSimApplication = *aid;
|
|
3176 |
iRetCurrentActiveUSimApplication = NULL;
|
|
3177 |
|
|
3178 |
//Complete the client request
|
|
3179 |
iMmPhoneTsy->ReqCompleted( reqHandle, aErrorValue );
|
|
3180 |
}
|
|
3181 |
}
|
|
3182 |
|
|
3183 |
// End of File
|
|
3184 |
|
|
3185 |
|
|
3186 |
|