198 // COMASuplETel::HandleLocationIdL(), |
198 // COMASuplETel::HandleLocationIdL(), |
199 // (other items were commented in a header). |
199 // (other items were commented in a header). |
200 // ----------------------------------------------------------------------------- |
200 // ----------------------------------------------------------------------------- |
201 // |
201 // |
202 void COMASuplETel::HandleLocationIdL() |
202 void COMASuplETel::HandleLocationIdL() |
203 { |
203 { |
204 switch (iNetworkInfo.iMode) |
204 switch (iNetworkInfo.iMode) |
205 { |
|
206 case RMobilePhone::ENetworkModeGsm: |
|
207 { |
205 { |
208 //coverity[alloc_fn] |
206 case RMobilePhone::ENetworkModeGsm: |
209 //coverity[assign] |
207 { |
210 // For GSM Cell Information |
208 // For GSM Cell Information |
211 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
209 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
212 //coverity[push] |
210 CleanupStack::PushL(locationId); |
213 CleanupStack::PushL(locationId); |
211 COMASuplGSMCellInfo* gsmCellInfo = COMASuplGSMCellInfo::NewL(); |
214 |
212 CleanupStack::PushL(gsmCellInfo); |
215 COMASuplGSMCellInfo* gsmCellInfo = COMASuplGSMCellInfo::NewL(); |
213 COMASuplLocationId::TOMASuplStatus lStatus = COMASuplLocationId::ECurrent; |
216 CleanupStack::PushL(gsmCellInfo); |
214 |
217 COMASuplLocationId::TOMASuplStatus lStatus = |
215 TInt MCC=0; |
218 COMASuplLocationId::ECurrent; |
216 TInt64 MNC=0; |
219 |
217 TUint LAC, CellId; |
220 TInt MCC = 0; |
218 TLex LexMCC(iNetworkInfo.iCountryCode); |
221 TInt64 MNC = 0; |
219 TLex LexMNC(iNetworkInfo.iNetworkId); |
222 TUint LAC, CellId; |
220 |
223 TLex LexMCC(iNetworkInfo.iCountryCode); |
221 LexMCC.Val(MCC); |
224 TLex LexMNC(iNetworkInfo.iNetworkId); |
222 LexMNC.Val(MNC); |
225 |
223 LAC = iLocationInfo.iLocationAreaCode; |
226 LexMCC.Val(MCC); |
224 CellId = iLocationInfo.iCellId; |
227 LexMNC.Val(MNC); |
225 |
228 LAC = iLocationInfo.iLocationAreaCode; |
226 |
229 CellId = iLocationInfo.iCellId; |
227 gsmCellInfo->SetSuplGSMCellInfo(MNC, MCC,CellId,LAC); |
230 |
228 locationId->SetSuplLocationId(gsmCellInfo,lStatus); |
231 gsmCellInfo->SetSuplGSMCellInfo(MNC, MCC, CellId, LAC); |
229 CleanupStack::Pop(gsmCellInfo); |
232 locationId->SetSuplLocationId(gsmCellInfo, lStatus); |
230 CleanupStack::Pop(locationId); |
233 CleanupStack::Pop(gsmCellInfo); |
231 |
234 //coverity[pop] |
232 #if defined(_DEBUG) //This is only for logging purpose. |
235 CleanupStack::Pop(locationId); |
233 TBuf<128> msg; |
236 |
234 |
237 #if defined(_DEBUG) //This is only for logging purpose. |
235 msg.Copy(_L("It is GSM Network. MCC = ")); |
238 TBuf<128> msg; |
236 msg.AppendNum(MCC); |
239 |
237 |
240 msg.Copy(_L("It is GSM Network. MCC = ")); |
238 msg.Append(_L(" MNC = ")); |
241 msg.AppendNum(MCC); |
239 msg.AppendNum(MNC); |
242 |
240 |
243 msg.Append(_L(" MNC = ")); |
241 |
244 msg.AppendNum(MNC); |
242 msg.Append(_L(" CellId = ")); |
245 |
243 msg.AppendNum(CellId); |
246 msg.Append(_L(" CellId = ")); |
244 |
247 msg.AppendNum(CellId); |
245 |
248 |
246 msg.Append(_L(" LAC = ")); |
249 msg.Append(_L(" LAC = ")); |
247 msg.AppendNum(LAC); |
250 msg.AppendNum(LAC); |
248 |
251 |
249 iTrace->Trace(msg,KTraceFileName, __LINE__); |
252 iTrace->Trace(msg, KTraceFileName, __LINE__); |
250 #endif |
253 #endif |
251 |
254 |
252 if(iCellMode == EOMASuplCellId) |
255 if (iCellMode == EOMASuplCellId) |
253 iObserver.LocationIDRequestCompletedL(locationId,KErrNone); |
256 iObserver.LocationIDRequestCompletedL(locationId, KErrNone); |
254 else if(iCellMode == EOMASuplCompareCellId) |
257 else if (iCellMode == EOMASuplCompareCellId) |
255 iObserver.ComparisionLocationIDRequestCompletedL(locationId,KErrNone); |
258 iObserver.ComparisionLocationIDRequestCompletedL(locationId, |
256 break; |
259 KErrNone); |
257 } |
260 //coverity[memory_leak] |
258 case RMobilePhone::ENetworkModeWcdma: |
261 break; |
259 { |
|
260 // For WCDMA Cell Information |
|
261 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
|
262 CleanupStack::PushL(locationId); |
|
263 COMASuplCellInfo* wcdmaCellInfo = COMASuplCellInfo::NewL(); |
|
264 CleanupStack::PushL(wcdmaCellInfo); |
|
265 |
|
266 COMASuplLocationId::TOMASuplStatus lStatus = COMASuplLocationId::ECurrent; |
|
267 TInt MCC=0; |
|
268 TInt64 MNC=0; |
|
269 TUint UC; |
|
270 TLex LexMCC(iNetworkInfo.iCountryCode); |
|
271 TLex LexMNC(iNetworkInfo.iNetworkId); |
|
272 |
|
273 LexMCC.Val(MCC); |
|
274 LexMNC.Val(MNC); |
|
275 UC = iLocationInfo.iCellId; |
|
276 |
|
277 |
|
278 wcdmaCellInfo->SetSuplCellInfo(MNC, MCC, UC); |
|
279 locationId->SetSuplLocationId(wcdmaCellInfo,lStatus); |
|
280 CleanupStack::Pop(wcdmaCellInfo); |
|
281 CleanupStack::Pop(locationId); |
|
282 |
|
283 #if defined(_DEBUG) //This is only for logging purpose. |
|
284 TBuf<128> msg; |
|
285 |
|
286 msg.Copy(_L("It is CDMA Network. MCC = ")); |
|
287 msg.AppendNum(MCC); |
|
288 |
|
289 msg.Append(_L(" MNC = ")); |
|
290 msg.AppendNum(MNC); |
|
291 |
|
292 |
|
293 msg.Append(_L(" UC = ")); |
|
294 msg.AppendNum(UC); |
|
295 |
|
296 iTrace->Trace(msg,KTraceFileName, __LINE__); |
|
297 #endif |
|
298 |
|
299 if(iCellMode == EOMASuplCellId) |
|
300 iObserver.LocationIDRequestCompletedL(locationId,KErrNone); |
|
301 else if(iCellMode == EOMASuplCompareCellId) |
|
302 iObserver.ComparisionLocationIDRequestCompletedL(locationId,KErrNone); |
|
303 break; |
|
304 } |
|
305 default: |
|
306 { |
|
307 #if _DEBUG |
|
308 // For GSM Cell Information |
|
309 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
|
310 CleanupStack::PushL(locationId); |
|
311 COMASuplGSMCellInfo* gsmCellInfo = COMASuplGSMCellInfo::NewL(); |
|
312 CleanupStack::PushL(gsmCellInfo); |
|
313 |
|
314 COMASuplLocationId::TOMASuplStatus lStatus = COMASuplLocationId::ECurrent; |
|
315 TInt MCC=0; |
|
316 TInt64 MNC=0; |
|
317 TUint LAC, CellId; |
|
318 TLex LexMCC(iNetworkInfo.iCountryCode); |
|
319 TLex LexMNC(iNetworkInfo.iNetworkId); |
|
320 |
|
321 LexMCC.Val(MCC); |
|
322 LexMNC.Val(MNC); |
|
323 LAC = iLocationInfo.iLocationAreaCode; |
|
324 CellId = iLocationInfo.iCellId; |
|
325 |
|
326 |
|
327 gsmCellInfo->SetSuplGSMCellInfo(MNC, MCC,CellId,LAC); |
|
328 locationId->SetSuplLocationId(gsmCellInfo,lStatus); |
|
329 CleanupStack::Pop(gsmCellInfo); |
|
330 CleanupStack::Pop(locationId); |
|
331 |
|
332 #if defined(_DEBUG) //This is only for logging purpose. |
|
333 TBuf<128> msg; |
|
334 msg.Copy(_L("It is GSM Network. MCC = ")); |
|
335 msg.AppendNum(MCC); |
|
336 |
|
337 msg.Append(_L(" MNC = ")); |
|
338 msg.AppendNum(MNC); |
|
339 |
|
340 msg.Append(_L(" CellId = ")); |
|
341 msg.AppendNum(CellId); |
|
342 |
|
343 msg.Append(_L(" LAC = ")); |
|
344 msg.AppendNum(LAC); |
|
345 |
|
346 iTrace->Trace(msg,KTraceFileName, __LINE__); |
|
347 |
|
348 #endif |
|
349 if(iCellMode == EOMASuplCellId) |
|
350 iObserver.LocationIDRequestCompletedL(locationId,KErrNone); |
|
351 else if(iCellMode == EOMASuplCompareCellId) |
|
352 iObserver.ComparisionLocationIDRequestCompletedL(locationId,KErrNone); |
|
353 #else |
|
354 iTrace->Trace(_L("Error in getting Location Id"),KTraceFileName, __LINE__); |
|
355 if(iCellMode == EOMASuplCellId) |
|
356 iObserver.LocationIDRequestCompletedL(NULL,KErrNotSupported); |
|
357 else if(iCellMode == EOMASuplCompareCellId) |
|
358 iObserver.ComparisionLocationIDRequestCompletedL(NULL,KErrNotSupported); |
|
359 #endif |
|
360 break; |
|
361 } |
262 } |
362 } |
263 case RMobilePhone::ENetworkModeWcdma: |
363 |
264 { |
364 } |
265 //coverity[alloc_fn] |
|
266 //coverity[assign] |
|
267 // For WCDMA Cell Information |
|
268 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
|
269 //coverity[push] |
|
270 CleanupStack::PushL(locationId); |
|
271 |
|
272 COMASuplCellInfo* wcdmaCellInfo = COMASuplCellInfo::NewL(); |
|
273 CleanupStack::PushL(wcdmaCellInfo); |
|
274 |
|
275 COMASuplLocationId::TOMASuplStatus lStatus = |
|
276 COMASuplLocationId::ECurrent; |
|
277 TInt MCC = 0; |
|
278 TInt64 MNC = 0; |
|
279 TUint UC; |
|
280 TLex LexMCC(iNetworkInfo.iCountryCode); |
|
281 TLex LexMNC(iNetworkInfo.iNetworkId); |
|
282 |
|
283 LexMCC.Val(MCC); |
|
284 LexMNC.Val(MNC); |
|
285 UC = iLocationInfo.iCellId; |
|
286 |
|
287 wcdmaCellInfo->SetSuplCellInfo(MNC, MCC, UC); |
|
288 locationId->SetSuplLocationId(wcdmaCellInfo, lStatus); |
|
289 CleanupStack::Pop(wcdmaCellInfo); |
|
290 //coverity[pop] |
|
291 CleanupStack::Pop(locationId); |
|
292 |
|
293 #if defined(_DEBUG) //This is only for logging purpose. |
|
294 TBuf<128> msg; |
|
295 |
|
296 msg.Copy(_L("It is CDMA Network. MCC = ")); |
|
297 msg.AppendNum(MCC); |
|
298 |
|
299 msg.Append(_L(" MNC = ")); |
|
300 msg.AppendNum(MNC); |
|
301 |
|
302 msg.Append(_L(" UC = ")); |
|
303 msg.AppendNum(UC); |
|
304 |
|
305 iTrace->Trace(msg, KTraceFileName, __LINE__); |
|
306 #endif |
|
307 |
|
308 if (iCellMode == EOMASuplCellId) |
|
309 iObserver.LocationIDRequestCompletedL(locationId, KErrNone); |
|
310 else if (iCellMode == EOMASuplCompareCellId) |
|
311 iObserver.ComparisionLocationIDRequestCompletedL(locationId, |
|
312 KErrNone); |
|
313 //coverity[memory_leak] |
|
314 break; |
|
315 } |
|
316 default: |
|
317 { |
|
318 #if _DEBUG |
|
319 //coverity[alloc_fn] |
|
320 //coverity[assign] |
|
321 // For GSM Cell Information |
|
322 COMASuplLocationId* locationId = COMASuplLocationId::NewL(); |
|
323 //coverity[push] |
|
324 CleanupStack::PushL(locationId); |
|
325 COMASuplGSMCellInfo* gsmCellInfo = COMASuplGSMCellInfo::NewL(); |
|
326 CleanupStack::PushL(gsmCellInfo); |
|
327 |
|
328 COMASuplLocationId::TOMASuplStatus lStatus = COMASuplLocationId::ECurrent; |
|
329 TInt MCC=0; |
|
330 TInt64 MNC=0; |
|
331 TUint LAC, CellId; |
|
332 TLex LexMCC(iNetworkInfo.iCountryCode); |
|
333 TLex LexMNC(iNetworkInfo.iNetworkId); |
|
334 |
|
335 LexMCC.Val(MCC); |
|
336 LexMNC.Val(MNC); |
|
337 LAC = iLocationInfo.iLocationAreaCode; |
|
338 CellId = iLocationInfo.iCellId; |
|
339 |
|
340 gsmCellInfo->SetSuplGSMCellInfo(MNC, MCC,CellId,LAC); |
|
341 locationId->SetSuplLocationId(gsmCellInfo,lStatus); |
|
342 CleanupStack::Pop(gsmCellInfo); |
|
343 //coverity[pop] |
|
344 CleanupStack::Pop(locationId); |
|
345 |
|
346 #if defined(_DEBUG) //This is only for logging purpose. |
|
347 TBuf<128> msg; |
|
348 msg.Copy(_L("It is GSM Network. MCC = ")); |
|
349 msg.AppendNum(MCC); |
|
350 |
|
351 msg.Append(_L(" MNC = ")); |
|
352 msg.AppendNum(MNC); |
|
353 |
|
354 msg.Append(_L(" CellId = ")); |
|
355 msg.AppendNum(CellId); |
|
356 |
|
357 msg.Append(_L(" LAC = ")); |
|
358 msg.AppendNum(LAC); |
|
359 |
|
360 iTrace->Trace(msg,KTraceFileName, __LINE__); |
|
361 |
|
362 #endif |
|
363 if(iCellMode == EOMASuplCellId) |
|
364 iObserver.LocationIDRequestCompletedL(locationId,KErrNone); |
|
365 else if(iCellMode == EOMASuplCompareCellId) |
|
366 iObserver.ComparisionLocationIDRequestCompletedL(locationId,KErrNone); |
|
367 #else |
|
368 iTrace->Trace(_L("Error in getting Location Id"), KTraceFileName, |
|
369 __LINE__); |
|
370 if (iCellMode == EOMASuplCellId) |
|
371 iObserver.LocationIDRequestCompletedL(NULL, KErrNotSupported); |
|
372 else if (iCellMode == EOMASuplCompareCellId) |
|
373 iObserver.ComparisionLocationIDRequestCompletedL(NULL, |
|
374 KErrNotSupported); |
|
375 #endif |
|
376 //coverity[memory_leak] |
|
377 break; |
|
378 } |
|
379 } |
|
380 |
|
381 } |
|
382 |
365 |
383 // ----------------------------------------------------------------------------- |
366 // ----------------------------------------------------------------------------- |
384 // COMASuplETel::HandleECellIdL(), |
367 // COMASuplETel::HandleECellIdL(), |
385 // (other items were commented in a header). |
368 // (other items were commented in a header). |
386 // ----------------------------------------------------------------------------- |
369 // ----------------------------------------------------------------------------- |