33
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2008 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: Ui sub session.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
// INCLUDE FILES
|
|
21 |
#include <e32property.h>
|
|
22 |
#include <satdomainpskeys.h>
|
|
23 |
|
|
24 |
#include "CSatSUiSubSession.h"
|
|
25 |
#include "CSatSSession.h"
|
|
26 |
#include "CSatSServer.h"
|
|
27 |
#include "CSatCommandHandler.h"
|
|
28 |
#include "CSatCommandContainer.h"
|
|
29 |
#include "MSatApi.h"
|
|
30 |
#include "EnginePanic.h"
|
|
31 |
#include "SatLog.h"
|
|
32 |
#include "SATInternalPSKeys.h"
|
|
33 |
|
|
34 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
35 |
|
|
36 |
// -----------------------------------------------------------------------------
|
|
37 |
// CSatSUiSubSession::CSatSUiSubSession
|
|
38 |
// C++ default constructor can NOT contain any code, that
|
|
39 |
// might leave.
|
|
40 |
// -----------------------------------------------------------------------------
|
|
41 |
//
|
|
42 |
//lint -e{1403, 1769} Can not be initialized, harmless.
|
|
43 |
CSatSUiSubSession::CSatSUiSubSession(
|
|
44 |
CSatSSession& aSession,
|
|
45 |
MSatApi& aSatApi,
|
|
46 |
TSatEventMediator& aEventMediator ) // Session
|
|
47 |
:
|
|
48 |
CSatSSubSession( aSession ),
|
|
49 |
iEventData(),
|
|
50 |
iEventDataPckg( iEventData ),
|
|
51 |
iSatApi( aSatApi ),
|
|
52 |
iEventMediator( aEventMediator )
|
|
53 |
{
|
|
54 |
LOG( SIMPLE,
|
|
55 |
"SATENGINE: CSatSUiSubSession::CSatSUiSubSession calling - exiting" )
|
|
56 |
}
|
|
57 |
|
|
58 |
// -----------------------------------------------------------------------------
|
|
59 |
// CSatSUiSubSession::ConstructL
|
|
60 |
// Symbian 2nd phase constructor can leave.
|
|
61 |
// -----------------------------------------------------------------------------
|
|
62 |
//
|
|
63 |
void CSatSUiSubSession::ConstructL()
|
|
64 |
{
|
|
65 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::ConstructL calling" )
|
|
66 |
|
|
67 |
iEventMediator.RegisterL( this, MSatUtils::ESmsSent );
|
|
68 |
|
|
69 |
// Get registered service requests from MSatUtils.
|
|
70 |
iServiceRequest = iSession.SatServer()->SatUtils()->ServiceRequests();
|
|
71 |
|
|
72 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::ConstructL exiting" )
|
|
73 |
}
|
|
74 |
|
|
75 |
// -----------------------------------------------------------------------------
|
|
76 |
// CSatSUiSubSession::NewL
|
|
77 |
// Two-phased constructor.
|
|
78 |
// -----------------------------------------------------------------------------
|
|
79 |
//
|
|
80 |
CSatSUiSubSession* CSatSUiSubSession::NewL(
|
|
81 |
CSatSSession& aSession,
|
|
82 |
MSatApi& aSatApi,
|
|
83 |
TSatEventMediator& aEventMediator )
|
|
84 |
{
|
|
85 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::NewL calling" )
|
|
86 |
|
|
87 |
CSatSUiSubSession* self =
|
|
88 |
new( ELeave ) CSatSUiSubSession( aSession, aSatApi, aEventMediator );
|
|
89 |
|
|
90 |
CleanupStack::PushL( self );
|
|
91 |
self->ConstructL();
|
|
92 |
CleanupStack::Pop( self );
|
|
93 |
|
|
94 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::NewL exiting" )
|
|
95 |
return self;
|
|
96 |
}
|
|
97 |
|
|
98 |
// Destructor
|
|
99 |
CSatSUiSubSession::~CSatSUiSubSession()
|
|
100 |
{
|
|
101 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::~CSatSUiSubSession calling" )
|
|
102 |
|
|
103 |
iServiceRequest = NULL;
|
|
104 |
|
|
105 |
// Unregister to listen events
|
|
106 |
iEventMediator.Unregister( this );
|
|
107 |
|
|
108 |
// Inform session that UI Session is closed.
|
|
109 |
// Session tells to container of iServiceRequest to reset
|
|
110 |
// request handlers.
|
|
111 |
iSession.UiSessionClosed();
|
|
112 |
|
|
113 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::~CSatSUiSubSession exiting" )
|
|
114 |
}
|
|
115 |
|
|
116 |
// -----------------------------------------------------------------------------
|
|
117 |
// CSatSUiSubSession::HandleCommandL
|
|
118 |
// (other items were commented in a header).
|
|
119 |
// -----------------------------------------------------------------------------
|
|
120 |
//
|
|
121 |
void CSatSUiSubSession::HandleCommandL(
|
|
122 |
const RMessage2& aMessage ) // Message from ui client.
|
|
123 |
{
|
|
124 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::HandleCommandL calling" )
|
|
125 |
LOG2( SIMPLE, "SATENGINE: CSatSUiSubSession::HandleCommandL \
|
|
126 |
command: %i", aMessage.Function() )
|
|
127 |
switch ( aMessage.Function() )
|
|
128 |
{
|
|
129 |
// Ui client is ready to handle setupmenu command.
|
|
130 |
case ESatSProactiveSetUpMenu:
|
|
131 |
{
|
|
132 |
// Notifies that SetUpMenu command has been made because SAT Client
|
|
133 |
// side application is returning to the main menu after SelectItem.
|
|
134 |
// For example: Next action is LaunchBrowser command and after
|
|
135 |
// Browser is launched then SAT Client side application has been
|
|
136 |
// opened top of Browser. In some cases SAT client side application
|
|
137 |
// stays topmost.
|
|
138 |
iEventMediator.Notify( MSatUtils::ESetUpMenuRequested );
|
|
139 |
// This service request is handled also like commands listed below.
|
|
140 |
}
|
|
141 |
//lint -fallthrough intended here
|
|
142 |
case ESatSProactiveDisplayText:
|
|
143 |
case ESatSProactiveGetInkey:
|
|
144 |
case ESatSProactiveGetInput:
|
|
145 |
case ESatSProactiveSelectItem:
|
|
146 |
case ESatSProactivePlayTone:
|
|
147 |
case ESatSProactiveRefresh:
|
|
148 |
case ESatSProactiveDisplayTextResponse:
|
|
149 |
case ESatSProactiveGetInkeyResponse:
|
|
150 |
case ESatSProactiveGetInputResponse:
|
|
151 |
case ESatSProactiveSelectItemResponse:
|
|
152 |
case ESatSProactivePlayToneResponse:
|
|
153 |
case ESatSProactiveQuery:
|
|
154 |
case ESatSProactiveQueryResponse:
|
|
155 |
case ESatSProactiveNotification:
|
|
156 |
case ESatSProactiveNotificationResponse:
|
|
157 |
{
|
|
158 |
const TInt count( iServiceRequest->Count() );
|
|
159 |
TBool requestHandled( EFalse );
|
|
160 |
TInt index( 0 );
|
|
161 |
// Loop until request is handled or no request handler found.
|
|
162 |
while ( !requestHandled && index < count )
|
|
163 |
{
|
|
164 |
requestHandled = iServiceRequest->At( index )->
|
|
165 |
HandleRequest( aMessage );
|
|
166 |
index++;
|
|
167 |
}
|
|
168 |
LOG2( SIMPLE, "SATENGINE: CSatSUiSubSession::HandleCommandL \
|
|
169 |
index: %i", index )
|
|
170 |
break;
|
|
171 |
}
|
|
172 |
|
|
173 |
// Menu selection envelope.
|
|
174 |
case ESatSActiveMenuSelection:
|
|
175 |
{
|
|
176 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession: MenuSelection" )
|
|
177 |
// Declare the IPC data structures.
|
|
178 |
RSat::TMenuSelectionV1 menuSelection;
|
|
179 |
RSat::TMenuSelectionV1Pckg menuSelectionPckg( menuSelection );
|
|
180 |
|
|
181 |
// Perform the IPC transfer of response data.
|
|
182 |
TRAPD( res, aMessage.ReadL( 0, menuSelectionPckg ) );
|
|
183 |
|
|
184 |
// Send the response further only if IPC succeeded.
|
|
185 |
if ( KErrNone != res )
|
|
186 |
{
|
|
187 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession: KErrNone != res" )
|
|
188 |
iSession.PanicClient( aMessage, ESatSBadDescriptor );
|
|
189 |
}
|
|
190 |
iSatApi.SendMenuSelection( menuSelectionPckg );
|
|
191 |
|
|
192 |
// Complete the client request.
|
|
193 |
aMessage.Complete( KErrNone );
|
|
194 |
LOG( SIMPLE,
|
|
195 |
"SATENGINE: CSatSUiSubSession::HandleCommandL exiting" )
|
|
196 |
return;
|
|
197 |
}
|
|
198 |
|
|
199 |
case ESatSProactiveEvent:
|
|
200 |
{
|
|
201 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession: Event" )
|
|
202 |
iEventRequest = aMessage;
|
|
203 |
iEventRequestAvailable = ETrue;
|
|
204 |
if ( iCloseUiRequested )
|
|
205 |
{
|
|
206 |
LOG( SIMPLE,
|
|
207 |
"SATENGINE: CSatSUiSubSession::HandleCommandL closeui" )
|
|
208 |
CloseUiSession();
|
|
209 |
}
|
|
210 |
else if ( iSmsSent )
|
|
211 |
{
|
|
212 |
LOG( SIMPLE,
|
|
213 |
"SATENGINE: CSatSUiSubSession::HandleCommandL smssent" )
|
|
214 |
SendSmsSentEventToClient();
|
|
215 |
}
|
|
216 |
else if ( iClearScreenRequested )
|
|
217 |
{
|
|
218 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::HandleCommandL \
|
|
219 |
clearscreen" )
|
|
220 |
ClearScreen();
|
|
221 |
}
|
|
222 |
else if ( iUiEventRequested )
|
|
223 |
{
|
|
224 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::HandleCommandL \
|
|
225 |
UiEventRequested" )
|
|
226 |
HandleUiEventNotification();
|
|
227 |
}
|
|
228 |
else
|
|
229 |
{
|
|
230 |
LOG( SIMPLE, "SATENGINE: Event request available" )
|
|
231 |
}
|
|
232 |
|
|
233 |
break;
|
|
234 |
}
|
|
235 |
|
|
236 |
case ESatSProactiveEventResponse:
|
|
237 |
{
|
|
238 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession: EventResponse" )
|
|
239 |
// Declare the IPC data structures.
|
|
240 |
TSatEventV1 eventRsp;
|
|
241 |
//lint -e{603} eventRsp read through eventRspPckg in ReadL.
|
|
242 |
TSatEventV1Pckg eventRspPckg( eventRsp );
|
|
243 |
|
|
244 |
// Perform the IPC transfer of response data.
|
|
245 |
TRAPD( res, aMessage.ReadL( 0, eventRspPckg ) );
|
|
246 |
if ( KErrNone != res )
|
|
247 |
{
|
|
248 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::HandleCommandL \
|
|
249 |
read response data error" )
|
|
250 |
iSession.PanicClient( aMessage, ESatSBadDescriptor );
|
|
251 |
}
|
|
252 |
else
|
|
253 |
{
|
|
254 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::HandleCommandL \
|
|
255 |
no error" )
|
|
256 |
aMessage.Complete( KErrNone );
|
|
257 |
}
|
|
258 |
break;
|
|
259 |
}
|
|
260 |
|
|
261 |
case ESatSSessionTerminated:
|
|
262 |
{
|
|
263 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession: SessionTerminated" )
|
|
264 |
TSatTermination temp;
|
|
265 |
//lint -e{603} temp read through tempPckg in ReadL.
|
|
266 |
TSatTerminationPckg tempPckg ( temp );
|
|
267 |
TRAPD( res, aMessage.ReadL( 0, tempPckg ) );
|
|
268 |
if ( KErrNone != res )
|
|
269 |
{
|
|
270 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::HandleCommandL \
|
|
271 |
read tempPckg error" )
|
|
272 |
iSession.PanicClient( aMessage, ESatSBadDescriptor );
|
|
273 |
}
|
|
274 |
else
|
|
275 |
{
|
|
276 |
LOG2( SIMPLE, "SATENGINE: CSatSUiSubSession::HandleCommandL \
|
|
277 |
temp.type: %i", temp.type )
|
|
278 |
switch ( temp.type )
|
|
279 |
{
|
|
280 |
case ETerminatedByCancel:
|
|
281 |
{
|
|
282 |
iEventMediator.Notify(
|
|
283 |
MSatUtils::ECommandCancelled );
|
|
284 |
break;
|
|
285 |
}
|
|
286 |
case ETerminatedByEndKey:
|
|
287 |
{
|
|
288 |
iEventMediator.Notify(
|
|
289 |
MSatUtils::ECancelledUsingEndKey );
|
|
290 |
|
|
291 |
PublishSatAppClosedUsingEndKey();
|
|
292 |
|
|
293 |
// Inform session that UI Session is closed.
|
|
294 |
// Session is not actually closed yet but this prevents
|
|
295 |
// sending data through this session.
|
|
296 |
// Notify thread death monitor
|
|
297 |
iSession.NotifyThreadDeathMonitor();
|
|
298 |
break;
|
|
299 |
}
|
|
300 |
default:
|
|
301 |
{
|
|
302 |
LOG( SIMPLE, "SATENGINE: Unknown termination type" )
|
|
303 |
}
|
|
304 |
}
|
|
305 |
}
|
|
306 |
// Complete the client request.
|
|
307 |
aMessage.Complete( KErrNone );
|
|
308 |
break;
|
|
309 |
}
|
|
310 |
|
|
311 |
default:
|
|
312 |
{
|
|
313 |
LOG( SIMPLE, " Unhandled command")
|
|
314 |
}
|
|
315 |
}
|
|
316 |
|
|
317 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::HandleCommandL exiting" )
|
|
318 |
}
|
|
319 |
|
|
320 |
// -----------------------------------------------------------------------------
|
|
321 |
// CSatSUiSubSession::CloseUiSession
|
|
322 |
// (other items were commented in a header).
|
|
323 |
// -----------------------------------------------------------------------------
|
|
324 |
//
|
|
325 |
void CSatSUiSubSession::CloseUiSession()
|
|
326 |
{
|
|
327 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::CloseUiSession calling" )
|
|
328 |
|
|
329 |
// Set request flag to ETrue. Updated when command is successfully sent.
|
|
330 |
iCloseUiRequested = ETrue;
|
|
331 |
|
|
332 |
// Notify thread death monitor
|
|
333 |
iSession.NotifyThreadDeathMonitor();
|
|
334 |
|
|
335 |
iEventData.iEvent = ESatSCloseSatUiAppEvent;
|
|
336 |
|
|
337 |
const TBool commandSent( SendCommandDataToClient( iEventRequestAvailable,
|
|
338 |
iEventDataPckg,
|
|
339 |
iEventRequest ) );
|
|
340 |
|
|
341 |
if ( commandSent )
|
|
342 |
{
|
|
343 |
LOG( SIMPLE,
|
|
344 |
"SATENGINE: CSatSUiSubSession::CloseUiSession commandSent" )
|
|
345 |
// If command was sent, set flag to false, so when next Event request
|
|
346 |
// arrives, command data is not sent.
|
|
347 |
iCloseUiRequested = EFalse;
|
|
348 |
}
|
|
349 |
|
|
350 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::CloseUiSession exiting" )
|
|
351 |
}
|
|
352 |
|
|
353 |
// -----------------------------------------------------------------------------
|
|
354 |
// CSatSUiSubSession::ClearScreen
|
|
355 |
// (other items were commented in a header).
|
|
356 |
// -----------------------------------------------------------------------------
|
|
357 |
//
|
|
358 |
void CSatSUiSubSession::ClearScreen()
|
|
359 |
{
|
|
360 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::ClearScreen calling" )
|
|
361 |
|
|
362 |
// Set request flag to ETrue. Updated when command is successfully sent.
|
|
363 |
iClearScreenRequested = ETrue;
|
|
364 |
|
|
365 |
iEventData.iEvent = ESatSClearScreenEvent;
|
|
366 |
|
|
367 |
const TBool commandSent( SendCommandDataToClient( iEventRequestAvailable,
|
|
368 |
iEventDataPckg,
|
|
369 |
iEventRequest ) );
|
|
370 |
|
|
371 |
if ( commandSent )
|
|
372 |
{
|
|
373 |
LOG( SIMPLE,
|
|
374 |
"SATENGINE: CSatSUiSubSession::ClearScreen commandSent" )
|
|
375 |
// If command was sent, set flag to false, so when next Event request
|
|
376 |
// arrives, command data is not sent.
|
|
377 |
iClearScreenRequested = EFalse;
|
|
378 |
}
|
|
379 |
|
|
380 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::ClearScreen exiting" )
|
|
381 |
}
|
|
382 |
|
|
383 |
// -----------------------------------------------------------------------------
|
|
384 |
// CSatSUiSubSession::UiEventNotification
|
|
385 |
// (other items were commented in a header).
|
|
386 |
// -----------------------------------------------------------------------------
|
|
387 |
//
|
|
388 |
void CSatSUiSubSession::UiEventNotification(
|
|
389 |
TInt aEventId, TInt aEventStatus, TInt aEventError )
|
|
390 |
{
|
|
391 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::UiEventNotification calling" )
|
|
392 |
|
|
393 |
// Set request flag to ETrue. Updated when command is successfully sent.
|
|
394 |
iUiEventRequested = ETrue;
|
|
395 |
iEventData.iEvent = static_cast< TSatSEvent >( aEventId );
|
|
396 |
iEventData.iStatus = static_cast< TSatSEventStatus >( aEventStatus );
|
|
397 |
iEventData.iError = aEventError;
|
|
398 |
|
|
399 |
HandleUiEventNotification();
|
|
400 |
|
|
401 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::UiEventNotification exiting" )
|
|
402 |
}
|
|
403 |
|
|
404 |
// -----------------------------------------------------------------------------
|
|
405 |
// CSatSUiSubSession::HandleUiEventNotification
|
|
406 |
// (other items were commented in a header).
|
|
407 |
// -----------------------------------------------------------------------------
|
|
408 |
//
|
|
409 |
void CSatSUiSubSession::HandleUiEventNotification()
|
|
410 |
{
|
|
411 |
LOG( SIMPLE,
|
|
412 |
"SATENGINE: CSatSUiSubSession::HandleUiEventNotification calling" )
|
|
413 |
|
|
414 |
// Send Command to client
|
|
415 |
const TBool commandSent( SendCommandDataToClient( iEventRequestAvailable,
|
|
416 |
iEventDataPckg,
|
|
417 |
iEventRequest ) );
|
|
418 |
|
|
419 |
// Check the status of command sending
|
|
420 |
if ( commandSent )
|
|
421 |
{
|
|
422 |
LOG( SIMPLE,
|
|
423 |
"SATENGINE: CSatSUiSubSession::HandleUiEventNotification commandSent" )
|
|
424 |
// If command was sent, set flag to false, so when next Event request
|
|
425 |
// arrives, command data is not sent.
|
|
426 |
iUiEventRequested = EFalse;
|
|
427 |
}
|
|
428 |
|
|
429 |
LOG( SIMPLE,
|
|
430 |
"SATENGINE: CSatSUiSubSession::HandleUiEventNotification exiting" )
|
|
431 |
}
|
|
432 |
|
|
433 |
// -----------------------------------------------------------------------------
|
|
434 |
// CSatSUiSubSession::SendCommand
|
|
435 |
// (other items were commented in a header).
|
|
436 |
// -----------------------------------------------------------------------------
|
|
437 |
//
|
|
438 |
void CSatSUiSubSession::SendCommand(
|
|
439 |
TDesC8* aCmdData, // Data from SIM.
|
|
440 |
TDes8* aCmdRsp, // Response.
|
|
441 |
TSatServerRequest aRequest ) // Request, which the aData is sent.
|
|
442 |
{
|
|
443 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::SendCommand calling" )
|
|
444 |
|
|
445 |
const TInt count( iServiceRequest->Count() );
|
|
446 |
TBool requestHandled( EFalse );
|
|
447 |
TInt index( 0 );
|
|
448 |
|
|
449 |
// Loop until request is handled or no request handler found.
|
|
450 |
while ( !requestHandled && ( index < count ) )
|
|
451 |
{
|
|
452 |
requestHandled = iServiceRequest->At( index )->HandleCommand(
|
|
453 |
aCmdData, aCmdRsp, aRequest );
|
|
454 |
index++;
|
|
455 |
}
|
|
456 |
LOG2( SIMPLE, "SATENGINE: CSatSUiSubSession::SendCommand \
|
|
457 |
index: %i", index )
|
|
458 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::SendCommand exiting" )
|
|
459 |
}
|
|
460 |
|
|
461 |
// -----------------------------------------------------------------------------
|
|
462 |
// CSatSUiSubSession::Event
|
|
463 |
// (other items were commented in a header).
|
|
464 |
// -----------------------------------------------------------------------------
|
|
465 |
//
|
|
466 |
void CSatSUiSubSession::Event( TInt aEvent )
|
|
467 |
{
|
|
468 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::Event calling" )
|
|
469 |
|
|
470 |
if ( MSatUtils::ESmsSent == aEvent )
|
|
471 |
{
|
|
472 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::Event ESmsSent" )
|
|
473 |
iSmsSent = ETrue;
|
|
474 |
SendSmsSentEventToClient();
|
|
475 |
}
|
|
476 |
|
|
477 |
LOG( SIMPLE, "SATENGINE: CSatSUiSubSession::Event exiting" )
|
|
478 |
}
|
|
479 |
|
|
480 |
// -----------------------------------------------------------------------------
|
|
481 |
// CSatSUiSubSession::SendCommandDataToClient
|
|
482 |
// Writes descriptor to clients address space and
|
|
483 |
// completes the request.
|
|
484 |
// -----------------------------------------------------------------------------
|
|
485 |
//
|
|
486 |
TBool CSatSUiSubSession::SendCommandDataToClient(
|
|
487 |
TBool& aRequestAvailable, // Is request available
|
|
488 |
const TDesC8& aData, // Data to be sent to client
|
|
489 |
const RMessage2& aMessage ) const // Message of the request
|
|
490 |
{
|
|
491 |
LOG( SIMPLE,
|
|
492 |
"SATENGINE: CSatSUiSubSession::SendCommandDataToClient calling" )
|
|
493 |
|
|
494 |
TBool commandSent( EFalse );
|
|
495 |
|
|
496 |
// Is ui client ready to receive the command data.
|
|
497 |
if ( aRequestAvailable )
|
|
498 |
{
|
|
499 |
LOG( SIMPLE, "SATENGINE: SendCommandDataToClient: Sending to Client" )
|
|
500 |
TRAPD( res, aMessage.WriteL( 0, aData ) );
|
|
501 |
if ( KErrNone != res )
|
|
502 |
{
|
|
503 |
LOG( SIMPLE,
|
|
504 |
"SATENGINE: SendCommandDataToClient: KErrNone != res" )
|
|
505 |
iSession.PanicClient( aMessage, ESatSBadDescriptor );
|
|
506 |
}
|
|
507 |
aMessage.Complete( KErrNone );
|
|
508 |
aRequestAvailable = EFalse;
|
|
509 |
commandSent = ETrue;
|
|
510 |
}
|
|
511 |
|
|
512 |
LOG( SIMPLE,
|
|
513 |
"SATENGINE: CSatSUiSubSession::SendCommandDataToClient exiting" )
|
|
514 |
return commandSent;
|
|
515 |
}
|
|
516 |
|
|
517 |
// -----------------------------------------------------------------------------
|
|
518 |
// CSatSUiSubSession::SendSmsSentEventToClient
|
|
519 |
// -----------------------------------------------------------------------------
|
|
520 |
//
|
|
521 |
void CSatSUiSubSession::SendSmsSentEventToClient()
|
|
522 |
{
|
|
523 |
LOG( SIMPLE,
|
|
524 |
"SATENGINE: CSatSUiSubSession::SendSmsSentEventToClient calling" )
|
|
525 |
|
|
526 |
iEventData.iEvent = ESatSSmEndEvent;
|
|
527 |
const TBool commandSent( SendCommandDataToClient( iEventRequestAvailable,
|
|
528 |
iEventDataPckg, iEventRequest ) );
|
|
529 |
|
|
530 |
if ( commandSent )
|
|
531 |
{
|
|
532 |
LOG( SIMPLE,
|
|
533 |
"SATENGINE: CSatSUiSubSession::SendSmsSentEventToClient commandSent" )
|
|
534 |
// If command was sent, set flag to false, so when next Event request
|
|
535 |
// arrives, command data is not sent.
|
|
536 |
iSmsSent = EFalse;
|
|
537 |
}
|
|
538 |
|
|
539 |
LOG( SIMPLE,
|
|
540 |
"SATENGINE: CSatSUiSubSession::SendSmsSentEventToClient exiting" )
|
|
541 |
}
|
|
542 |
|
|
543 |
// -----------------------------------------------------------------------------
|
|
544 |
// Publish the P&S key KSatAppClosedUsingEndKey to indicate the occurred
|
|
545 |
// End Key action
|
|
546 |
// -----------------------------------------------------------------------------
|
|
547 |
//
|
|
548 |
void CSatSUiSubSession::PublishSatAppClosedUsingEndKey()
|
|
549 |
{
|
|
550 |
LOG( SIMPLE,
|
|
551 |
"SATENGINE:CSatSUiSubSession::PublishSatAppClosedUsingEndKey calling" )
|
|
552 |
|
|
553 |
TInt error = RProperty::Set( KPSUidSatServerInternal,
|
|
554 |
KSatAppClosedUsingEndKey, KSatAppTerminatedUsingEndKey );
|
|
555 |
LOG2( SIMPLE, "CSatSUiSubSession::PublishSatAppClosedUsingEndKey \
|
|
556 |
P&S key: %i", KSatAppTerminatedUsingEndKey )
|
|
557 |
LOG2(NORMAL,
|
|
558 |
"SATENGINE: CSatSUiSubSession::PublishSatAppClosedUsingEndKey - \
|
|
559 |
publish KSapAppClosedUsingEndKey and return: %d ", error );
|
|
560 |
|
|
561 |
LOG( SIMPLE,
|
|
562 |
"SATENGINE:CSatSUiSubSession::PublishSatAppClosedUsingEndKey exiting" )
|
|
563 |
}
|