satengine/SatServer/Commands/SendSmCmd/src/CSendSmHandler.cpp
branchRCL_3
changeset 9 71e7b994dff4
parent 0 ff3b6d0fd310
equal deleted inserted replaced
8:ba42c4bd84dd 9:71e7b994dff4
     1 /*
     1 /*
     2 * Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   134 // -----------------------------------------------------------------------------
   134 // -----------------------------------------------------------------------------
   135 //
   135 //
   136 void CSendSmHandler::Event( TInt aEvent )
   136 void CSendSmHandler::Event( TInt aEvent )
   137     {
   137     {
   138     LOG( SIMPLE, "SENDSM: CSendSmHandler::Event calling" )
   138     LOG( SIMPLE, "SENDSM: CSendSmHandler::Event calling" )
   139     LOG2( SIMPLE, "SENDSM:   Event %i", aEvent )
   139     LOG2( SIMPLE, "SENDSM: CSendSmHandler::Event iWaitingUiLaunch=%d",  
       
   140     iWaitingUiLaunch ) 
       
   141     LOG2( SIMPLE, "SENDSM: CSendSmHandler::Event IsActive=%d", IsActive() ) 
   140     if ( MSatUtils::EMoSmControlExecuting == aEvent )
   142     if ( MSatUtils::EMoSmControlExecuting == aEvent )
   141         {
   143         {
   142         LOG( NORMAL, "SENDSM:   Event EMoSmControlExecuting" )
   144         LOG( NORMAL, "SENDSM:   Event EMoSmControlExecuting" )
   143         iMoSmControlActive = ETrue;
   145         iMoSmControlActive = ETrue;
   144         }
   146         }
   145     else if ( MSatUtils::EMoSmControlDone == aEvent )
   147     else if ( MSatUtils::EMoSmControlDone == aEvent )
   146         {
   148         {
   147         LOG( NORMAL, "SENDSM:   Event EMoSmControlDone" )
   149         LOG( NORMAL, "SENDSM:   Event EMoSmControlDone" )
   148         iMoSmControlActive = EFalse;
   150         iMoSmControlActive = EFalse;
   149         // Check if Sendsm is waiting.
   151         // Check if Sendsm is waiting.
   150         if ( !IsActive() )
   152         // Completing call control should not trigger this command handler 
       
   153         // if it is still waiting for UI to be launched. 
       
   154         if ( !IsActive() && !iWaitingUiLaunch ) 
   151             {
   155             {
   152             LOG( SIMPLE, "SENDSM: CSendSmHandler::Event sendsm" )
   156             LOG( SIMPLE, "SENDSM: CSendSmHandler::Event sendsm" )
   153             // Do the Sendsm.
   157             // Do the Sendsm.
   154             HandleCommand();
   158             HandleCommand();
   155             }
   159             }
   511 
   515 
   512     // If mo sm control is active, command waits for the EMoSmControlDone event
   516     // If mo sm control is active, command waits for the EMoSmControlDone event
   513     // and sends the command then.
   517     // and sends the command then.
   514     if ( !iMoSmControlActive )
   518     if ( !iMoSmControlActive )
   515         {
   519         {
       
   520         LOG2( SIMPLE,  
       
   521         "SENDSM: CSendSmHandler::HandleCommand: !iMoSmControlActive, \
       
   522         iNeedUiSession=%d",
       
   523         iNeedUiSession ) 
       
   524 
   516         iUtils->NotifyEvent( MSatUtils::ESendSmExecuting );
   525         iUtils->NotifyEvent( MSatUtils::ESendSmExecuting );
   517 
   526 
   518         if ( !iNeedUiSession )
   527         if ( !iNeedUiSession )
   519             {
   528             {
   520             LOG( SIMPLE, 
   529             LOG( SIMPLE, 
   612                 TRAP_IGNORE( iUtils->RegisterServiceRequestL(
   621                 TRAP_IGNORE( iUtils->RegisterServiceRequestL(
   613                     ESatSProactiveNotification,
   622                     ESatSProactiveNotification,
   614                     ESatSProactiveNotificationResponse,
   623                     ESatSProactiveNotificationResponse,
   615                     this ) )
   624                     this ) )
   616 
   625 
       
   626                 LOG( SIMPLE, 
       
   627                     "SENDSM: CSendSmHandler::HandleCommand send ui notification" )
   617                 iUtils->SatUiHandler().UiSession()->SendCommand(
   628                 iUtils->SatUiHandler().UiSession()->SendCommand(
   618                     &iNotificationDataPckg,
   629                     &iNotificationDataPckg,
   619                     &iNotificationRspPckg,
   630                     &iNotificationRspPckg,
   620                     ESatSProactiveNotification );
   631                     ESatSProactiveNotification );
   621 
   632 
   622                 iNotificationSent = ETrue;
   633                 iNotificationSent = ETrue;
   623                 }
   634                 }
   624             else
   635             else
   625                 {
   636                 {
       
   637                 LOG( SIMPLE, 
       
   638                 "SENDSM: CSendSmHandler::HandleCommand user confirmation needed" ) 
   626                 // Register service request handler for SendSm command,
   639                 // Register service request handler for SendSm command,
   627                 // If there is already service request for query, registering
   640                 // If there is already service request for query, registering
   628                 // updates command handler, so client responses comes to this
   641                 // updates command handler, so client responses comes to this
   629                 // command handler
   642                 // command handler
   630                 TRAP_IGNORE( iUtils->RegisterServiceRequestL(
   643                 TRAP_IGNORE( iUtils->RegisterServiceRequestL(
   631                     ESatSProactiveQuery,
   644                     ESatSProactiveQuery,
   632                     ESatSProactiveQueryResponse,
   645                     ESatSProactiveQueryResponse,
   633                     this ) )
   646                     this ) )
   634 
   647 
   635                 iNotificationSent = EFalse;
   648                 iNotificationSent = EFalse;
       
   649 
       
   650                 LOG( SIMPLE, 
       
   651                 "SENDSM: CSendSmHandler::HandleCommand send user confirmation request" ) 
   636 
   652 
   637                 // Ask the user permission to send sms. Reply will come
   653                 // Ask the user permission to send sms. Reply will come
   638                 // to ClientResponse method.
   654                 // to ClientResponse method.
   639                 iUtils->SatUiHandler().UiSession()->SendCommand(
   655                 iUtils->SatUiHandler().UiSession()->SendCommand(
   640                     &iQueryPckg,
   656                     &iQueryPckg,