44
|
1 |
// Copyright (c) 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 |
// This contains CAsyncHelperRequest which is a helper request which callback to ctsy asynchronously
|
|
15 |
//
|
|
16 |
|
|
17 |
#include <ctsy/ltsy/cctsydispatchercallback.h>
|
|
18 |
#include <rmmcustomapi.h>
|
|
19 |
#include "asynchelperrequest.h"
|
|
20 |
#include <ctsy/ltsy/mltsydispatchphoneinterface.h>
|
|
21 |
#include "globalphonemanager.h"
|
|
22 |
#include "tsyconfg.h"
|
|
23 |
#include "mslogger.h"
|
|
24 |
|
|
25 |
// Class CAsyncHelperRequest
|
|
26 |
// ---------------------------------------------------------------------------
|
|
27 |
// CAsyncHelperRequest::NewL
|
|
28 |
// other items were commented in a header
|
|
29 |
// ---------------------------------------------------------------------------
|
|
30 |
CAsyncHelperRequest* CAsyncHelperRequest::NewL(CGlobalPhonemanager& aGloblePhone,
|
|
31 |
CCtsyDispatcherCallback& aCallBack,
|
|
32 |
TInt aPriority )
|
|
33 |
{
|
|
34 |
CAsyncHelperRequest* newTimer=new(ELeave) CAsyncHelperRequest(aGloblePhone,aCallBack,aPriority);
|
|
35 |
CleanupStack::PushL(newTimer);
|
|
36 |
newTimer->ConstructL();
|
|
37 |
CleanupStack::Pop();
|
|
38 |
return newTimer;
|
|
39 |
}
|
|
40 |
// ---------------------------------------------------------------------------
|
|
41 |
// CAsyncHelperRequest::CAsyncHelperRequest
|
|
42 |
// other items were commented in a header
|
|
43 |
// ---------------------------------------------------------------------------
|
|
44 |
CAsyncHelperRequest ::CAsyncHelperRequest(CGlobalPhonemanager& aGloblePhone,
|
|
45 |
CCtsyDispatcherCallback& aCallBack,
|
|
46 |
TInt aPriority)
|
|
47 |
: CTimer(aPriority),iCallBack(aCallBack),iGloblePhone(aGloblePhone)
|
|
48 |
{
|
|
49 |
CActiveScheduler::Add(this);
|
|
50 |
iRequestId = 0;
|
|
51 |
iReqArray.Reset();
|
|
52 |
}
|
|
53 |
// ---------------------------------------------------------------------------
|
|
54 |
// CAsyncHelperRequest::~CAsyncHelperRequest
|
|
55 |
// other items were commented in a header
|
|
56 |
// ---------------------------------------------------------------------------
|
|
57 |
CAsyncHelperRequest::~CAsyncHelperRequest()
|
|
58 |
{
|
|
59 |
Cancel();
|
|
60 |
}
|
|
61 |
// ---------------------------------------------------------------------------
|
|
62 |
// CAsyncHelperRequest::SetRequestId
|
|
63 |
// other items were commented in a header
|
|
64 |
// ---------------------------------------------------------------------------
|
|
65 |
void CAsyncHelperRequest::SetRequestId(const TInt aIpc)
|
|
66 |
{
|
|
67 |
TInt count = iReqArray.Count();
|
|
68 |
if((count > 0)||IsActive())
|
|
69 |
{
|
|
70 |
iReqArray.Append(aIpc);
|
|
71 |
}
|
|
72 |
else
|
|
73 |
{
|
|
74 |
iRequestId = aIpc;
|
|
75 |
StartTimer();
|
|
76 |
}
|
|
77 |
}
|
|
78 |
// ---------------------------------------------------------------------------
|
|
79 |
// CAsyncHelperRequest::RunL
|
|
80 |
// other items were commented in a header
|
|
81 |
// ---------------------------------------------------------------------------
|
|
82 |
void CAsyncHelperRequest::RunL()
|
|
83 |
{
|
|
84 |
switch(iRequestId)
|
|
85 |
{
|
|
86 |
case MLtsyDispatchPhoneGetNetworkMode::KLtsyDispatchPhoneGetNetworkModeApiId:
|
|
87 |
iCallBack.CallbackPhoneGetNetworkModeComp(KErrNone,RMobilePhone::ENetworkModeGsm);
|
|
88 |
break;
|
|
89 |
case MLtsyDispatchPhoneGetCurrentSystemNetworkModes::KLtsyDispatchPhoneGetCurrentSystemNetworkModesApiId:
|
|
90 |
iCallBack.CallbackPhoneGetCurrentSystemNetworkModesComp(KErrNone,RMmCustomAPI::KCapsNetworkModeGsm);
|
|
91 |
break;
|
|
92 |
case MLtsyDispatchPhoneGetNitzInfo::KLtsyDispatchPhoneGetNitzInfoApiId:
|
|
93 |
iCallBack.CallbackPhoneGetNitzInfoComp(KErrNone,iGloblePhone.iPhoneStatus.iMobilePhoneNITZ);
|
|
94 |
break;
|
|
95 |
case MLtsyDispatchPhoneSimRefreshRegister::KLtsyDispatchPhoneSimRefreshRegisterApiId:
|
|
96 |
iCallBack.CallbackPhoneSimRefreshRegisterComp(KErrNone);
|
|
97 |
break;
|
|
98 |
case MLtsyDispatchPacketServicesSetDefaultPdpContextGprsParams::KLtsyDispatchPacketServicesSetDefaultPdpContextGprsParamsApiId:
|
|
99 |
iCallBack.CallbackPacketServicesSetDefaultPdpContextParamsComp(KErrNone);
|
|
100 |
break;
|
|
101 |
case MLtsyDispatchPacketServicesGetStaticCapabilities::KLtsyDispatchPacketServicesGetStaticCapabilitiesApiId:
|
|
102 |
TUint aCaps ;
|
|
103 |
aCaps=RPacketService::KCapsSetDefaultContextSupported;
|
|
104 |
aCaps|=RPacketService::KCapsMSClassSupported;
|
|
105 |
iCallBack.CallbackPacketServicesGetStaticCapabilitiesComp(KErrNone,aCaps);
|
|
106 |
break;
|
|
107 |
case MLtsyDispatchPacketServicesGetMaxNoMonitoredServiceLists::KLtsyDispatchPacketServicesGetMaxNoMonitoredServiceListsApiId:
|
|
108 |
iCallBack.CallbackPacketServicesGetMaxNoMonitoredServiceListsComp(KErrNone,1);
|
|
109 |
break;
|
|
110 |
case MLtsyDispatchPacketServicesGetMaxNoActiveServices::KLtsyDispatchPacketServicesGetMaxNoActiveServicesApiId:
|
|
111 |
iCallBack.CallbackPacketServicesGetMaxNoActiveServicesComp(KErrNone,1);
|
|
112 |
break;
|
|
113 |
case MLtsyDispatchPacketServicesGetStatus::KLtsyDispatchPacketServicesGetStatusApiId:
|
|
114 |
iCallBack.CallbackPacketServicesGetStatusComp(KErrNone,iGloblePhone.iPhoneStatus.iPacketStatus,EFalse);
|
|
115 |
break;
|
|
116 |
case MLtsyDispatchPhoneGetDetectedNetworksCancel::KLtsyDispatchPhoneGetDetectedNetworksCancelApiId:
|
|
117 |
iCallBack.CallbackPhoneGetDetectedNetworksCancelComp(KErrNone);
|
|
118 |
break;
|
|
119 |
case MLtsyDispatchPhoneSelectNetworkCancel::KLtsyDispatchPhoneSelectNetworkCancelApiId:
|
|
120 |
iCallBack.CallbackPhoneSelectNetworkCancelComp(KErrGeneral);
|
|
121 |
break;
|
|
122 |
case MLtsyDispatchSmsSetMoSmsBearer::KLtsyDispatchSmsSetMoSmsBearerApiId:
|
|
123 |
iCallBack.CallbackSmsSetMoSmsBearerComp(KErrNotSupported);
|
|
124 |
break;
|
|
125 |
case MLtsyDispatchPacketServicesGetPacketAttachMode::KLtsyDispatchPacketServicesGetPacketAttachModeApiId:
|
|
126 |
iCallBack.CallbackPacketServicesGetPacketAttachModeComp(KErrNone, RPacketService::EAttachWhenNeeded);
|
|
127 |
break;
|
|
128 |
default:
|
|
129 |
break;
|
|
130 |
}
|
|
131 |
TInt count = iReqArray.Count();
|
|
132 |
if(count > 0)
|
|
133 |
{
|
|
134 |
iRequestId = iReqArray[0];
|
|
135 |
iReqArray.Remove(0);
|
|
136 |
StartTimer();
|
|
137 |
}
|
|
138 |
}
|
|
139 |
// ---------------------------------------------------------------------------
|
|
140 |
// CAsyncHelperRequest::StartTimer
|
|
141 |
// other items were commented in a header
|
|
142 |
// ---------------------------------------------------------------------------
|
|
143 |
void CAsyncHelperRequest::StartTimer(const TTimeIntervalMicroSeconds32 aTimeout)
|
|
144 |
{
|
|
145 |
if (IsActive())
|
|
146 |
Cancel();
|
|
147 |
After(aTimeout);
|
|
148 |
}
|
|
149 |
// ---------------------------------------------------------------------------
|
|
150 |
// CAsyncHelperRequest::StopTimer
|
|
151 |
// other items were commented in a header
|
|
152 |
// ---------------------------------------------------------------------------
|
|
153 |
void CAsyncHelperRequest::StopTimer()
|
|
154 |
{
|
|
155 |
Cancel();
|
|
156 |
}
|
|
157 |
|
|
158 |
//
|
|
159 |
// End of file
|