equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "CMobileInfo.h" |
|
19 |
|
20 CMobileInfo::CMobileInfo(TDes& aMCC) |
|
21 : CActive(CActive::EPriorityStandard), |
|
22 iMCC(aMCC), |
|
23 iMCCMNCV1Pkg(iMCCMNCV1) |
|
24 { |
|
25 CActiveScheduler::Add(this); |
|
26 } |
|
27 |
|
28 CMobileInfo::~CMobileInfo() |
|
29 { |
|
30 Cancel(); |
|
31 delete iTelephony; |
|
32 delete iWait; |
|
33 } |
|
34 |
|
35 void CMobileInfo::GetInfoL(TDes& aMCC) |
|
36 { |
|
37 CMobileInfo* self= new (ELeave) CMobileInfo(aMCC); |
|
38 CleanupStack::PushL(self); |
|
39 self->ConstructL(); |
|
40 CleanupStack::PopAndDestroy(self); |
|
41 } |
|
42 |
|
43 void CMobileInfo::ConstructL() |
|
44 { |
|
45 iWait = new (ELeave) CActiveSchedulerWait(); |
|
46 |
|
47 iTelephony = CTelephony::NewL(); |
|
48 iTelephony->GetCurrentNetworkInfo(iStatus, iMCCMNCV1Pkg); |
|
49 SetActive(); |
|
50 |
|
51 iWait->Start(); |
|
52 } |
|
53 |
|
54 void CMobileInfo::RunL() |
|
55 { |
|
56 if(iStatus==KErrNone) |
|
57 { |
|
58 iMCC = iMCCMNCV1.iCountryCode; |
|
59 } |
|
60 iWait->AsyncStop(); |
|
61 } |
|
62 |
|
63 void CMobileInfo::DoCancel() |
|
64 { |
|
65 iTelephony->CancelAsync(CTelephony::EGetCurrentNetworkInfoCancel); |
|
66 } |
|
67 |
|
68 // End of file |