cellular/telephonysettings/src/PsetCallWaiting.cpp
branchRCL_3
changeset 19 7d48bed6ce0c
parent 0 ff3b6d0fd310
child 20 987c9837762f
equal deleted inserted replaced
18:594d59766373 19:7d48bed6ce0c
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 //  Include Files
    20 //  Include Files
    21 #include "PsetCallWaiting.h"
    21 #include "psetcallwaiting.h" 
    22 #include "MPsetCallWaitingObs.h"
    22 #include "mpsetcallwaitingobs.h" 
    23 #include "nwdefs.h"             
    23 #include "nwdefs.h"             
    24 #include "PSetPanic.h"          
    24 #include "psetpanic.h" 
    25 #include "PsetConstants.h"      
    25 #include "psetconstants.h" 
    26 #include "MPsetRequestObs.h"
    26 #include "mpsetrequestobs.h" 
    27 #include "PSetUtility.h"
    27 #include "psetutility.h" 
    28 #include "PhoneSettingsLogger.h"
    28 #include "phonesettingslogger.h" 
    29 
    29 
    30 #include "PsetVariationProxy.h"
    30 #include "psetvariationproxy.h" 
    31 #include <settingsinternalcrkeys.h>
    31 #include <settingsinternalcrkeys.h> 
    32 
    32 
    33 // CONSTANTS    
    33 // CONSTANTS    
    34 _LIT( KPSNameOfClass, "CPsetCallWaiting" );
    34 _LIT( KPSNameOfClass, "CPsetCallWaiting" );
    35 
    35 
    36 //  MEMBER FUNCTIONS
    36 //  MEMBER FUNCTIONS
   105 EXPORT_C CPsetCallWaiting::~CPsetCallWaiting()
   105 EXPORT_C CPsetCallWaiting::~CPsetCallWaiting()
   106     {
   106     {
   107     Cancel();
   107     Cancel();
   108     iReqObserver = NULL;
   108     iReqObserver = NULL;
   109 
   109 
   110 	if ( iSsSettings )
   110     if ( iSsSettings )
   111         {
   111         {
   112         iSsSettings->Cancel( ESSSettingsAls, *this ); 
   112         iSsSettings->Cancel( ESSSettingsAls, *this ); 
   113         iSsSettings->Close();
   113         iSsSettings->Close();
   114         }
   114         }
   115     delete iSsSettings;
   115     delete iSsSettings;
   116     iSsSettings = NULL;
   116     iSsSettings = NULL;
   117 	
   117     
   118     delete iCwInterrogator;
   118     delete iCwInterrogator;
   119     iCwInterrogator = NULL;
   119     iCwInterrogator = NULL;
   120     }
   120     }
   121     
   121     
   122 // ---------------------------------------------------------------------------
   122 // ---------------------------------------------------------------------------
   123 // 
   123 // 
   124 // If SsSettings notifies of settings change, copy new value to member variable.
   124 // If SsSettings notifies of settings change, copy new value to member variable.
   125 // 
   125 // 
   126 // ---------------------------------------------------------------------------
   126 // ---------------------------------------------------------------------------
   127 void CPsetCallWaiting::PhoneSettingChanged( TSSSettingsSetting aSetting, TInt aNewValue )
   127 void CPsetCallWaiting::PhoneSettingChanged( TSSSettingsSetting aSetting, TInt aNewValue )
   128 	{
   128     {
   129 	__PHSLOGSTRING("[PHS]--> PhoneSettingChanged::ValidateBsc" );
   129     __PHSLOGSTRING("[PHS]--> PhoneSettingChanged::ValidateBsc" );
   130 	if ( aSetting == ESSSettingsAls )
   130     if ( aSetting == ESSSettingsAls )
   131         {
   131         {
   132         iAls = static_cast <TSSSettingsAlsValue> (aNewValue);
   132         iAls = static_cast <TSSSettingsAlsValue> (aNewValue);
   133         }
   133         }
   134     __PHSLOGSTRING("[PHS] <--PhoneSettingChanged::ValidateBsc" );
   134     __PHSLOGSTRING("[PHS] <--PhoneSettingChanged::ValidateBsc" );
   135 	}
   135     }
   136 
   136 
   137 // ---------------------------------------------------------------------------
   137 // ---------------------------------------------------------------------------
   138 // 
   138 // 
   139 // Validates used bsc, if EUnknown, updates to real value
   139 // Validates used bsc, if EUnknown, updates to real value
   140 // 
   140 // 
   191     RMobilePhone::TMobilePhoneServiceAction cwAction = 
   191     RMobilePhone::TMobilePhoneServiceAction cwAction = 
   192         RMobilePhone::EServiceActionUnspecified;
   192         RMobilePhone::EServiceActionUnspecified;
   193     
   193     
   194     RMobilePhone::TMobileService cwBasicServiceGroup;
   194     RMobilePhone::TMobileService cwBasicServiceGroup;
   195 
   195 
   196 	ValidateBsc( aBsc );
   196     ValidateBsc( aBsc );
   197 
   197 
   198     if ( aBsc == EAltTele )
   198     if ( aBsc == EAltTele )
   199         {
   199         {
   200         cwBasicServiceGroup = PSetUtility::VerifyAltLineUseL();
   200         cwBasicServiceGroup = PSetUtility::VerifyAltLineUseL();
   201         }
   201         }
   202 
   202 
   203 	cwBasicServiceGroup = PSetUtility::ChangeToEtelInternal( aBsc );
   203     cwBasicServiceGroup = PSetUtility::ChangeToEtelInternal( aBsc );
   204 
   204 
   205     if ( aSetting == EActivateCallWaiting )
   205     if ( aSetting == EActivateCallWaiting )
   206         {
   206         {
   207         cwAction = RMobilePhone::EServiceActionActivate;
   207         cwAction = RMobilePhone::EServiceActionActivate;
   208         }
   208         }
   270     // When interrupting a note, does not leave.
   270     // When interrupting a note, does not leave.
   271     // This needs to be done first, since notes must be cleared from screen
   271     // This needs to be done first, since notes must be cleared from screen
   272     // even though request is not active.
   272     // even though request is not active.
   273     iObserver->SetEngineContact( *this );
   273     iObserver->SetEngineContact( *this );
   274     // Does not leave
   274     // Does not leave
   275 	TRAPD( err, iObserver->HandleCWRequestingL( EFalse, ETrue ) );
   275     TRAPD( err, iObserver->HandleCWRequestingL( EFalse, ETrue ) );
   276 	
   276     
   277     if ( !IsActive() || err != KErrNone )
   277     if ( !IsActive() || err != KErrNone )
   278         {
   278         {
   279         return KErrGeneral;
   279         return KErrGeneral;
   280         }            
   280         }            
   281     Cancel();
   281     Cancel();
   345                     && cwInfo.iStatus != RMobilePhone::ECallWaitingStatusUnknown )
   345                     && cwInfo.iStatus != RMobilePhone::ECallWaitingStatusUnknown )
   346                     {
   346                     {
   347                     // pass on the status if the current status is still 
   347                     // pass on the status if the current status is still 
   348                     // unknown and the received status is not unknown
   348                     // unknown and the received status is not unknown
   349                     switch ( cwInfo.iStatus )
   349                     switch ( cwInfo.iStatus )
   350                     	{
   350                         {
   351                     	case RMobilePhone::ECallWaitingStatusNotProvisioned:
   351                         case RMobilePhone::ECallWaitingStatusNotProvisioned:
   352                     		{
   352                             {
   353                     		status = EStatusNotProvisioned;
   353                             status = EStatusNotProvisioned;
   354                     		break;
   354                             break;
   355                     		}	
   355                             }   
   356                     		
   356                             
   357                     		case RMobilePhone::ECallWaitingStatusNotAvailable:
   357                             case RMobilePhone::ECallWaitingStatusNotAvailable:
   358                     		{		
   358                             {       
   359                     		status = EStatusNotAvailable;
   359                             status = EStatusNotAvailable;
   360                     		break;
   360                             break;
   361                     		}
   361                             }
   362                     		
   362                             
   363                     		default:
   363                             default:
   364                     		{	
   364                             {   
   365                     		status = TGetCallWaitingStatus( cwInfo.iStatus );
   365                             status = TGetCallWaitingStatus( cwInfo.iStatus );
   366                     		break;		
   366                             break;      
   367                     		}
   367                             }
   368                     	}
   368                         }
   369                     }
   369                     }
   370                     
   370                     
   371                 arrayOfBsc[i] = static_cast <TUint8> 
   371                 arrayOfBsc[i] = static_cast <TUint8> 
   372                     ( PSetUtility::ChangeToGSM( cwInfo.iServiceGroup ) );
   372                     ( PSetUtility::ChangeToGSM( cwInfo.iServiceGroup ) );
   373                 i++;                                                                
   373                 i++;