24
|
1 |
// Copyright (c) 1997-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 |
#include "mmtsy.h"
|
|
17 |
#include "testdef.h"
|
|
18 |
#include "ETELMM.H"
|
|
19 |
#include <et_clsvr.h>
|
|
20 |
#include "Dmmlog.h"
|
|
21 |
|
|
22 |
/**************************************************************************/
|
|
23 |
//
|
|
24 |
// CSmsMessagingDMmTsy
|
|
25 |
//
|
|
26 |
/**************************************************************************/
|
|
27 |
|
|
28 |
CSmsMessagingDMmTsy* CSmsMessagingDMmTsy::NewL(CPhoneDMmTsy *aPhone, CPhoneFactoryDummyBase* aFac, const TDesC& aName)
|
|
29 |
{
|
|
30 |
CSmsMessagingDMmTsy* subsession=new(ELeave) CSmsMessagingDMmTsy(aPhone, aFac,aName);
|
|
31 |
CleanupStack::PushL(subsession);
|
|
32 |
subsession->ConstructL();
|
|
33 |
CleanupStack::Pop();
|
|
34 |
return subsession;
|
|
35 |
}
|
|
36 |
|
|
37 |
void CSmsMessagingDMmTsy::Init()
|
|
38 |
{}
|
|
39 |
|
|
40 |
CSmsMessagingDMmTsy::CSmsMessagingDMmTsy(CPhoneDMmTsy *aPhone, CPhoneFactoryDummyBase* aFac, const TDesC& aName)
|
|
41 |
:CSubSessionExtDummyBase(aFac), iPhone(aPhone)
|
|
42 |
{
|
|
43 |
iMessagingName=aName;
|
|
44 |
}
|
|
45 |
|
|
46 |
void CSmsMessagingDMmTsy::ConstructL()
|
|
47 |
{
|
|
48 |
LOGTEXT(_L8("CSmsMessagingDMmTsy created"));
|
|
49 |
iSmspReadAll = new (ELeave) CArrayPtrFlat<CListReadAllAttempt>(1);
|
|
50 |
}
|
|
51 |
|
|
52 |
CSmsMessagingDMmTsy::~CSmsMessagingDMmTsy()
|
|
53 |
{
|
|
54 |
LOGTEXT(_L8("CSmsMessagingDMmTsy destroyed"));
|
|
55 |
if (iSmspReadAll)
|
|
56 |
iSmspReadAll->ResetAndDestroy();
|
|
57 |
delete iSmspReadAll;
|
|
58 |
}
|
|
59 |
|
|
60 |
CTelObject* CSmsMessagingDMmTsy::OpenNewObjectByNameL(const TDesC& aName)
|
|
61 |
{
|
|
62 |
// SMS related stores can be opened from an SMS messaging sub-session
|
|
63 |
// Clients must supply the name of the store they wish to open
|
|
64 |
|
|
65 |
if (aName.Compare(KETelMeSmsStore)==KErrNone)
|
|
66 |
return REINTERPRET_CAST(CTelObject*, CSmsStoreDMmTsy::NewL(iPhone,FacPtr(),aName));
|
|
67 |
|
|
68 |
if (aName.Compare(KETelIccSmsStore)==KErrNone)
|
|
69 |
return REINTERPRET_CAST(CTelObject*, CSmsStoreDMmTsy::NewL(iPhone,FacPtr(),aName));
|
|
70 |
|
|
71 |
return NULL;
|
|
72 |
}
|
|
73 |
|
|
74 |
CTelObject* CSmsMessagingDMmTsy::OpenNewObjectL(TDes&)
|
|
75 |
{
|
|
76 |
// Open objects without a name is not supported
|
|
77 |
User::Leave(KErrNotSupported);
|
|
78 |
return NULL;
|
|
79 |
}
|
|
80 |
|
|
81 |
CTelObject::TReqMode CSmsMessagingDMmTsy::ReqModeL(const TInt aIpc)
|
|
82 |
{
|
|
83 |
// ReqModeL is called from the server's CTelObject::ReqAnalyserL
|
|
84 |
// in order to check the type of request it has
|
|
85 |
|
|
86 |
// The following are example request types for this dummy TSY
|
|
87 |
// All TSYs do not have to have these request types but they have been given
|
|
88 |
// "sensible" values in this test code
|
|
89 |
|
|
90 |
CTelObject::TReqMode ret=0;
|
|
91 |
switch (aIpc)
|
|
92 |
{
|
|
93 |
|
|
94 |
//
|
|
95 |
// Non-flow Controlled Services
|
|
96 |
//
|
|
97 |
case EMobileSmsMessagingGetCaps:
|
|
98 |
case EMobileSmsMessagingGetReceiveMode:
|
|
99 |
case EMobileSmsMessagingGetMoSmsBearer:
|
|
100 |
case EMobileSmsMessagingEnumerateMessageStores:
|
|
101 |
case EMobileSmsMessagingGetMessageStoreInfo:
|
|
102 |
case EMobileSmsMessagingResumeSmsReception:
|
|
103 |
case EMobileSmsMessagingGetSmspListPhase2:
|
|
104 |
break;
|
|
105 |
|
|
106 |
//
|
|
107 |
// Flow Controlled Services
|
|
108 |
//
|
|
109 |
case EMobileSmsMessagingSetReceiveMode:
|
|
110 |
case EMobileSmsMessagingSetMoSmsBearer:
|
|
111 |
case EMobileSmsMessagingAckSmsStored:
|
|
112 |
case EMobileSmsMessagingNackSmsStored:
|
|
113 |
case EMobileSmsMessagingSendMessage:
|
|
114 |
case EMobileSmsMessagingSendMessageNoFdnCheck:
|
|
115 |
case EMobileSmsMessagingGetSmspListPhase1:
|
|
116 |
case EMobileSmsMessagingStoreSmspList:
|
|
117 |
ret=KReqModeFlowControlObeyed;
|
|
118 |
break;
|
|
119 |
|
|
120 |
//
|
|
121 |
// Immediate server repost of request
|
|
122 |
//
|
|
123 |
case EMobileSmsMessagingReceiveMessage:
|
|
124 |
ret=KReqModeRePostImmediately;
|
|
125 |
break;
|
|
126 |
//
|
|
127 |
// Multiple Completion Services with Immediate Server Repost
|
|
128 |
// (Usually Notifications)
|
|
129 |
//
|
|
130 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
131 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
132 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
133 |
ret=KReqModeMultipleCompletionEnabled | KReqModeRePostImmediately;
|
|
134 |
break;
|
|
135 |
|
|
136 |
//
|
|
137 |
// Cancel Requests
|
|
138 |
//
|
|
139 |
case EMobileSmsMessagingSetReceiveModeCancel:
|
|
140 |
case EMobileSmsMessagingNotifyReceiveModeChangeCancel:
|
|
141 |
case EMobileSmsMessagingNotifyMoSmsBearerChangeCancel:
|
|
142 |
case EMobileSmsMessagingAckSmsStoredCancel:
|
|
143 |
case EMobileSmsMessagingNackSmsStoredCancel:
|
|
144 |
case EMobileSmsMessagingSendMessageCancel:
|
|
145 |
case EMobileSmsMessagingSendMessageNoFdnCheckCancel:
|
|
146 |
case EMobileSmsMessagingGetMessageStoreInfoCancel:
|
|
147 |
case EMobileSmsMessagingGetSmspListCancel:
|
|
148 |
case EMobileSmsMessagingStoreSmspListCancel:
|
|
149 |
case EMobileSmsMessagingNotifySmspListChangeCancel:
|
|
150 |
default:
|
|
151 |
User::Leave(KErrNotSupported);
|
|
152 |
break;
|
|
153 |
}
|
|
154 |
|
|
155 |
return ret;
|
|
156 |
}
|
|
157 |
|
|
158 |
TInt CSmsMessagingDMmTsy::RegisterNotification(const TInt aIpc)
|
|
159 |
{
|
|
160 |
// RegisterNotification is called when the server recognises that this notification
|
|
161 |
// is being posted for the first time on this sub-session object.
|
|
162 |
|
|
163 |
// It enables the TSY to "turn on" any regular notification messages that it may
|
|
164 |
// receive from the phone
|
|
165 |
|
|
166 |
switch (aIpc)
|
|
167 |
{
|
|
168 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
169 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: RegisterNotification - SMSP List Change"));
|
|
170 |
return KErrNone;
|
|
171 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
172 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: RegisterNotification - SMS Receive Mode Change"));
|
|
173 |
return KErrNone;
|
|
174 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
175 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: RegisterNotification - SMS Bearer Change"));
|
|
176 |
return KErrNone;
|
|
177 |
case EMobileSmsMessagingReceiveMessage:
|
|
178 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: RegisterNotification - Receive Message"));
|
|
179 |
return KErrNone;
|
|
180 |
default:
|
|
181 |
// Unknown or invalid IPC
|
|
182 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: Register error, unknown IPC"));
|
|
183 |
return KErrNotSupported;
|
|
184 |
}
|
|
185 |
}
|
|
186 |
|
|
187 |
TInt CSmsMessagingDMmTsy::DeregisterNotification(const TInt aIpc)
|
|
188 |
{
|
|
189 |
// DeregisterNotification is called when the server recognises that this notification
|
|
190 |
// will not be posted again because the last client to have a handle on this sub-session
|
|
191 |
// object has just closed the handle.
|
|
192 |
|
|
193 |
// It enables the TSY to "turn off" any regular notification messages that it may
|
|
194 |
// receive from the phone
|
|
195 |
|
|
196 |
switch (aIpc)
|
|
197 |
{
|
|
198 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
199 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: DeregisterNotification - SMSP List Change"));
|
|
200 |
return KErrNone;
|
|
201 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
202 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: DeregisterNotification - SMS Receive Mode Change"));
|
|
203 |
return KErrNone;
|
|
204 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
205 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: DeregisterNotification - SMS Bearer Change"));
|
|
206 |
return KErrNone;
|
|
207 |
case EMobileSmsMessagingReceiveMessage:
|
|
208 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: DeregisterNotification - Receive Message"));
|
|
209 |
return KErrNone;
|
|
210 |
default:
|
|
211 |
// Unknown or invalid IPC
|
|
212 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: Deregister error, unknown IPC"));
|
|
213 |
return KErrNotSupported;
|
|
214 |
}
|
|
215 |
}
|
|
216 |
|
|
217 |
TInt CSmsMessagingDMmTsy::NumberOfSlotsL(const TInt aIpc)
|
|
218 |
{
|
|
219 |
// NumberOfSlotsL is called by the server when it is registering a new notification
|
|
220 |
// It enables the TSY to tell the server how many buffer slots to allocate for
|
|
221 |
// "repost immediately" notifications that may trigger before clients collect them
|
|
222 |
|
|
223 |
TInt numberOfSlots=1;
|
|
224 |
switch (aIpc)
|
|
225 |
{
|
|
226 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
227 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
228 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
229 |
case EMobileSmsMessagingReceiveMessage:
|
|
230 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: Registered with 2 slot"));
|
|
231 |
numberOfSlots=2;
|
|
232 |
break;
|
|
233 |
default:
|
|
234 |
// Unknown or invalid Phone IPC
|
|
235 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: Number of Slots error, unknown IPC"));
|
|
236 |
User::Leave(KErrNotSupported);
|
|
237 |
break;
|
|
238 |
}
|
|
239 |
return numberOfSlots;
|
|
240 |
}
|
|
241 |
|
|
242 |
|
|
243 |
TInt CSmsMessagingDMmTsy::ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,
|
|
244 |
const TDataPackage& aPackage)
|
|
245 |
{
|
|
246 |
// ExtFunc is called by the server when it has a "extended", i.e. non-core ETel request
|
|
247 |
// for the TSY to process
|
|
248 |
// A request handle, request type and request data are passed to the TSY
|
|
249 |
|
|
250 |
TAny* dataPtr=aPackage.Ptr1();
|
|
251 |
TAny* dataPtr2=aPackage.Ptr2();
|
|
252 |
|
|
253 |
switch (aIpc)
|
|
254 |
{
|
|
255 |
case EMobileSmsMessagingGetCaps:
|
|
256 |
return GetCaps(aTsyReqHandle, aPackage.Des1n());
|
|
257 |
|
|
258 |
case EMobileSmsMessagingEnumerateMessageStores:
|
|
259 |
return EnumerateMessageStores(aTsyReqHandle,
|
|
260 |
REINTERPRET_CAST(TInt*, dataPtr));
|
|
261 |
|
|
262 |
case EMobileSmsMessagingGetMessageStoreInfo:
|
|
263 |
return GetMessageStoreInfo(aTsyReqHandle,
|
|
264 |
REINTERPRET_CAST(TInt*, dataPtr),
|
|
265 |
aPackage.Des2n());
|
|
266 |
|
|
267 |
case EMobileSmsMessagingReceiveMessage:
|
|
268 |
return ReceiveMessage(aTsyReqHandle, aPackage.Des1n(), aPackage.Des2n());
|
|
269 |
|
|
270 |
case EMobileSmsMessagingAckSmsStored:
|
|
271 |
return AckSmsStored(aTsyReqHandle, aPackage.Des1n(),
|
|
272 |
REINTERPRET_CAST(TBool*, dataPtr2));
|
|
273 |
|
|
274 |
case EMobileSmsMessagingNackSmsStored:
|
|
275 |
return NackSmsStored(aTsyReqHandle, aPackage.Des1n(),
|
|
276 |
REINTERPRET_CAST(TInt*, dataPtr2));
|
|
277 |
|
|
278 |
case EMobileSmsMessagingResumeSmsReception:
|
|
279 |
return ResumeSmsReception(aTsyReqHandle);
|
|
280 |
|
|
281 |
case EMobileSmsMessagingSendMessage:
|
|
282 |
return SendMessage(aTsyReqHandle, aPackage.Des1n(), aPackage.Des2n());
|
|
283 |
|
|
284 |
case EMobileSmsMessagingSendMessageNoFdnCheck:
|
|
285 |
return SendMessageNoFdnCheck(aTsyReqHandle, aPackage.Des1n(), aPackage.Des2n());
|
|
286 |
|
|
287 |
case EMobileSmsMessagingGetSmspListPhase1:
|
|
288 |
return ReadSmspListPhase1(aTsyReqHandle,
|
|
289 |
REINTERPRET_CAST(RMobilePhone::TClientId*,dataPtr),
|
|
290 |
REINTERPRET_CAST(TInt*,dataPtr2));
|
|
291 |
|
|
292 |
case EMobileSmsMessagingGetSmspListPhase2:
|
|
293 |
return ReadSmspListPhase2(aTsyReqHandle,
|
|
294 |
REINTERPRET_CAST(RMobilePhone::TClientId*,dataPtr), aPackage.Des2n());
|
|
295 |
|
|
296 |
case EMobileSmsMessagingStoreSmspList:
|
|
297 |
return StoreSmspList(aTsyReqHandle, aPackage.Des1n());
|
|
298 |
|
|
299 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
300 |
return NotifySmspListChange(aTsyReqHandle);
|
|
301 |
|
|
302 |
case EMobileSmsMessagingGetReceiveMode:
|
|
303 |
return GetReceiveMode(aTsyReqHandle,
|
|
304 |
REINTERPRET_CAST(RMobileSmsMessaging::TMobileSmsReceiveMode*, dataPtr));
|
|
305 |
|
|
306 |
case EMobileSmsMessagingSetReceiveMode:
|
|
307 |
return SetReceiveMode(aTsyReqHandle,
|
|
308 |
REINTERPRET_CAST(RMobileSmsMessaging::TMobileSmsReceiveMode*, dataPtr));
|
|
309 |
|
|
310 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
311 |
return NotifyReceiveModeChange(aTsyReqHandle,
|
|
312 |
REINTERPRET_CAST(RMobileSmsMessaging::TMobileSmsReceiveMode*, dataPtr));
|
|
313 |
|
|
314 |
case EMobileSmsMessagingGetMoSmsBearer:
|
|
315 |
return GetMoSmsBearer(aTsyReqHandle,
|
|
316 |
REINTERPRET_CAST(RMobileSmsMessaging::TMobileSmsBearer*, dataPtr));
|
|
317 |
|
|
318 |
case EMobileSmsMessagingSetMoSmsBearer:
|
|
319 |
return SetMoSmsBearer(aTsyReqHandle,
|
|
320 |
REINTERPRET_CAST(RMobileSmsMessaging::TMobileSmsBearer*, dataPtr));
|
|
321 |
|
|
322 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
323 |
return NotifyMoSmsBearerChange(aTsyReqHandle,
|
|
324 |
REINTERPRET_CAST(RMobileSmsMessaging::TMobileSmsBearer*, dataPtr));
|
|
325 |
|
|
326 |
default:
|
|
327 |
return KErrNotSupported;
|
|
328 |
}
|
|
329 |
}
|
|
330 |
|
|
331 |
TInt CSmsMessagingDMmTsy::CancelService(const TInt aIpc,const TTsyReqHandle aTsyReqHandle)
|
|
332 |
{
|
|
333 |
// CancelService is called by the server when it is "cleaning-up" any still outstanding
|
|
334 |
// asynchronous requests before closing a client's sub-session.
|
|
335 |
// This will happen if a client closes its R-class handle without cancelling outstanding
|
|
336 |
// asynchronous requests.
|
|
337 |
|
|
338 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: - CancelService called"));
|
|
339 |
switch (aIpc)
|
|
340 |
{
|
|
341 |
case EMobileSmsMessagingReceiveMessage:
|
|
342 |
return ReceiveMessageCancel(aTsyReqHandle);
|
|
343 |
case EMobileSmsMessagingAckSmsStored:
|
|
344 |
return AckSmsStoredCancel(aTsyReqHandle);
|
|
345 |
case EMobileSmsMessagingNackSmsStored:
|
|
346 |
return NackSmsStoredCancel(aTsyReqHandle);
|
|
347 |
case EMobileSmsMessagingSendMessage:
|
|
348 |
return SendMessageCancel(aTsyReqHandle);
|
|
349 |
case EMobileSmsMessagingSendMessageNoFdnCheck:
|
|
350 |
return SendMessageNoFdnCheckCancel(aTsyReqHandle);
|
|
351 |
case EMobileSmsMessagingGetMessageStoreInfo:
|
|
352 |
return GetMessageStoreInfoCancel(aTsyReqHandle);
|
|
353 |
case EMobileSmsMessagingGetSmspListPhase1:
|
|
354 |
case EMobileSmsMessagingGetSmspListPhase2:
|
|
355 |
return ReadSmspListCancel(aTsyReqHandle);
|
|
356 |
case EMobileSmsMessagingStoreSmspList:
|
|
357 |
return StoreSmspListCancel(aTsyReqHandle);
|
|
358 |
case EMobileSmsMessagingNotifySmspListChange:
|
|
359 |
return NotifySmspListChangeCancel(aTsyReqHandle);
|
|
360 |
case EMobileSmsMessagingSetReceiveMode:
|
|
361 |
return SetReceiveModeCancel(aTsyReqHandle);
|
|
362 |
case EMobileSmsMessagingNotifyReceiveModeChange:
|
|
363 |
return NotifyReceiveModeChangeCancel(aTsyReqHandle);
|
|
364 |
case EMobileSmsMessagingSetMoSmsBearer:
|
|
365 |
return SetMoSmsBearerCancel(aTsyReqHandle);
|
|
366 |
case EMobileSmsMessagingNotifyMoSmsBearerChange:
|
|
367 |
return NotifyMoSmsBearerChangeCancel(aTsyReqHandle);
|
|
368 |
default:
|
|
369 |
return KErrGeneral;
|
|
370 |
}
|
|
371 |
}
|
|
372 |
|
|
373 |
|
|
374 |
/***********************************************************************************/
|
|
375 |
//
|
|
376 |
// The following methods are called from ExtFunc and/or CancelService.
|
|
377 |
// Each of these will process a TSY request or cancel a TSY request
|
|
378 |
// Here, example values are returned or checked within this dummy TSY in order to ensure
|
|
379 |
// that the integrity of the data passed to/from client is maintained
|
|
380 |
//
|
|
381 |
/***********************************************************************************/
|
|
382 |
|
|
383 |
|
|
384 |
TInt CSmsMessagingDMmTsy::GetCaps(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps)
|
|
385 |
{
|
|
386 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::GetCaps called"));
|
|
387 |
RMobileSmsMessaging::TMobileSmsCapsV1Pckg* smsCapsPckg = (RMobileSmsMessaging::TMobileSmsCapsV1Pckg*)aCaps;
|
|
388 |
RMobileSmsMessaging::TMobileSmsCapsV1& smsCaps = (*smsCapsPckg)();
|
|
389 |
|
|
390 |
smsCaps.iSmsMode=DMMTSY_SMS_MESSAGING_MODE_CAPS;
|
|
391 |
smsCaps.iSmsControl=DMMTSY_SMS_MESSAGING_CONTROL_CAPS;
|
|
392 |
|
|
393 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
394 |
return KErrNone;
|
|
395 |
}
|
|
396 |
|
|
397 |
TInt CSmsMessagingDMmTsy::ReceiveMessage(const TTsyReqHandle aTsyReqHandle, TDes8* aMsg, TDes8* aMsgAttributes)
|
|
398 |
{
|
|
399 |
if (!iReceiveMessage++)
|
|
400 |
{
|
|
401 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::ReceiveMessage called"));
|
|
402 |
|
|
403 |
RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg* attsPckg = REINTERPRET_CAST(RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg*, aMsgAttributes);
|
|
404 |
RMobileSmsMessaging::TMobileSmsReceiveAttributesV1& atts = (*attsPckg)();
|
|
405 |
|
|
406 |
atts.iFlags=DMMTSY_SMS_MESSAGE_FLAGS1;
|
|
407 |
atts.iDataFormat=DMMTSY_SMS_MESSAGE_FORMAT1;
|
|
408 |
atts.iGsmServiceCentre.iTelNumber=DMMTSY_SMS_MESSAGE_SC1;
|
|
409 |
atts.iOriginator.iTelNumber=DMMTSY_SMS_MESSAGE_REMOTEPARTYNUMBER1;
|
|
410 |
atts.iStatus=DMMTSY_SMS_MESSAGE_STATUS1;
|
|
411 |
atts.iStore=DMMTSY_MESSAGE_STORE_NAME;
|
|
412 |
atts.iStoreIndex=DMMTSY_SMS_STORE_INDEX1;
|
|
413 |
|
|
414 |
aMsg->Copy(DMMTSY_SMS_MESSAGE_PDU1);
|
|
415 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
416 |
}
|
|
417 |
return KErrNone;
|
|
418 |
}
|
|
419 |
|
|
420 |
TInt CSmsMessagingDMmTsy::ReceiveMessageCancel(const TTsyReqHandle aTsyReqHandle)
|
|
421 |
{
|
|
422 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::ReceiveMessageCancel called"));
|
|
423 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
424 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
425 |
return KErrNone;
|
|
426 |
}
|
|
427 |
|
|
428 |
TInt CSmsMessagingDMmTsy::AckSmsStored(const TTsyReqHandle aTsyReqHandle, TDesC8* aMsg, TBool* aFull)
|
|
429 |
{
|
|
430 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::AckSmsStored called"));
|
|
431 |
|
|
432 |
if (((aMsg->Length()!=0) && (aMsg->Compare(DMMTSY_SMS_MESSAGE_PDU1)!=0)) ||
|
|
433 |
(*aFull != DMMTSY_SMS_MESSAGE_FULL))
|
|
434 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
435 |
else
|
|
436 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
437 |
return KErrNone;
|
|
438 |
}
|
|
439 |
|
|
440 |
TInt CSmsMessagingDMmTsy::AckSmsStoredCancel(const TTsyReqHandle aTsyReqHandle)
|
|
441 |
{
|
|
442 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::AckSmsStoredCancel called"));
|
|
443 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
444 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
445 |
return KErrNone;
|
|
446 |
}
|
|
447 |
|
|
448 |
TInt CSmsMessagingDMmTsy::NackSmsStored(const TTsyReqHandle aTsyReqHandle, TDesC8* aMsgData, TInt* aRpCause)
|
|
449 |
{
|
|
450 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::NackSmsStored called"));
|
|
451 |
if ((aMsgData->Compare(DMMTSY_SMS_MESSAGE_PDU1) != 0 ) || *aRpCause != DMMTSY_SMS_MESSAGE_NACK_CAUSE)
|
|
452 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
453 |
else
|
|
454 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
455 |
return KErrNone;
|
|
456 |
}
|
|
457 |
|
|
458 |
TInt CSmsMessagingDMmTsy::NackSmsStoredCancel(const TTsyReqHandle aTsyReqHandle)
|
|
459 |
{
|
|
460 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::NackSmsStoredCancel called"));
|
|
461 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
462 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
463 |
return KErrNone;
|
|
464 |
}
|
|
465 |
|
|
466 |
TInt CSmsMessagingDMmTsy::ResumeSmsReception(const TTsyReqHandle aTsyReqHandle)
|
|
467 |
{
|
|
468 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::ResumeSmsReception called"));
|
|
469 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
470 |
return KErrNone;
|
|
471 |
}
|
|
472 |
|
|
473 |
TInt CSmsMessagingDMmTsy::SendMessage(const TTsyReqHandle aTsyReqHandle, TDesC8* aMsg, TDes8* aMsgAttributes)
|
|
474 |
{
|
|
475 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::SendMessage called"));
|
|
476 |
|
|
477 |
RMobileSmsMessaging::TMobileSmsAttributesV1Pckg* attsPckg = REINTERPRET_CAST(RMobileSmsMessaging::TMobileSmsAttributesV1Pckg*, aMsgAttributes);
|
|
478 |
RMobileSmsMessaging::TMobileSmsAttributesV1& atts = (*attsPckg)();
|
|
479 |
|
|
480 |
if (atts.ExtensionId() == RMobileSmsMessaging::KETelMobileSmsSendAttributesV1)
|
|
481 |
{
|
|
482 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg* attsV1Pckg = REINTERPRET_CAST(RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg*, aMsgAttributes);
|
|
483 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1& attsV1 = (*attsV1Pckg)();
|
|
484 |
|
|
485 |
if ((attsV1.iFlags != DMMTSY_SMS_MESSAGE_FLAGS2) ||
|
|
486 |
(attsV1.iDataFormat != DMMTSY_SMS_MESSAGE_FORMAT1) ||
|
|
487 |
(attsV1.iDestination.iTelNumber != DMMTSY_PHONE_TEL_NUMBER) ||
|
|
488 |
(attsV1.iMore != DMMTSY_SMS_MESSAGE_MORE) ||
|
|
489 |
(aMsg->Compare(DMMTSY_SMS_MESSAGE_PDU1) != 0))
|
|
490 |
{
|
|
491 |
ReqCompleted(aTsyReqHandle, KErrCorrupt);
|
|
492 |
}
|
|
493 |
else
|
|
494 |
{
|
|
495 |
attsV1.iMsgRef = DMMTSY_SMS_MESSAGE_MSGREF;
|
|
496 |
attsV1.iSubmitReport = DMMTSY_SMS_MESSAGE_PDU2;
|
|
497 |
iPhone->AddDelayedReq(aTsyReqHandle, this);
|
|
498 |
}
|
|
499 |
}
|
|
500 |
else if (atts.ExtensionId() == RMobileSmsMessaging::KETelMobileSmsCdmaSendAttributesV4)
|
|
501 |
{
|
|
502 |
RMobileSmsMessaging::TMobileSmsCdmaSendAttributesV4Pckg* attsV4Pckg = REINTERPRET_CAST(RMobileSmsMessaging::TMobileSmsCdmaSendAttributesV4Pckg*, aMsgAttributes);
|
|
503 |
RMobileSmsMessaging::TMobileSmsCdmaSendAttributesV4& attsV4 = (*attsV4Pckg)();
|
|
504 |
|
|
505 |
if ((attsV4.iFlags != DMMTSY_SMS_MESSAGE_CDMA_FLAGS) ||
|
|
506 |
(attsV4.iDataFormat != DMMTSY_SMS_MESSAGE_CDMA_FORMAT) ||
|
|
507 |
(attsV4.iCdmaTeleservice != DMMTSY_SMS_MESSAGE_CDMA_TELESERVICE) ||
|
|
508 |
(attsV4.iCdmaServiceCategory != DMMTSY_SMS_MESSAGE_CDMA_SERVICE_CATEGORY) ||
|
|
509 |
(attsV4.iMore != DMMTSY_SMS_MESSAGE_MORE) ||
|
|
510 |
(attsV4.iDestination.iTypeOfNumber != DMMTSY_SMS_MESSAGE_TON) ||
|
|
511 |
(attsV4.iDestination.iNumberPlan != DMMTSY_SMS_MESSAGE_NP) ||
|
|
512 |
(attsV4.iDestination.iTelNumber != DMMTSY_PHONE_TEL_NUMBER) ||
|
|
513 |
(attsV4.iAddressAuthentication != DMMTSY_SMS_MESSAGE_ADDRESS_AUTHENTICATION) ||
|
|
514 |
(aMsg->Compare(DMMTSY_SMS_MESSAGE_PDU1) != 0))
|
|
515 |
{
|
|
516 |
ReqCompleted(aTsyReqHandle, KErrCorrupt);
|
|
517 |
}
|
|
518 |
else
|
|
519 |
{
|
|
520 |
attsV4.iMsgRef = DMMTSY_SMS_MESSAGE_MSGREF;
|
|
521 |
attsV4.iTLAck = DMMTSY_SMS_MESSAGE_TLACK;
|
|
522 |
iPhone->AddDelayedReq(aTsyReqHandle, this);
|
|
523 |
}
|
|
524 |
}
|
|
525 |
else
|
|
526 |
{
|
|
527 |
ReqCompleted(aTsyReqHandle, KErrCorrupt);
|
|
528 |
}
|
|
529 |
return KErrNone;
|
|
530 |
}
|
|
531 |
|
|
532 |
TInt CSmsMessagingDMmTsy::SendMessageCancel(const TTsyReqHandle aTsyReqHandle)
|
|
533 |
{
|
|
534 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::SendMessageCancel called"));
|
|
535 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
536 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
537 |
return KErrNone;
|
|
538 |
}
|
|
539 |
|
|
540 |
TInt CSmsMessagingDMmTsy::SendMessageNoFdnCheck(const TTsyReqHandle aTsyReqHandle, TDesC8* aMsg, TDes8* aMsgAttributes)
|
|
541 |
/**
|
|
542 |
* This method sends an outgoing SMS to the network. The number used for sending the SMS
|
|
543 |
* is not checked against those in the Fixed Dialling Number list even if the FDN service is enabled
|
|
544 |
*
|
|
545 |
* @param aMsg Supplies the TPDU to send
|
|
546 |
* @param aMsgAttributes Supplies the attributes of the outgoing message
|
|
547 |
*/
|
|
548 |
{
|
|
549 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::SendMessageNoFdnCheck called"));
|
|
550 |
|
|
551 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg* attsPckg = REINTERPRET_CAST(RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg*, aMsgAttributes);
|
|
552 |
RMobileSmsMessaging::TMobileSmsSendAttributesV1& atts = (*attsPckg)();
|
|
553 |
|
|
554 |
if ((atts.iFlags != DMMTSY_SMS_MESSAGE_FLAGS2) ||
|
|
555 |
(atts.iDataFormat != DMMTSY_SMS_MESSAGE_FORMAT1) ||
|
|
556 |
(atts.iDestination.iTelNumber.Compare(DMMTSY_PHONE_TEL_NUMBER) != 0) ||
|
|
557 |
(atts.iMore != DMMTSY_SMS_MESSAGE_MORE) ||
|
|
558 |
(aMsg->Compare(DMMTSY_SMS_MESSAGE_PDU1) != 0))
|
|
559 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
560 |
else
|
|
561 |
{
|
|
562 |
atts.iMsgRef=DMMTSY_SMS_MESSAGE_MSGREF;
|
|
563 |
atts.iSubmitReport=DMMTSY_SMS_MESSAGE_PDU2;
|
|
564 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
565 |
}
|
|
566 |
return KErrNone;
|
|
567 |
}
|
|
568 |
|
|
569 |
TInt CSmsMessagingDMmTsy::SendMessageNoFdnCheckCancel(const TTsyReqHandle aTsyReqHandle)
|
|
570 |
/**
|
|
571 |
* This method cancels the sending of an outgoing SMS to the network. The number used for sending the SMS
|
|
572 |
* is not checked against those in the Fixed Dialling Number list even if the FDN service is enabled
|
|
573 |
*
|
|
574 |
*/
|
|
575 |
{
|
|
576 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::SendMessageNoFdnCheckCancel called"));
|
|
577 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
578 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
579 |
return KErrNone;
|
|
580 |
}
|
|
581 |
|
|
582 |
TInt CSmsMessagingDMmTsy::EnumerateMessageStores(const TTsyReqHandle aTsyReqHandle, TInt* aCount)
|
|
583 |
{
|
|
584 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::EnumerateMessageStores called"));
|
|
585 |
*aCount=DMMTSY_PHONE_MESSAGE_STORE_COUNT;
|
|
586 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
587 |
return KErrNone;
|
|
588 |
}
|
|
589 |
|
|
590 |
TInt CSmsMessagingDMmTsy::GetMessageStoreInfo(const TTsyReqHandle aTsyReqHandle, TInt *aIndex, TDes8* aInfo)
|
|
591 |
{
|
|
592 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::GetMessageStoreInfo called"));
|
|
593 |
|
|
594 |
if (*aIndex != DMMTSY_SMS_STORE_INDEX1)
|
|
595 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
596 |
else
|
|
597 |
{
|
|
598 |
RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg* infoPckg = REINTERPRET_CAST(RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg*, aInfo);
|
|
599 |
RMobilePhoneStore::TMobilePhoneStoreInfoV1& info = (*infoPckg)();
|
|
600 |
|
|
601 |
info.iName=DMMTSY_MESSAGE_STORE_NAME;
|
|
602 |
info.iType=DMMTSY_MESSAGE_STORE_TYPE;
|
|
603 |
info.iTotalEntries=DMMTSY_MESSAGE_STORE_TOTAL_ENTRIES;
|
|
604 |
info.iUsedEntries=DMMTSY_MESSAGE_STORE_USED_ENTRIES;
|
|
605 |
info.iCaps=DMMTSY_MESSAGE_STORE_CAPS;
|
|
606 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
607 |
}
|
|
608 |
return KErrNone;
|
|
609 |
}
|
|
610 |
|
|
611 |
TInt CSmsMessagingDMmTsy::GetMessageStoreInfoCancel(const TTsyReqHandle aTsyReqHandle)
|
|
612 |
{
|
|
613 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::GetMessageStoreInfoCancel called"));
|
|
614 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
615 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
616 |
return KErrNone;
|
|
617 |
}
|
|
618 |
|
|
619 |
TInt CSmsMessagingDMmTsy::ValidateSmspEntry(const RMobileSmsMessaging::TMobileSmspEntryV1& aEntry)
|
|
620 |
{
|
|
621 |
if ((aEntry.iText != DMMTSY_SMSP_STORE_TEXT1) ||
|
|
622 |
(aEntry.iValidParams != DMMTSY_SMSP_STORE_VALID_PARAMS1) ||
|
|
623 |
(aEntry.iDestination.iTelNumber.Compare(DMMTSY_PHONE_TEL_NUMBER) != 0) ||
|
|
624 |
(aEntry.iValidityPeriod != DMMTSY_SMSP_STORE_VALIDITY1) ||
|
|
625 |
(aEntry.iServiceCentre.iTelNumber.Compare(DMMTSY_SMSP_STORE_SCA) != 0) ||
|
|
626 |
(aEntry.iProtocolId != DMMTSY_SMSP_STORE_PID1) ||
|
|
627 |
(aEntry.iDcs != DMMTSY_SMSP_STORE_DCS1))
|
|
628 |
return KErrCorrupt;
|
|
629 |
else
|
|
630 |
return KErrNone;
|
|
631 |
}
|
|
632 |
|
|
633 |
void CSmsMessagingDMmTsy::InitSmspEntry(RMobileSmsMessaging::TMobileSmspEntryV1& aEntry)
|
|
634 |
{
|
|
635 |
aEntry.iText = DMMTSY_SMSP_STORE_TEXT1;
|
|
636 |
aEntry.iValidParams = DMMTSY_SMSP_STORE_VALID_PARAMS1;
|
|
637 |
aEntry.iDestination.iTelNumber = DMMTSY_PHONE_TEL_NUMBER;
|
|
638 |
aEntry.iValidityPeriod = DMMTSY_SMSP_STORE_VALIDITY1;
|
|
639 |
aEntry.iServiceCentre.iTelNumber = DMMTSY_SMSP_STORE_SCA;
|
|
640 |
aEntry.iProtocolId = DMMTSY_SMSP_STORE_PID1;
|
|
641 |
aEntry.iDcs = DMMTSY_SMSP_STORE_DCS1;
|
|
642 |
}
|
|
643 |
|
|
644 |
|
|
645 |
TInt CSmsMessagingDMmTsy::ReadSmspListPhase1(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TClientId* aId, TInt* aBufSize)
|
|
646 |
{
|
|
647 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::ReadSmspListPhase1 called"));
|
|
648 |
TInt ret=KErrNone;
|
|
649 |
TInt leaveCode=KErrNone;
|
|
650 |
TRAP(leaveCode, ret=ProcessReadSmspListPhase1L(aTsyReqHandle, aId, aBufSize););
|
|
651 |
if (leaveCode != KErrNone)
|
|
652 |
ReqCompleted(aTsyReqHandle,leaveCode);
|
|
653 |
return ret;
|
|
654 |
};
|
|
655 |
|
|
656 |
TInt CSmsMessagingDMmTsy::ProcessReadSmspListPhase1L(const TTsyReqHandle aTsyReqHandle,
|
|
657 |
RMobilePhone::TClientId* aId,
|
|
658 |
TInt* aBufSize)
|
|
659 |
{
|
|
660 |
// read the list, store its content and then return size of this buffer to client
|
|
661 |
CMobilePhoneSmspList* list=CMobilePhoneSmspList::NewL();
|
|
662 |
CleanupStack::PushL(list);
|
|
663 |
|
|
664 |
RMobileSmsMessaging::TMobileSmspEntryV1 entry;
|
|
665 |
|
|
666 |
// fill up an example list
|
|
667 |
for (TInt index=0; index < DMMTSY_SMSP_STORE_COUNT; index++)
|
|
668 |
{
|
|
669 |
switch (index)
|
|
670 |
{
|
|
671 |
case 0:
|
|
672 |
InitSmspEntry(entry);
|
|
673 |
|
|
674 |
entry.iIndex=DMMTSY_SMSP_STORE_INDEX1;
|
|
675 |
break;
|
|
676 |
case 1:
|
|
677 |
InitSmspEntry(entry);
|
|
678 |
|
|
679 |
entry.iIndex=DMMTSY_SMSP_STORE_INDEX2;
|
|
680 |
default:
|
|
681 |
break;
|
|
682 |
}
|
|
683 |
// Add the entry into the list, at the next empty location
|
|
684 |
list->AddEntryL(entry);
|
|
685 |
}
|
|
686 |
|
|
687 |
// Store the streamed list and the client ID
|
|
688 |
CListReadAllAttempt* read=CListReadAllAttempt::NewL(aId,aTsyReqHandle);
|
|
689 |
CleanupStack::PushL(read);
|
|
690 |
|
|
691 |
read->iListBuf = list->StoreLC();
|
|
692 |
CleanupStack::Pop(); // pop the CBufFlat allocated by StoreLC
|
|
693 |
|
|
694 |
iSmspReadAll->AppendL(read);
|
|
695 |
CleanupStack::Pop(); // pop the CListReadAllAttempt
|
|
696 |
|
|
697 |
// return the CBufFlat’s size to client
|
|
698 |
*aBufSize=(read->iListBuf)->Size();
|
|
699 |
|
|
700 |
// Complete first phase of list retrieval
|
|
701 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
702 |
CleanupStack::PopAndDestroy(); // pop&destroy list
|
|
703 |
return KErrNone;
|
|
704 |
}
|
|
705 |
|
|
706 |
|
|
707 |
TInt CSmsMessagingDMmTsy::ReadSmspListPhase2(TTsyReqHandle aTsyReqHandle, RMobilePhone::TClientId* aId, TDes8* aBuffer)
|
|
708 |
{
|
|
709 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::ReadSmspListPhase2 called"));
|
|
710 |
CListReadAllAttempt* read=NULL;
|
|
711 |
// Find the read attempt from this client
|
|
712 |
for (TInt i=0; i<iSmspReadAll->Count(); ++i)
|
|
713 |
{
|
|
714 |
read = iSmspReadAll->At(i);
|
|
715 |
if ((read->iClient.iSessionHandle==aId->iSessionHandle) &&
|
|
716 |
(read->iClient.iSubSessionHandle==aId->iSubSessionHandle))
|
|
717 |
{
|
|
718 |
TPtr8 bufPtr((read->iListBuf)->Ptr(0));
|
|
719 |
// Copy the streamed list to the client
|
|
720 |
aBuffer->Copy(bufPtr);
|
|
721 |
delete read;
|
|
722 |
iSmspReadAll->Delete(i);
|
|
723 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
724 |
return KErrNone;
|
|
725 |
}
|
|
726 |
}
|
|
727 |
// Should handle error case of not finding the matching client from read all phase 1
|
|
728 |
return KErrNotFound;
|
|
729 |
}
|
|
730 |
|
|
731 |
|
|
732 |
TInt CSmsMessagingDMmTsy::ReadSmspListCancel(const TTsyReqHandle aTsyReqHandle)
|
|
733 |
{
|
|
734 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::ReadSmspListCancel called"));
|
|
735 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
736 |
|
|
737 |
// Remove the read all attempt from iSmspReadAll
|
|
738 |
CListReadAllAttempt* read=NULL;
|
|
739 |
for (TInt i=0; i<iSmspReadAll->Count(); ++i)
|
|
740 |
{
|
|
741 |
read = iSmspReadAll->At(i);
|
|
742 |
if (read->iReqHandle == aTsyReqHandle)
|
|
743 |
{
|
|
744 |
delete read;
|
|
745 |
iSmspReadAll->Delete(i);
|
|
746 |
break;
|
|
747 |
}
|
|
748 |
}
|
|
749 |
|
|
750 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
751 |
return KErrNone;
|
|
752 |
}
|
|
753 |
|
|
754 |
TInt CSmsMessagingDMmTsy::StoreSmspList(const TTsyReqHandle aTsyReqHandle, TDes8* aBuffer)
|
|
755 |
{
|
|
756 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::StoreSmspList called"));
|
|
757 |
TInt ret=KErrNone;
|
|
758 |
TInt leaveCode=KErrNone;
|
|
759 |
TRAP(leaveCode, ret=ProcessStoreSmspListL(aTsyReqHandle, aBuffer););
|
|
760 |
if (leaveCode != KErrNone)
|
|
761 |
ReqCompleted(aTsyReqHandle,leaveCode);
|
|
762 |
return ret;
|
|
763 |
};
|
|
764 |
|
|
765 |
TInt CSmsMessagingDMmTsy::ProcessStoreSmspListL(TTsyReqHandle aTsyReqHandle, TDes8* aBuffer)
|
|
766 |
{
|
|
767 |
CMobilePhoneSmspList* aSmspList=CMobilePhoneSmspList::NewL();
|
|
768 |
CleanupStack::PushL(aSmspList);
|
|
769 |
|
|
770 |
aSmspList->RestoreL(*aBuffer);
|
|
771 |
|
|
772 |
RMobileSmsMessaging::TMobileSmspEntryV1 entry;
|
|
773 |
|
|
774 |
if (aSmspList->Enumerate() != DMMTSY_SMSP_STORE_COUNT)
|
|
775 |
{
|
|
776 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
777 |
return KErrNone;
|
|
778 |
}
|
|
779 |
|
|
780 |
entry=aSmspList->GetEntryL(0);
|
|
781 |
|
|
782 |
if ((entry.iIndex != DMMTSY_SMSP_STORE_INDEX1) ||
|
|
783 |
(ValidateSmspEntry(entry) != KErrNone))
|
|
784 |
{
|
|
785 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
786 |
return KErrNone;
|
|
787 |
}
|
|
788 |
|
|
789 |
entry=aSmspList->GetEntryL(1);
|
|
790 |
|
|
791 |
if ((entry.iIndex != DMMTSY_SMSP_STORE_INDEX2) ||
|
|
792 |
(ValidateSmspEntry(entry) != KErrNone))
|
|
793 |
{
|
|
794 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
795 |
return KErrNone;
|
|
796 |
}
|
|
797 |
|
|
798 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
799 |
CleanupStack::PopAndDestroy(); // aSmspList
|
|
800 |
return KErrNone;
|
|
801 |
}
|
|
802 |
|
|
803 |
TInt CSmsMessagingDMmTsy::StoreSmspListCancel(TTsyReqHandle aTsyReqHandle)
|
|
804 |
{
|
|
805 |
LOGTEXT(_L8("CSmspStoreDMmTsy::StoreSmspListCancel called"));
|
|
806 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
807 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
808 |
return KErrNone;
|
|
809 |
}
|
|
810 |
|
|
811 |
TInt CSmsMessagingDMmTsy::NotifySmspListChange(const TTsyReqHandle aTsyReqHandle)
|
|
812 |
{
|
|
813 |
if (!iNotifySmspListChange++)
|
|
814 |
{
|
|
815 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::NotifySmspListChange called"));
|
|
816 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
817 |
}
|
|
818 |
return KErrNone;
|
|
819 |
}
|
|
820 |
|
|
821 |
TInt CSmsMessagingDMmTsy::NotifySmspListChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
822 |
{
|
|
823 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::NotifySmspListChangeCancel called"));
|
|
824 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
825 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
826 |
return KErrNone;
|
|
827 |
}
|
|
828 |
|
|
829 |
|
|
830 |
TInt CSmsMessagingDMmTsy::GetReceiveMode(const TTsyReqHandle aTsyReqHandle, RMobileSmsMessaging::TMobileSmsReceiveMode* aReceiveMode)
|
|
831 |
{
|
|
832 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::GetReceiveMode called"));
|
|
833 |
*aReceiveMode=DMMTSY_SMS_MESSAGING_RECEIVE_MODE1;
|
|
834 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
835 |
return KErrNone;
|
|
836 |
}
|
|
837 |
|
|
838 |
TInt CSmsMessagingDMmTsy::SetReceiveMode(const TTsyReqHandle aTsyReqHandle, RMobileSmsMessaging::TMobileSmsReceiveMode* aReceiveMode)
|
|
839 |
{
|
|
840 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::SetReceiveMode called"));
|
|
841 |
if ( *aReceiveMode != DMMTSY_SMS_MESSAGING_RECEIVE_MODE1 )
|
|
842 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
843 |
else
|
|
844 |
{
|
|
845 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
846 |
}
|
|
847 |
return KErrNone;
|
|
848 |
}
|
|
849 |
|
|
850 |
TInt CSmsMessagingDMmTsy::SetReceiveModeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
851 |
{
|
|
852 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::SetReceiveModeCancel called"));
|
|
853 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
854 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
855 |
return KErrNone;
|
|
856 |
}
|
|
857 |
|
|
858 |
TInt CSmsMessagingDMmTsy::NotifyReceiveModeChange(const TTsyReqHandle aTsyReqHandle, RMobileSmsMessaging::TMobileSmsReceiveMode* aReceiveMode)
|
|
859 |
{
|
|
860 |
if (!iNotifyReceiveModeChange++)
|
|
861 |
{
|
|
862 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::NotifyReceiveModeChange called"));
|
|
863 |
*aReceiveMode=DMMTSY_SMS_MESSAGING_RECEIVE_MODE2;
|
|
864 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
865 |
}
|
|
866 |
return KErrNone;
|
|
867 |
}
|
|
868 |
|
|
869 |
TInt CSmsMessagingDMmTsy::NotifyReceiveModeChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
870 |
{
|
|
871 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::NotifyReceiveModeChangeCancel called"));
|
|
872 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
873 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
874 |
return KErrNone;
|
|
875 |
}
|
|
876 |
|
|
877 |
TInt CSmsMessagingDMmTsy::GetMoSmsBearer(const TTsyReqHandle aTsyReqHandle, RMobileSmsMessaging::TMobileSmsBearer* aBearer)
|
|
878 |
{
|
|
879 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::GetMoSmsBearer called"));
|
|
880 |
*aBearer=DMMTSY_SMS_MESSAGING_BEARER1;
|
|
881 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
882 |
return KErrNone;
|
|
883 |
}
|
|
884 |
|
|
885 |
TInt CSmsMessagingDMmTsy::SetMoSmsBearer(const TTsyReqHandle aTsyReqHandle, RMobileSmsMessaging::TMobileSmsBearer* aBearer)
|
|
886 |
{
|
|
887 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::SetMoSmsBearer called"));
|
|
888 |
if ( *aBearer != DMMTSY_SMS_MESSAGING_BEARER1 )
|
|
889 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
890 |
else
|
|
891 |
{
|
|
892 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
893 |
}
|
|
894 |
return KErrNone;
|
|
895 |
}
|
|
896 |
|
|
897 |
TInt CSmsMessagingDMmTsy::SetMoSmsBearerCancel(const TTsyReqHandle aTsyReqHandle)
|
|
898 |
{
|
|
899 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::SetMoSmsBearerCancel called"));
|
|
900 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
901 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
902 |
return KErrNone;
|
|
903 |
}
|
|
904 |
|
|
905 |
TInt CSmsMessagingDMmTsy::NotifyMoSmsBearerChange(const TTsyReqHandle aTsyReqHandle, RMobileSmsMessaging::TMobileSmsBearer* aBearer)
|
|
906 |
{
|
|
907 |
if (!iNotifyMoSmsBearerChange++)
|
|
908 |
{
|
|
909 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::NotifyMoSmsBearerChange called"));
|
|
910 |
*aBearer=DMMTSY_SMS_MESSAGING_BEARER2;
|
|
911 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
912 |
}
|
|
913 |
return KErrNone;
|
|
914 |
}
|
|
915 |
|
|
916 |
TInt CSmsMessagingDMmTsy::NotifyMoSmsBearerChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
917 |
{
|
|
918 |
LOGTEXT(_L8("CSmsMessagingDMmTsy::NotifyMoSmsBearerChangeCancel called"));
|
|
919 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
920 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
921 |
return KErrNone;
|
|
922 |
}
|
|
923 |
|
|
924 |
/**************************************************************************/
|
|
925 |
//
|
|
926 |
// CBroadcastMessagingDMmTsy
|
|
927 |
//
|
|
928 |
/**************************************************************************/
|
|
929 |
|
|
930 |
CBroadcastMessagingDMmTsy* CBroadcastMessagingDMmTsy::NewL(CPhoneDMmTsy *aPhone, CPhoneFactoryDummyBase* aFac, const TDesC& aName)
|
|
931 |
{
|
|
932 |
CBroadcastMessagingDMmTsy* subsession=new(ELeave) CBroadcastMessagingDMmTsy(aPhone,aFac,aName);
|
|
933 |
CleanupStack::PushL(subsession);
|
|
934 |
subsession->ConstructL();
|
|
935 |
CleanupStack::Pop();
|
|
936 |
return subsession;
|
|
937 |
}
|
|
938 |
|
|
939 |
void CBroadcastMessagingDMmTsy::Init()
|
|
940 |
{}
|
|
941 |
|
|
942 |
CBroadcastMessagingDMmTsy::CBroadcastMessagingDMmTsy(CPhoneDMmTsy *aPhone, CPhoneFactoryDummyBase* aFac, const TDesC& aName)
|
|
943 |
:CSubSessionExtDummyBase(aFac), iPhone(aPhone), iCbmiListRequests(NULL)
|
|
944 |
{
|
|
945 |
iMessagingName=aName;
|
|
946 |
}
|
|
947 |
|
|
948 |
void CBroadcastMessagingDMmTsy::ConstructL()
|
|
949 |
{
|
|
950 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy created"));
|
|
951 |
iCbmiListRequests = new (ELeave) CArrayPtrFlat<CListReadAllAttempt>(16);
|
|
952 |
}
|
|
953 |
|
|
954 |
CBroadcastMessagingDMmTsy::~CBroadcastMessagingDMmTsy()
|
|
955 |
{
|
|
956 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy destroyed"));
|
|
957 |
iCbmiListRequests->ResetAndDestroy();
|
|
958 |
delete iCbmiListRequests;
|
|
959 |
}
|
|
960 |
|
|
961 |
CTelObject* CBroadcastMessagingDMmTsy::OpenNewObjectByNameL(const TDesC& /*aName*/)
|
|
962 |
{
|
|
963 |
// Broadcast related stores can be opened from a Broadcast messaging sub-session
|
|
964 |
|
|
965 |
|
|
966 |
return NULL;
|
|
967 |
}
|
|
968 |
|
|
969 |
CTelObject* CBroadcastMessagingDMmTsy::OpenNewObjectL(TDes&)
|
|
970 |
{
|
|
971 |
User::Leave(KErrNotSupported);
|
|
972 |
return NULL;
|
|
973 |
}
|
|
974 |
|
|
975 |
CTelObject::TReqMode CBroadcastMessagingDMmTsy::ReqModeL(const TInt aIpc)
|
|
976 |
{
|
|
977 |
CTelObject::TReqMode ret=0;
|
|
978 |
switch (aIpc)
|
|
979 |
{
|
|
980 |
//
|
|
981 |
// Non-Flow Controlled Services
|
|
982 |
//
|
|
983 |
case EMobileBroadcastMessagingGetFilterSetting:
|
|
984 |
case EMobileBroadcastMessagingGetCaps:
|
|
985 |
case EMobileBroadcastMessagingGetLanguageFilter:
|
|
986 |
case EMobileBroadcastMessagingSetLanguageFilter:
|
|
987 |
case EMobileBroadcastMessagingGetIdListPhase1:
|
|
988 |
case EMobileBroadcastMessagingGetIdListPhase2:
|
|
989 |
case EMobileBroadcastMessagingStoreIdList:
|
|
990 |
break;
|
|
991 |
|
|
992 |
//
|
|
993 |
// Flow Controlled Services
|
|
994 |
//
|
|
995 |
case EMobileBroadcastMessagingSetFilterSetting:
|
|
996 |
ret=KReqModeFlowControlObeyed;
|
|
997 |
break;
|
|
998 |
|
|
999 |
//
|
|
1000 |
// Multiple Completion Services with Immediate Server Repost
|
|
1001 |
// (Usually Notifications)
|
|
1002 |
//
|
|
1003 |
case EMobileBroadcastMessagingReceiveMessage:
|
|
1004 |
case EMobileBroadcastMessagingNotifyFilterSettingChange:
|
|
1005 |
case EMobileBroadcastMessagingNotifyLanguageFilterChange:
|
|
1006 |
case EMobileBroadcastMessagingNotifyIdListChange:
|
|
1007 |
ret=KReqModeMultipleCompletionEnabled | KReqModeRePostImmediately;
|
|
1008 |
break;
|
|
1009 |
//
|
|
1010 |
// Cancel Requests
|
|
1011 |
//
|
|
1012 |
case EMobileBroadcastMessagingReceiveMessageCancel:
|
|
1013 |
case EMobileBroadcastMessagingNotifyFilterSettingChangeCancel:
|
|
1014 |
case EMobileBroadcastMessagingSetFilterSettingCancel:
|
|
1015 |
case EMobileBroadcastMessagingGetLanguageFilterCancel:
|
|
1016 |
case EMobileBroadcastMessagingSetLanguageFilterCancel:
|
|
1017 |
case EMobileBroadcastMessagingNotifyLanguageFilterChangeCancel:
|
|
1018 |
case EMobileBroadcastMessagingGetIdListCancel:
|
|
1019 |
case EMobileBroadcastMessagingStoreIdListCancel:
|
|
1020 |
case EMobileBroadcastMessagingNotifyIdListChangeCancel:
|
|
1021 |
default:
|
|
1022 |
User::Leave(KErrNotSupported);
|
|
1023 |
break;
|
|
1024 |
}
|
|
1025 |
|
|
1026 |
return ret;
|
|
1027 |
}
|
|
1028 |
|
|
1029 |
TInt CBroadcastMessagingDMmTsy::RegisterNotification(const TInt aIpc)
|
|
1030 |
{
|
|
1031 |
switch (aIpc)
|
|
1032 |
{
|
|
1033 |
case EMobileBroadcastMessagingReceiveMessage:
|
|
1034 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: RegisterNotification - Receive Message"));
|
|
1035 |
return KErrNone;
|
|
1036 |
case EMobileBroadcastMessagingNotifyFilterSettingChange:
|
|
1037 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: RegisterNotification - Receive setting Change "));
|
|
1038 |
return KErrNone;
|
|
1039 |
case EMobileBroadcastMessagingNotifyLanguageFilterChange:
|
|
1040 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: RegisterNotification - Language Filter Change "));
|
|
1041 |
return KErrNone;
|
|
1042 |
case EMobileBroadcastMessagingNotifyIdListChange:
|
|
1043 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: RegisterNotification - Notify BroadcastId List Change"));
|
|
1044 |
return KErrNone;
|
|
1045 |
default:
|
|
1046 |
// Unknown or invalid IPC
|
|
1047 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: Register error, unknown IPC"));
|
|
1048 |
return KErrNotSupported;
|
|
1049 |
}
|
|
1050 |
}
|
|
1051 |
|
|
1052 |
TInt CBroadcastMessagingDMmTsy::DeregisterNotification(const TInt aIpc)
|
|
1053 |
{
|
|
1054 |
switch (aIpc)
|
|
1055 |
{
|
|
1056 |
case EMobileBroadcastMessagingReceiveMessage:
|
|
1057 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: DeregisterNotification - Receive Message"));
|
|
1058 |
return KErrNone;
|
|
1059 |
case EMobileBroadcastMessagingNotifyFilterSettingChange:
|
|
1060 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: DeregisterNotification - Receive setting Change "));
|
|
1061 |
return KErrNone;
|
|
1062 |
case EMobileBroadcastMessagingNotifyLanguageFilterChange:
|
|
1063 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: DeregisterNotification - Language Filter Change "));
|
|
1064 |
return KErrNone;
|
|
1065 |
case EMobileBroadcastMessagingNotifyIdListChange:
|
|
1066 |
LOGTEXT(_L8("CSmsMessagingDMmTsy: DeregisterNotification - Notify BroadcastId List Change"));
|
|
1067 |
return KErrNone;
|
|
1068 |
default:
|
|
1069 |
// Unknown or invalid IPC
|
|
1070 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: Deregister error, unknown IPC"));
|
|
1071 |
return KErrNotSupported;
|
|
1072 |
}
|
|
1073 |
}
|
|
1074 |
|
|
1075 |
TInt CBroadcastMessagingDMmTsy::NumberOfSlotsL(const TInt aIpc)
|
|
1076 |
{
|
|
1077 |
TInt numberOfSlots=1;
|
|
1078 |
switch (aIpc)
|
|
1079 |
{
|
|
1080 |
case EMobileBroadcastMessagingReceiveMessage:
|
|
1081 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: Registered with 10 slots"));
|
|
1082 |
numberOfSlots=10;
|
|
1083 |
break;
|
|
1084 |
case EMobileBroadcastMessagingNotifyFilterSettingChange:
|
|
1085 |
case EMobileBroadcastMessagingNotifyLanguageFilterChange:
|
|
1086 |
case EMobileBroadcastMessagingNotifyIdListChange:
|
|
1087 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: Registered with 2 slots"));
|
|
1088 |
numberOfSlots=2;
|
|
1089 |
break;
|
|
1090 |
default:
|
|
1091 |
// Unknown or invalid Phone IPC
|
|
1092 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: Number of Slots error, unknown IPC"));
|
|
1093 |
User::Leave(KErrNotSupported);
|
|
1094 |
break;
|
|
1095 |
}
|
|
1096 |
return numberOfSlots;
|
|
1097 |
}
|
|
1098 |
|
|
1099 |
|
|
1100 |
TInt CBroadcastMessagingDMmTsy::ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,
|
|
1101 |
const TDataPackage& aPackage)
|
|
1102 |
{
|
|
1103 |
TInt err;
|
|
1104 |
TAny* dataPtr=aPackage.Ptr1();
|
|
1105 |
TAny* dataPtr2=aPackage.Ptr2();
|
|
1106 |
|
|
1107 |
switch (aIpc)
|
|
1108 |
{
|
|
1109 |
case EMobileBroadcastMessagingGetCaps:
|
|
1110 |
return GetCaps(aTsyReqHandle, aPackage.Des1n());
|
|
1111 |
|
|
1112 |
case EMobileBroadcastMessagingGetFilterSetting:
|
|
1113 |
return GetFilterSetting(aTsyReqHandle,
|
|
1114 |
REINTERPRET_CAST(RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter*, dataPtr));
|
|
1115 |
|
|
1116 |
case EMobileBroadcastMessagingSetFilterSetting:
|
|
1117 |
return SetFilterSetting(aTsyReqHandle,
|
|
1118 |
REINTERPRET_CAST(RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter*, dataPtr));
|
|
1119 |
|
|
1120 |
case EMobileBroadcastMessagingNotifyFilterSettingChange:
|
|
1121 |
return NotifyFilterSettingChange(aTsyReqHandle,
|
|
1122 |
REINTERPRET_CAST(RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter*, dataPtr));
|
|
1123 |
|
|
1124 |
case EMobileBroadcastMessagingReceiveMessage:
|
|
1125 |
return ReceiveMessage(aTsyReqHandle, aPackage.Des1n(), aPackage.Des2n());
|
|
1126 |
|
|
1127 |
case EMobileBroadcastMessagingGetLanguageFilter:
|
|
1128 |
return GetLanguageFilter(aTsyReqHandle, aPackage.Des1u());
|
|
1129 |
|
|
1130 |
case EMobileBroadcastMessagingNotifyLanguageFilterChange:
|
|
1131 |
return NotifyLanguageFilterChange(aTsyReqHandle, aPackage.Des1u());
|
|
1132 |
|
|
1133 |
case EMobileBroadcastMessagingSetLanguageFilter:
|
|
1134 |
return SetLanguageFilter(aTsyReqHandle, aPackage.Des1u());
|
|
1135 |
|
|
1136 |
case EMobileBroadcastMessagingReceiveMessageCancel:
|
|
1137 |
return ReceiveMessageCancel(aTsyReqHandle);
|
|
1138 |
case EMobileBroadcastMessagingNotifyFilterSettingChangeCancel:
|
|
1139 |
return NotifyFilterSettingChangeCancel(aTsyReqHandle);
|
|
1140 |
case EMobileBroadcastMessagingSetFilterSettingCancel:
|
|
1141 |
return SetFilterSettingCancel(aTsyReqHandle);
|
|
1142 |
|
|
1143 |
case EMobileBroadcastMessagingGetIdListPhase1:
|
|
1144 |
return GetBroadcastIdListPhase1(aTsyReqHandle,
|
|
1145 |
REINTERPRET_CAST(CRetrieveMobilePhoneBroadcastIdList::TGetBroadcastIdRequest*, dataPtr),
|
|
1146 |
REINTERPRET_CAST(TInt*, dataPtr2));
|
|
1147 |
case EMobileBroadcastMessagingGetIdListPhase2:
|
|
1148 |
return GetBroadcastIdListPhase2(aTsyReqHandle,
|
|
1149 |
REINTERPRET_CAST(RMobilePhone::TClientId*, dataPtr),
|
|
1150 |
aPackage.Des2n());
|
|
1151 |
case EMobileBroadcastMessagingStoreIdList:
|
|
1152 |
{
|
|
1153 |
TRAP(err,StoreBroadcastIdListL(aTsyReqHandle,aPackage.Des1n()));
|
|
1154 |
if (err != KErrNone)
|
|
1155 |
ReqCompleted(aTsyReqHandle,err);
|
|
1156 |
return KErrNone;
|
|
1157 |
}
|
|
1158 |
case EMobileBroadcastMessagingNotifyIdListChange:
|
|
1159 |
return NotifyBroadcastIdListChange(aTsyReqHandle);
|
|
1160 |
default:
|
|
1161 |
return KErrNotSupported;
|
|
1162 |
}
|
|
1163 |
}
|
|
1164 |
|
|
1165 |
TInt CBroadcastMessagingDMmTsy::CancelService(const TInt aIpc,const TTsyReqHandle aTsyReqHandle)
|
|
1166 |
{
|
|
1167 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy: - CancelService called"));
|
|
1168 |
switch (aIpc)
|
|
1169 |
{
|
|
1170 |
case EMobileBroadcastMessagingReceiveMessage:
|
|
1171 |
return ReceiveMessageCancel(aTsyReqHandle);
|
|
1172 |
case EMobileBroadcastMessagingNotifyFilterSettingChange:
|
|
1173 |
return NotifyFilterSettingChangeCancel(aTsyReqHandle);
|
|
1174 |
case EMobileBroadcastMessagingSetFilterSetting:
|
|
1175 |
return SetFilterSettingCancel(aTsyReqHandle);
|
|
1176 |
case EMobileBroadcastMessagingGetLanguageFilter:
|
|
1177 |
return GetLanguageFilterCancel(aTsyReqHandle);
|
|
1178 |
case EMobileBroadcastMessagingSetLanguageFilter:
|
|
1179 |
return SetLanguageFilterCancel(aTsyReqHandle);
|
|
1180 |
case EMobileBroadcastMessagingNotifyLanguageFilterChange:
|
|
1181 |
return NotifyLanguageFilterChangeCancel(aTsyReqHandle);
|
|
1182 |
case EMobileBroadcastMessagingGetIdListPhase1:
|
|
1183 |
case EMobileBroadcastMessagingGetIdListPhase2:
|
|
1184 |
return GetBroadcastIdListCancel(aTsyReqHandle);
|
|
1185 |
case EMobileBroadcastMessagingStoreIdList:
|
|
1186 |
return StoreBroadcastIdListCancel(aTsyReqHandle);
|
|
1187 |
case EMobileBroadcastMessagingNotifyIdListChange:
|
|
1188 |
return NotifyBroadcastIdListChangeCancel(aTsyReqHandle);
|
|
1189 |
default:
|
|
1190 |
return KErrGeneral;
|
|
1191 |
}
|
|
1192 |
}
|
|
1193 |
|
|
1194 |
|
|
1195 |
TInt CBroadcastMessagingDMmTsy::GetCaps(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps)
|
|
1196 |
{
|
|
1197 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::GetCaps called"));
|
|
1198 |
RMobileBroadcastMessaging::TMobileBroadcastCapsV1Pckg* cbsCapsPckg = (RMobileBroadcastMessaging::TMobileBroadcastCapsV1Pckg*)aCaps;
|
|
1199 |
RMobileBroadcastMessaging::TMobileBroadcastCapsV1& cbsCaps = (*cbsCapsPckg)();
|
|
1200 |
|
|
1201 |
cbsCaps.iModeCaps=DMMTSY_BROADCAST_MESSAGING_MODE_CAPS;
|
|
1202 |
cbsCaps.iFilterCaps=DMMTSY_BROADCAST_MESSAGING_FILTER_CAPS;
|
|
1203 |
|
|
1204 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1205 |
return KErrNone;
|
|
1206 |
}
|
|
1207 |
|
|
1208 |
TInt CBroadcastMessagingDMmTsy::ReceiveMessage(const TTsyReqHandle aTsyReqHandle, TDes8* aMsgData, TDes8* aMsgAtts)
|
|
1209 |
{
|
|
1210 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::ReceiveMessage called"));
|
|
1211 |
|
|
1212 |
RMobileBroadcastMessaging::TMobileBroadcastAttributesV1Pckg* attsPckg = REINTERPRET_CAST(RMobileBroadcastMessaging::TMobileBroadcastAttributesV1Pckg*, aMsgAtts);
|
|
1213 |
RMobileBroadcastMessaging::TMobileBroadcastAttributesV1 &atts = (*attsPckg)();
|
|
1214 |
|
|
1215 |
if(atts.ExtensionId()==KETelExtMultimodeV2)
|
|
1216 |
{
|
|
1217 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::ReceiveMessage is using V2 attributes"));
|
|
1218 |
|
|
1219 |
RMobileBroadcastMessaging::TMobileBroadcastAttributesV2Pckg* attsV2Pckg = REINTERPRET_CAST(RMobileBroadcastMessaging::TMobileBroadcastAttributesV2Pckg*, aMsgAtts);
|
|
1220 |
RMobileBroadcastMessaging::TMobileBroadcastAttributesV2 &attsV2 = (*attsV2Pckg)();
|
|
1221 |
|
|
1222 |
attsV2.iFormat = DMMTSY_CBS_MESSAGE_PDU_FORMAT;
|
|
1223 |
attsV2.iFlags = DMMTSY_BROADCAST_MESSAGING_ATT_FLAGS;
|
|
1224 |
attsV2.iDCS = DMMTSY_BROADCAST_MESSAGING_ATT_DCS;
|
|
1225 |
attsV2.iMessageId = DMMTSY_BROADCAST_MESSAGING_ATT_MSGID;
|
|
1226 |
attsV2.iMessageType =DMMTSY_BROADCAST_MESSAGING_ATT_MSGTYPE;
|
|
1227 |
attsV2.iNumberOfPages = DMMTSY_BROADCAST_MESSAGING_ATT_NUMOFPAGES;
|
|
1228 |
attsV2.iSerialNum = DMMTSY_BROADCAST_MESSAGING_ATT_SERIAL;
|
|
1229 |
|
|
1230 |
*aMsgData = DMMTSY_CBS_MESSAGE_PDU;
|
|
1231 |
}
|
|
1232 |
else if(atts.ExtensionId()==KETelExtMultimodeV1)
|
|
1233 |
{
|
|
1234 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::ReceiveMessage is using V1 attributes"));
|
|
1235 |
|
|
1236 |
atts.iFormat = DMMTSY_CBS_MESSAGE_PDU_FORMAT;
|
|
1237 |
atts.iFlags = DMMTSY_BROADCAST_MESSAGING_ATT_FLAGS;
|
|
1238 |
*aMsgData = DMMTSY_CBS_MESSAGE_PDU;
|
|
1239 |
}
|
|
1240 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1241 |
return KErrNone;
|
|
1242 |
}
|
|
1243 |
|
|
1244 |
TInt CBroadcastMessagingDMmTsy::ReceiveMessageCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1245 |
{
|
|
1246 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::ReceiveMessageCancel called"));
|
|
1247 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1248 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1249 |
return KErrNone;
|
|
1250 |
}
|
|
1251 |
|
|
1252 |
TInt CBroadcastMessagingDMmTsy::GetFilterSetting(const TTsyReqHandle aTsyReqHandle, RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter* aSetting)
|
|
1253 |
{
|
|
1254 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::GetFilterSetting called"));
|
|
1255 |
*aSetting=DMMTSY_BROADCAST_RECEIVE_SETTING1;
|
|
1256 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1257 |
return KErrNone;
|
|
1258 |
}
|
|
1259 |
|
|
1260 |
TInt CBroadcastMessagingDMmTsy::SetFilterSetting(const TTsyReqHandle aTsyReqHandle, RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter* aSetting)
|
|
1261 |
{
|
|
1262 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::SetFilterSetting called"));
|
|
1263 |
if ( *aSetting != DMMTSY_BROADCAST_RECEIVE_SETTING2 )
|
|
1264 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
1265 |
else
|
|
1266 |
{
|
|
1267 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1268 |
}
|
|
1269 |
return KErrNone;
|
|
1270 |
}
|
|
1271 |
|
|
1272 |
TInt CBroadcastMessagingDMmTsy::SetFilterSettingCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1273 |
{
|
|
1274 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::SetFilterSettingCancel called"));
|
|
1275 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1276 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1277 |
return KErrNone;
|
|
1278 |
}
|
|
1279 |
|
|
1280 |
TInt CBroadcastMessagingDMmTsy::NotifyFilterSettingChange(const TTsyReqHandle aTsyReqHandle, RMobileBroadcastMessaging::TMobilePhoneBroadcastFilter* aSetting)
|
|
1281 |
{
|
|
1282 |
if (!iNotifyFilterSettingChange++)
|
|
1283 |
{
|
|
1284 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::NotifyFilterSettingChange called"));
|
|
1285 |
*aSetting=DMMTSY_BROADCAST_RECEIVE_SETTING2;
|
|
1286 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1287 |
}
|
|
1288 |
return KErrNone;
|
|
1289 |
}
|
|
1290 |
|
|
1291 |
TInt CBroadcastMessagingDMmTsy::NotifyFilterSettingChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1292 |
{
|
|
1293 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::NotifyFilterSettingChangeCancel called"));
|
|
1294 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1295 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1296 |
return KErrNone;
|
|
1297 |
}
|
|
1298 |
|
|
1299 |
TInt CBroadcastMessagingDMmTsy::GetLanguageFilter(const TTsyReqHandle aTsyReqHandle, TDes16* aLangFilter)
|
|
1300 |
{
|
|
1301 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::GetLanguageFilter called"));
|
|
1302 |
*aLangFilter = DMMTSY_CBS_MESSAGE_LANGUAGE_FILTER;
|
|
1303 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1304 |
return KErrNone;
|
|
1305 |
}
|
|
1306 |
|
|
1307 |
TInt CBroadcastMessagingDMmTsy::GetLanguageFilterCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1308 |
{
|
|
1309 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::GetLanguageFilterCancel called"));
|
|
1310 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1311 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1312 |
return KErrNone;
|
|
1313 |
}
|
|
1314 |
|
|
1315 |
TInt CBroadcastMessagingDMmTsy::SetLanguageFilter(const TTsyReqHandle aTsyReqHandle, TDesC16* aLangFilter)
|
|
1316 |
{
|
|
1317 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::SetLanguageFilter called"));
|
|
1318 |
if (aLangFilter->Compare(DMMTSY_CBS_MESSAGE_LANGUAGE_FILTER) != 0)
|
|
1319 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
1320 |
else
|
|
1321 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1322 |
return KErrNone;
|
|
1323 |
}
|
|
1324 |
|
|
1325 |
TInt CBroadcastMessagingDMmTsy::SetLanguageFilterCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1326 |
{
|
|
1327 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::SetLanguageFilterCancel called"));
|
|
1328 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1329 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1330 |
return KErrNone;
|
|
1331 |
}
|
|
1332 |
|
|
1333 |
TInt CBroadcastMessagingDMmTsy::NotifyLanguageFilterChange(const TTsyReqHandle aTsyReqHandle, TDes16* aLangFilter)
|
|
1334 |
{
|
|
1335 |
if (!iNotifyLanguageFilterChange++)
|
|
1336 |
{
|
|
1337 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::NotifyLanguageFilterChange called"));
|
|
1338 |
*aLangFilter = DMMTSY_CBS_MESSAGE_LANGUAGE_FILTER;
|
|
1339 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1340 |
}
|
|
1341 |
return KErrNone;
|
|
1342 |
}
|
|
1343 |
|
|
1344 |
TInt CBroadcastMessagingDMmTsy::NotifyLanguageFilterChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1345 |
{
|
|
1346 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::NotifyLanguageFilterChangeCancel called"));
|
|
1347 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1348 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1349 |
return KErrNone;
|
|
1350 |
}
|
|
1351 |
|
|
1352 |
TInt CBroadcastMessagingDMmTsy::GetBroadcastIdListPhase1(const TTsyReqHandle aTsyReqHandle, CRetrieveMobilePhoneBroadcastIdList::TGetBroadcastIdRequest* aReqData, TInt* aBufSize)
|
|
1353 |
{
|
|
1354 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::GetBroadcastIdListPhase1 called"));
|
|
1355 |
TInt ret=KErrNone;
|
|
1356 |
TInt leaveCode=KErrNone;
|
|
1357 |
|
|
1358 |
if (aReqData->iIdType != DMMTSY_BROADCAST_ID_TYPE)
|
|
1359 |
leaveCode = KErrCorrupt;
|
|
1360 |
|
|
1361 |
if (!leaveCode)
|
|
1362 |
TRAP(leaveCode, ret=ProcessGetBroadcastIdListPhase1L(aTsyReqHandle, &aReqData->iClient, aBufSize););
|
|
1363 |
|
|
1364 |
if (leaveCode != KErrNone)
|
|
1365 |
ReqCompleted(aTsyReqHandle,leaveCode);
|
|
1366 |
return ret;
|
|
1367 |
}
|
|
1368 |
|
|
1369 |
TInt CBroadcastMessagingDMmTsy::ProcessGetBroadcastIdListPhase1L(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TClientId* aClient, TInt* aBufSize)
|
|
1370 |
{
|
|
1371 |
CMobilePhoneBroadcastIdList* list=CMobilePhoneBroadcastIdList::NewL();
|
|
1372 |
CleanupStack::PushL(list);
|
|
1373 |
|
|
1374 |
RMobileBroadcastMessaging::TMobileBroadcastIdEntryV1 entry;
|
|
1375 |
|
|
1376 |
// fill up an example list
|
|
1377 |
for (TInt index=0; index < DMMTSY_CBMI_STORE_COUNT; index++)
|
|
1378 |
{
|
|
1379 |
switch (index)
|
|
1380 |
{
|
|
1381 |
case 0:
|
|
1382 |
entry.iId=DMMTSY_CBMI_ID1;
|
|
1383 |
break;
|
|
1384 |
case 1:
|
|
1385 |
entry.iId=DMMTSY_CBMI_ID2;
|
|
1386 |
break;
|
|
1387 |
case 2:
|
|
1388 |
entry.iId=DMMTSY_CBMI_ID3;
|
|
1389 |
break;
|
|
1390 |
}
|
|
1391 |
// Add the entry into the list, at the next empty location
|
|
1392 |
list->AddEntryL(entry);
|
|
1393 |
}
|
|
1394 |
|
|
1395 |
list->SetMaxNumberEntries(DMMTSY_CBMI_MAX_ENTRIES);
|
|
1396 |
|
|
1397 |
// Store the streamed list and the client ID
|
|
1398 |
CListReadAllAttempt* read=CListReadAllAttempt::NewL(aClient,aTsyReqHandle);
|
|
1399 |
CleanupStack::PushL(read);
|
|
1400 |
|
|
1401 |
read->iListBuf = list->StoreLC();
|
|
1402 |
CleanupStack::Pop(); // pop the CBufFlat allocated by StoreLC
|
|
1403 |
|
|
1404 |
iCbmiListRequests->AppendL(read);
|
|
1405 |
CleanupStack::Pop(); // pop the CListReadAllAttempt
|
|
1406 |
|
|
1407 |
// return the CBufFlat’s size to client
|
|
1408 |
*aBufSize=(read->iListBuf)->Size();
|
|
1409 |
|
|
1410 |
// Complete first phase of list retrieval
|
|
1411 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1412 |
CleanupStack::PopAndDestroy(); // pop&destroy list
|
|
1413 |
return KErrNone;
|
|
1414 |
}
|
|
1415 |
|
|
1416 |
TInt CBroadcastMessagingDMmTsy::GetBroadcastIdListPhase2(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TClientId* aClient, TDes8* aBuf)
|
|
1417 |
{
|
|
1418 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::GetBroadcastIdListPhase2 called"));
|
|
1419 |
CListReadAllAttempt* read=NULL;
|
|
1420 |
// Find the read attempt from this client
|
|
1421 |
for (TInt i=0; i<iCbmiListRequests->Count(); ++i)
|
|
1422 |
{
|
|
1423 |
read = iCbmiListRequests->At(i);
|
|
1424 |
if ((read->iClient.iSessionHandle==aClient->iSessionHandle) &&
|
|
1425 |
(read->iClient.iSubSessionHandle==aClient->iSubSessionHandle))
|
|
1426 |
{
|
|
1427 |
TPtr8 bufPtr((read->iListBuf)->Ptr(0));
|
|
1428 |
// Copy the streamed list to the client
|
|
1429 |
aBuf->Copy(bufPtr);
|
|
1430 |
delete read;
|
|
1431 |
iCbmiListRequests->Delete(i);
|
|
1432 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1433 |
return KErrNone;
|
|
1434 |
}
|
|
1435 |
}
|
|
1436 |
|
|
1437 |
return KErrNotFound;
|
|
1438 |
}
|
|
1439 |
|
|
1440 |
TInt CBroadcastMessagingDMmTsy::GetBroadcastIdListCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1441 |
{
|
|
1442 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::GetBroadcastIdListCancel called"));
|
|
1443 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1444 |
|
|
1445 |
// Remove the read all attempt from iCbmiListRequests
|
|
1446 |
CListReadAllAttempt* read=NULL;
|
|
1447 |
for (TInt i=0; i<iCbmiListRequests->Count(); ++i)
|
|
1448 |
{
|
|
1449 |
read = iCbmiListRequests->At(i);
|
|
1450 |
if (read->iReqHandle == aTsyReqHandle)
|
|
1451 |
{
|
|
1452 |
delete read;
|
|
1453 |
iCbmiListRequests->Delete(i);
|
|
1454 |
break;
|
|
1455 |
}
|
|
1456 |
}
|
|
1457 |
|
|
1458 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1459 |
return KErrNone;
|
|
1460 |
}
|
|
1461 |
|
|
1462 |
void CBroadcastMessagingDMmTsy::StoreBroadcastIdListL(const TTsyReqHandle aTsyReqHandle, TDes8* aList)
|
|
1463 |
{
|
|
1464 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::StoreBroadcastIdListL called"));
|
|
1465 |
|
|
1466 |
TInt i;
|
|
1467 |
CMobilePhoneBroadcastIdList* list=CMobilePhoneBroadcastIdList::NewL();
|
|
1468 |
CleanupStack::PushL(list);
|
|
1469 |
list->RestoreL(*aList);
|
|
1470 |
if (list->Enumerate() != DMMTSY_CBMI_STORE_COUNT)
|
|
1471 |
User::Leave(KErrCorrupt);
|
|
1472 |
|
|
1473 |
for (i = 0; i < list->Enumerate() && list->GetEntryL(i).iId == DMMTSY_CBMI_ID1; i++)
|
|
1474 |
{
|
|
1475 |
}
|
|
1476 |
if (i != list->Enumerate())
|
|
1477 |
User::Leave(KErrCorrupt);
|
|
1478 |
|
|
1479 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1480 |
|
|
1481 |
CleanupStack::PopAndDestroy(); // list
|
|
1482 |
}
|
|
1483 |
|
|
1484 |
TInt CBroadcastMessagingDMmTsy::StoreBroadcastIdListCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1485 |
{
|
|
1486 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::StoreBroadcastIdListCancel called"));
|
|
1487 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1488 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1489 |
return KErrNone;
|
|
1490 |
}
|
|
1491 |
|
|
1492 |
TInt CBroadcastMessagingDMmTsy::NotifyBroadcastIdListChange(const TTsyReqHandle aTsyReqHandle)
|
|
1493 |
{
|
|
1494 |
if (!iNotifyBroadcastIdListChange++)
|
|
1495 |
{
|
|
1496 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::NotifyBroadcastIdListChange called"));
|
|
1497 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1498 |
}
|
|
1499 |
return KErrNone;
|
|
1500 |
}
|
|
1501 |
|
|
1502 |
TInt CBroadcastMessagingDMmTsy::NotifyBroadcastIdListChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1503 |
{
|
|
1504 |
LOGTEXT(_L8("CBroadcastMessagingDMmTsy::NotifyBroadcastIdListChangeCancel called"));
|
|
1505 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1506 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1507 |
return KErrNone;
|
|
1508 |
}
|
|
1509 |
|
|
1510 |
|
|
1511 |
|
|
1512 |
/**************************************************************************/
|
|
1513 |
//
|
|
1514 |
// CUssdMessagingDMmTsy
|
|
1515 |
//
|
|
1516 |
/**************************************************************************/
|
|
1517 |
|
|
1518 |
CUssdMessagingDMmTsy* CUssdMessagingDMmTsy::NewL(CPhoneDMmTsy *aPhone, CPhoneFactoryDummyBase* aFac, const TDesC& aName)
|
|
1519 |
{
|
|
1520 |
CUssdMessagingDMmTsy* subsession=new(ELeave) CUssdMessagingDMmTsy(aPhone,aFac,aName);
|
|
1521 |
CleanupStack::PushL(subsession);
|
|
1522 |
subsession->ConstructL();
|
|
1523 |
CleanupStack::Pop();
|
|
1524 |
return subsession;
|
|
1525 |
}
|
|
1526 |
|
|
1527 |
void CUssdMessagingDMmTsy::Init()
|
|
1528 |
{}
|
|
1529 |
|
|
1530 |
CUssdMessagingDMmTsy::CUssdMessagingDMmTsy(CPhoneDMmTsy *aPhone, CPhoneFactoryDummyBase* aFac, const TDesC& aName)
|
|
1531 |
:CSubSessionExtDummyBase(aFac), iPhone(aPhone)
|
|
1532 |
{
|
|
1533 |
iMessagingName=aName;
|
|
1534 |
}
|
|
1535 |
|
|
1536 |
void CUssdMessagingDMmTsy::ConstructL()
|
|
1537 |
{
|
|
1538 |
LOGTEXT(_L8("CUssdMessagingDMmTsy created"));
|
|
1539 |
}
|
|
1540 |
|
|
1541 |
CUssdMessagingDMmTsy::~CUssdMessagingDMmTsy()
|
|
1542 |
{
|
|
1543 |
LOGTEXT(_L8("CUssdMessagingDMmTsy destroyed"));
|
|
1544 |
}
|
|
1545 |
|
|
1546 |
CTelObject* CUssdMessagingDMmTsy::OpenNewObjectByNameL(const TDesC& /*aName*/)
|
|
1547 |
{
|
|
1548 |
User::Leave(KErrNotSupported);
|
|
1549 |
return NULL;
|
|
1550 |
}
|
|
1551 |
|
|
1552 |
CTelObject* CUssdMessagingDMmTsy::OpenNewObjectL(TDes&)
|
|
1553 |
{
|
|
1554 |
User::Leave(KErrNotSupported);
|
|
1555 |
return NULL;
|
|
1556 |
}
|
|
1557 |
|
|
1558 |
CTelObject::TReqMode CUssdMessagingDMmTsy::ReqModeL(const TInt aIpc)
|
|
1559 |
{
|
|
1560 |
CTelObject::TReqMode ret=0;
|
|
1561 |
switch (aIpc)
|
|
1562 |
{
|
|
1563 |
//
|
|
1564 |
// Non-Flow Controlled Services
|
|
1565 |
//
|
|
1566 |
case EMobileUssdMessagingGetCaps:
|
|
1567 |
break;
|
|
1568 |
//
|
|
1569 |
// Flow Controlled Services
|
|
1570 |
//
|
|
1571 |
case EMobileUssdMessagingSendMessage:
|
|
1572 |
case EMobileUssdMessagingSendMessageNoFdnCheck:
|
|
1573 |
case EMobileUssdMessagingSendRelease:
|
|
1574 |
ret=KReqModeFlowControlObeyed;
|
|
1575 |
break;
|
|
1576 |
|
|
1577 |
//
|
|
1578 |
// Immediate Server Repost
|
|
1579 |
//
|
|
1580 |
case EMobileUssdMessagingReceiveMessage:
|
|
1581 |
case EMobileUssdMessagingNotifyNetworkRelease:
|
|
1582 |
ret=KReqModeRePostImmediately;
|
|
1583 |
break;
|
|
1584 |
//
|
|
1585 |
// Cancel Requests
|
|
1586 |
//
|
|
1587 |
case EMobileUssdMessagingReceiveMessageCancel:
|
|
1588 |
case EMobileUssdMessagingSendMessageCancel:
|
|
1589 |
case EMobileUssdMessagingSendMessageNoFdnCheckCancel:
|
|
1590 |
case EMobileUssdMessagingSendReleaseCancel:
|
|
1591 |
case EMobileUssdMessagingNotifyNetworkReleaseCancel:
|
|
1592 |
default:
|
|
1593 |
User::Leave(KErrNotSupported);
|
|
1594 |
break;
|
|
1595 |
}
|
|
1596 |
|
|
1597 |
return ret;
|
|
1598 |
}
|
|
1599 |
|
|
1600 |
TInt CUssdMessagingDMmTsy::RegisterNotification(const TInt aIpc)
|
|
1601 |
{
|
|
1602 |
switch (aIpc)
|
|
1603 |
{
|
|
1604 |
case EMobileUssdMessagingReceiveMessage:
|
|
1605 |
LOGTEXT(_L8("CUssdMessagingDMmTsy: RegisterNotification - Receive USSD"));
|
|
1606 |
return KErrNone;
|
|
1607 |
case EMobileUssdMessagingNotifyNetworkRelease:
|
|
1608 |
LOGTEXT(_L8("CUssdMessagingDMmTsy: RegisterNotification - Notify Network Release"));
|
|
1609 |
return KErrNone;
|
|
1610 |
default:
|
|
1611 |
// Unknown or invalid IPC
|
|
1612 |
LOGTEXT(_L8("CUssdMessagingDMmTsy: Register error, unknown IPC"));
|
|
1613 |
return KErrNotSupported;
|
|
1614 |
}
|
|
1615 |
}
|
|
1616 |
|
|
1617 |
TInt CUssdMessagingDMmTsy::DeregisterNotification(const TInt aIpc)
|
|
1618 |
{
|
|
1619 |
switch (aIpc)
|
|
1620 |
{
|
|
1621 |
case EMobileUssdMessagingReceiveMessage:
|
|
1622 |
LOGTEXT(_L8("CUssdMessagingDMmTsy: DeregisterNotification - Receive USSD"));
|
|
1623 |
return KErrNone;
|
|
1624 |
case EMobileUssdMessagingNotifyNetworkRelease:
|
|
1625 |
LOGTEXT(_L8("CUssdMessagingDMmTsy: DeregisterNotification - Notify Network Release"));
|
|
1626 |
return KErrNone;
|
|
1627 |
default:
|
|
1628 |
// Unknown or invalid IPC
|
|
1629 |
LOGTEXT(_L8("CUssdMessagingDMmTsy: Deregister error, unknown IPC"));
|
|
1630 |
return KErrNotSupported;
|
|
1631 |
}
|
|
1632 |
}
|
|
1633 |
|
|
1634 |
TInt CUssdMessagingDMmTsy::NumberOfSlotsL(const TInt aIpc)
|
|
1635 |
{
|
|
1636 |
TInt numberOfSlots=1;
|
|
1637 |
switch (aIpc)
|
|
1638 |
{
|
|
1639 |
case EMobileUssdMessagingReceiveMessage:
|
|
1640 |
case EMobileUssdMessagingNotifyNetworkRelease:
|
|
1641 |
LOGTEXT(_L8("CUssdMessagingDMmTsy: Registered with 2 slot"));
|
|
1642 |
numberOfSlots=2;
|
|
1643 |
break;
|
|
1644 |
default:
|
|
1645 |
// Unknown or invalid Phone IPC
|
|
1646 |
LOGTEXT(_L8("CUssdMessagingDMmTsy: Number of Slots error, unknown IPC"));
|
|
1647 |
User::Leave(KErrNotSupported);
|
|
1648 |
break;
|
|
1649 |
}
|
|
1650 |
return numberOfSlots;
|
|
1651 |
}
|
|
1652 |
|
|
1653 |
|
|
1654 |
TInt CUssdMessagingDMmTsy::ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,
|
|
1655 |
const TDataPackage& aPackage)
|
|
1656 |
{
|
|
1657 |
switch (aIpc)
|
|
1658 |
{
|
|
1659 |
|
|
1660 |
case EMobileUssdMessagingGetCaps:
|
|
1661 |
return GetCaps(aTsyReqHandle, aPackage.Des1n());
|
|
1662 |
|
|
1663 |
case EMobileUssdMessagingSendMessage:
|
|
1664 |
return SendMessage(aTsyReqHandle, aPackage.Des1n(), aPackage.Des2n());
|
|
1665 |
|
|
1666 |
case EMobileUssdMessagingSendMessageNoFdnCheck:
|
|
1667 |
return SendMessageNoFdnCheck(aTsyReqHandle, aPackage.Des1n(), aPackage.Des2n());
|
|
1668 |
|
|
1669 |
case EMobileUssdMessagingReceiveMessage:
|
|
1670 |
return ReceiveMessage(aTsyReqHandle, aPackage.Des1n(), aPackage.Des2n());
|
|
1671 |
case EMobileUssdMessagingSendRelease:
|
|
1672 |
return SendRelease(aTsyReqHandle, aPackage.Des1n());
|
|
1673 |
case EMobileUssdMessagingNotifyNetworkRelease:
|
|
1674 |
switch(aPackage.Type())
|
|
1675 |
{
|
|
1676 |
// Switch between the alternative implementations of GetPhoneStoreInfo
|
|
1677 |
case TDataPackage::EPackage1n:
|
|
1678 |
return NotifyNetworkRelease(aTsyReqHandle, aPackage.Des1n());
|
|
1679 |
case TDataPackage::EPackage1n2n:
|
|
1680 |
return NotifyNetworkRelease(aTsyReqHandle, aPackage.Des1n(),aPackage.Des2n());
|
|
1681 |
default:
|
|
1682 |
return KErrCorrupt;
|
|
1683 |
}
|
|
1684 |
|
|
1685 |
//
|
|
1686 |
// Cancel Requests
|
|
1687 |
//
|
|
1688 |
case EMobileUssdMessagingReceiveMessageCancel:
|
|
1689 |
return ReceiveMessageCancel(aTsyReqHandle);
|
|
1690 |
case EMobileUssdMessagingSendMessageCancel:
|
|
1691 |
return SendMessageCancel(aTsyReqHandle);
|
|
1692 |
case EMobileUssdMessagingSendMessageNoFdnCheckCancel:
|
|
1693 |
return SendMessageNoFdnCheckCancel(aTsyReqHandle);
|
|
1694 |
case EMobileUssdMessagingSendReleaseCancel:
|
|
1695 |
return SendReleaseCancel(aTsyReqHandle);
|
|
1696 |
case EMobileUssdMessagingNotifyNetworkReleaseCancel:
|
|
1697 |
return NotifyNetworkReleaseCancel(aTsyReqHandle);
|
|
1698 |
|
|
1699 |
default:
|
|
1700 |
return KErrNotSupported;
|
|
1701 |
}
|
|
1702 |
}
|
|
1703 |
|
|
1704 |
TInt CUssdMessagingDMmTsy::CancelService(const TInt aIpc,const TTsyReqHandle aTsyReqHandle)
|
|
1705 |
{
|
|
1706 |
LOGTEXT(_L8("CUssdMessagingDMmTsy: - CancelService called"));
|
|
1707 |
switch (aIpc)
|
|
1708 |
{
|
|
1709 |
case EMobileUssdMessagingReceiveMessage:
|
|
1710 |
return ReceiveMessageCancel(aTsyReqHandle);
|
|
1711 |
case EMobileUssdMessagingSendMessage:
|
|
1712 |
return SendMessageCancel(aTsyReqHandle);
|
|
1713 |
case EMobileUssdMessagingSendMessageNoFdnCheck:
|
|
1714 |
return SendMessageNoFdnCheckCancel(aTsyReqHandle);
|
|
1715 |
case EMobileUssdMessagingSendRelease:
|
|
1716 |
return SendReleaseCancel(aTsyReqHandle);
|
|
1717 |
case EMobileUssdMessagingNotifyNetworkRelease:
|
|
1718 |
return NotifyNetworkReleaseCancel(aTsyReqHandle);
|
|
1719 |
default:
|
|
1720 |
return KErrGeneral;
|
|
1721 |
}
|
|
1722 |
}
|
|
1723 |
|
|
1724 |
TInt CUssdMessagingDMmTsy::GetCaps(const TTsyReqHandle aTsyReqHandle, TDes8* aCaps)
|
|
1725 |
{
|
|
1726 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::GetCaps called"));
|
|
1727 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg* ussdCapsPckg = (RMobileUssdMessaging::TMobileUssdCapsV1Pckg*)aCaps;
|
|
1728 |
RMobileUssdMessaging::TMobileUssdCapsV1& ussdCaps = (*ussdCapsPckg)();
|
|
1729 |
|
|
1730 |
ussdCaps.iUssdTypes=DMMTSY_USSD_MESSAGING_TYPE_CAPS;
|
|
1731 |
|
|
1732 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1733 |
return KErrNone;
|
|
1734 |
}
|
|
1735 |
|
|
1736 |
TInt CUssdMessagingDMmTsy::ReceiveMessage(const TTsyReqHandle aTsyReqHandle, TDes8* aMsgData, TDes8* aMsgAttributes)
|
|
1737 |
{
|
|
1738 |
if (!iReceiveMessage++)
|
|
1739 |
{
|
|
1740 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::ReceiveMessage called"));
|
|
1741 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg* attsPckg = REINTERPRET_CAST(RMobileUssdMessaging::TMobileUssdAttributesV1Pckg*,aMsgAttributes);
|
|
1742 |
RMobileUssdMessaging::TMobileUssdAttributesV1& atts = (*attsPckg)();
|
|
1743 |
|
|
1744 |
*aMsgData = DMMTSY_USSD_MESSAGE_PDU;
|
|
1745 |
|
|
1746 |
atts.iFlags = DMMTSY_USSD_ATTRIBUTE_FLAGS;
|
|
1747 |
atts.iFormat = DMMTSY_USSD_ATTRIBUTE_FORMAT;
|
|
1748 |
atts.iType = DMMTSY_USSD_ATTRIBUTE_TYPE;
|
|
1749 |
atts.iDcs = DMMTSY_USSD_ATTRIBUTE_DCS;
|
|
1750 |
|
|
1751 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1752 |
}
|
|
1753 |
return KErrNone;
|
|
1754 |
}
|
|
1755 |
|
|
1756 |
TInt CUssdMessagingDMmTsy::ReceiveMessageCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1757 |
{
|
|
1758 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::ReceiveMessageCancel called"));
|
|
1759 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1760 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1761 |
return KErrNone;
|
|
1762 |
}
|
|
1763 |
|
|
1764 |
TInt CUssdMessagingDMmTsy::SendMessage(const TTsyReqHandle aTsyReqHandle, TDesC8* aMsgData, TDesC8* aMsgAttributes)
|
|
1765 |
{
|
|
1766 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::SendMessage called"));
|
|
1767 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg* attsPckg = REINTERPRET_CAST(RMobileUssdMessaging::TMobileUssdAttributesV1Pckg*,aMsgAttributes);
|
|
1768 |
RMobileUssdMessaging::TMobileUssdAttributesV1& atts = (*attsPckg)();
|
|
1769 |
if ((aMsgData->Compare(DMMTSY_USSD_MESSAGE_PDU) != 0) ||
|
|
1770 |
atts.iFlags != DMMTSY_USSD_ATTRIBUTE_FLAGS ||
|
|
1771 |
atts.iFormat != DMMTSY_USSD_ATTRIBUTE_FORMAT ||
|
|
1772 |
atts.iType != DMMTSY_USSD_ATTRIBUTE_TYPE ||
|
|
1773 |
atts.iDcs != DMMTSY_USSD_ATTRIBUTE_DCS)
|
|
1774 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
1775 |
else
|
|
1776 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1777 |
return KErrNone;
|
|
1778 |
}
|
|
1779 |
|
|
1780 |
TInt CUssdMessagingDMmTsy::SendMessageCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1781 |
{
|
|
1782 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::SendMessageCancel called"));
|
|
1783 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1784 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1785 |
return KErrNone;
|
|
1786 |
}
|
|
1787 |
|
|
1788 |
TInt CUssdMessagingDMmTsy::SendMessageNoFdnCheck(const TTsyReqHandle aTsyReqHandle, TDesC8* aMsgData, TDesC8* aMsgAttributes)
|
|
1789 |
/**
|
|
1790 |
* This method sends an outgoing SMS to the network. The number used for sending the SMS
|
|
1791 |
* is not checked against those in the Fixed Dialling Number list even if the FDN service is enabled
|
|
1792 |
*
|
|
1793 |
* @param aMsgData Supplies the TPDU to send
|
|
1794 |
* @param aMsgAttributes Supplies the attributes of the outgoing message
|
|
1795 |
*/
|
|
1796 |
{
|
|
1797 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::SendMessageNoFdnCheck called"));
|
|
1798 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg* attsPckg = REINTERPRET_CAST(RMobileUssdMessaging::TMobileUssdAttributesV1Pckg*,aMsgAttributes);
|
|
1799 |
RMobileUssdMessaging::TMobileUssdAttributesV1& atts = (*attsPckg)();
|
|
1800 |
if ((aMsgData->Compare(DMMTSY_USSD_MESSAGE_PDU) != 0) ||
|
|
1801 |
atts.iFlags != DMMTSY_USSD_ATTRIBUTE_FLAGS ||
|
|
1802 |
atts.iFormat != DMMTSY_USSD_ATTRIBUTE_FORMAT ||
|
|
1803 |
atts.iType != DMMTSY_USSD_ATTRIBUTE_TYPE ||
|
|
1804 |
atts.iDcs != DMMTSY_USSD_ATTRIBUTE_DCS)
|
|
1805 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
1806 |
else
|
|
1807 |
iPhone->AddDelayedReq(aTsyReqHandle,this);
|
|
1808 |
return KErrNone;
|
|
1809 |
}
|
|
1810 |
|
|
1811 |
TInt CUssdMessagingDMmTsy::SendMessageNoFdnCheckCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1812 |
/**
|
|
1813 |
* This method cancels the sending of an outgoing SMS to the network. The number used for sending the SMS
|
|
1814 |
* is not checked against those in the Fixed Dialling Number list even if the FDN service is enabled
|
|
1815 |
*
|
|
1816 |
*/
|
|
1817 |
{
|
|
1818 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::SendMessageNoFdnCheckCancel called"));
|
|
1819 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1820 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1821 |
return KErrNone;
|
|
1822 |
}
|
|
1823 |
|
|
1824 |
TInt CUssdMessagingDMmTsy::SendRelease(const TTsyReqHandle aTsyReqHandle, TDes8* aReturnResult)
|
|
1825 |
{
|
|
1826 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::SendRelease called"));
|
|
1827 |
if (!iSendRelease++)
|
|
1828 |
{
|
|
1829 |
RMobilePhone::TMobilePhoneSendSSRequestV3Pckg* ssRequestPckg = REINTERPRET_CAST(RMobilePhone::TMobilePhoneSendSSRequestV3Pckg*,aReturnResult);
|
|
1830 |
RMobilePhone::TMobilePhoneSendSSRequestV3& ssRequest = (*ssRequestPckg)();
|
|
1831 |
|
|
1832 |
if(ssRequest.ExtensionId()!=KETelExtMultimodeV3)
|
|
1833 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
1834 |
else
|
|
1835 |
{
|
|
1836 |
ssRequest.iOpCode = DMMTSY_PHONE_NOTIFY_OPCODE;
|
|
1837 |
ssRequest.iAdditionalInfo = DMMTSY_PHONE_NOTIFY_ADDINFO;
|
|
1838 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1839 |
}
|
|
1840 |
}
|
|
1841 |
return KErrNone;
|
|
1842 |
}
|
|
1843 |
|
|
1844 |
TInt CUssdMessagingDMmTsy::SendReleaseCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1845 |
{
|
|
1846 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::SendReleaseCancel called"));
|
|
1847 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1848 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1849 |
return KErrNone;
|
|
1850 |
}
|
|
1851 |
|
|
1852 |
TInt CUssdMessagingDMmTsy::NotifyNetworkRelease(const TTsyReqHandle aTsyReqHandle, TDes8* aReturnResult)
|
|
1853 |
{
|
|
1854 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::NotifyNetworkRelease (deprecated version) called"));
|
|
1855 |
if (!iNetworkRelease++)
|
|
1856 |
{
|
|
1857 |
RMobilePhone::TMobilePhoneSendSSRequestV3Pckg* ssRequestPckg = REINTERPRET_CAST(RMobilePhone::TMobilePhoneSendSSRequestV3Pckg*,aReturnResult);
|
|
1858 |
RMobilePhone::TMobilePhoneSendSSRequestV3& ssRequest = (*ssRequestPckg)();
|
|
1859 |
|
|
1860 |
if(ssRequest.ExtensionId()!=KETelExtMultimodeV3)
|
|
1861 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
1862 |
else
|
|
1863 |
{
|
|
1864 |
ssRequest.iOpCode = DMMTSY_PHONE_NOTIFY_OPCODE;
|
|
1865 |
ssRequest.iAdditionalInfo = DMMTSY_PHONE_NOTIFY_ADDINFO;
|
|
1866 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1867 |
}
|
|
1868 |
}
|
|
1869 |
return KErrNone;
|
|
1870 |
}
|
|
1871 |
|
|
1872 |
TInt CUssdMessagingDMmTsy::NotifyNetworkReleaseCancel(const TTsyReqHandle aTsyReqHandle)
|
|
1873 |
{
|
|
1874 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::NotifyNetworkReleaseCancel called"));
|
|
1875 |
iPhone->RemoveDelayedReq(aTsyReqHandle);
|
|
1876 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
1877 |
return KErrNone;
|
|
1878 |
}
|
|
1879 |
|
|
1880 |
TInt CUssdMessagingDMmTsy::NotifyNetworkRelease(const TTsyReqHandle aTsyReqHandle, TDes8* aReturnResult, TDes8* aMsgAttributes)
|
|
1881 |
{
|
|
1882 |
LOGTEXT(_L8("CUssdMessagingDMmTsy::NotifyNetworkRelease called"));
|
|
1883 |
if (iNetworkRelease >= 2)
|
|
1884 |
{
|
|
1885 |
iNetworkRelease = 0;
|
|
1886 |
}
|
|
1887 |
|
|
1888 |
if (!iNetworkRelease++)
|
|
1889 |
{
|
|
1890 |
RMobilePhone::TMobilePhoneSendSSRequestV3Pckg* ssRequestPckg = REINTERPRET_CAST(RMobilePhone::TMobilePhoneSendSSRequestV3Pckg*,aReturnResult);
|
|
1891 |
RMobilePhone::TMobilePhoneSendSSRequestV3& ssRequest = (*ssRequestPckg)();
|
|
1892 |
|
|
1893 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg* ssMsgAttributesPckg = REINTERPRET_CAST(RMobileUssdMessaging::TMobileUssdAttributesV1Pckg*,aMsgAttributes);
|
|
1894 |
RMobileUssdMessaging::TMobileUssdAttributesV1& ssMsgAttributesReq = (*ssMsgAttributesPckg)();
|
|
1895 |
|
|
1896 |
if ((ssRequest.ExtensionId()!=KETelExtMultimodeV3) || (ssMsgAttributesReq.ExtensionId()!=KETelExtMultimodeV1))
|
|
1897 |
{
|
|
1898 |
ReqCompleted(aTsyReqHandle,KErrCorrupt);
|
|
1899 |
}
|
|
1900 |
else
|
|
1901 |
{
|
|
1902 |
ssRequest.iOpCode = DMMTSY_PHONE_NOTIFY_OPCODE;
|
|
1903 |
ssRequest.iAdditionalInfo = DMMTSY_PHONE_NOTIFY_ADDINFO;
|
|
1904 |
|
|
1905 |
ssMsgAttributesReq.iFlags = DMMTSY_USSD_ATTRIBUTE_FLAGS;
|
|
1906 |
ssMsgAttributesReq.iFormat = DMMTSY_USSD_ATTRIBUTE_FORMAT;
|
|
1907 |
ssMsgAttributesReq.iType = DMMTSY_USSD_ATTRIBUTE_TYPE;
|
|
1908 |
ssMsgAttributesReq.iDcs = DMMTSY_USSD_ATTRIBUTE_DCS;
|
|
1909 |
|
|
1910 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1911 |
}
|
|
1912 |
}
|
|
1913 |
return KErrNone;
|
|
1914 |
}
|