phoneapp/phoneuicontrol/src/cphonestate.cpp
branchRCL_3
changeset 6 38529f706030
parent 5 2a26698d78ba
child 7 544e34b3255a
equal deleted inserted replaced
5:2a26698d78ba 6:38529f706030
   102 #include "cphonemediatorsender.h"
   102 #include "cphonemediatorsender.h"
   103 #include "cphonereleasecommand.h"
   103 #include "cphonereleasecommand.h"
   104 #include "cphonecontinueemergencycallcommand.h"
   104 #include "cphonecontinueemergencycallcommand.h"
   105 #include "cphonecallheadermanager.h"
   105 #include "cphonecallheadermanager.h"
   106 #include "cphonenumberentrymanager.h"
   106 #include "cphonenumberentrymanager.h"
       
   107 #include "mphonesecuritymodeobserver.h"
   107 #include "easydialingcommands.hrh"
   108 #include "easydialingcommands.hrh"
   108 
   109 
   109 
   110 
   110 // ================= MEMBER FUNCTIONS =======================
   111 // ================= MEMBER FUNCTIONS =======================
   111 
   112 
   672     // DTMFs can not be played with the user specified tone lengths. Also,
   673     // DTMFs can not be played with the user specified tone lengths. Also,
   673     // in general, DTMFs are tried to play only in numeric mode.
   674     // in general, DTMFs are tried to play only in numeric mode.
   674     TBool numericMode = iViewCommandHandle->HandleCommandL(
   675     TBool numericMode = iViewCommandHandle->HandleCommandL(
   675       EPhoneViewIsNumberEntryNumericMode ) == EPhoneViewResponseSuccess;
   676       EPhoneViewIsNumberEntryNumericMode ) == EPhoneViewResponseSuccess;
   676 
   677 
   677     if ( ( aKeyEvent.iModifiers & EModifierSpecial ) != 0 || !numericMode )
   678     // Key presses simulated by dialer are played even if in alphanumeric mode.
       
   679     const TBool simulatedByDialer = 
       
   680         ( ( aKeyEvent.iModifiers & ( EModifierNumLock | EModifierKeypad ) ) 
       
   681                 == ( EModifierNumLock | EModifierKeypad ) );
       
   682 
       
   683 
       
   684     if ( ( ( aKeyEvent.iModifiers & EModifierSpecial ) != 0 || !numericMode ) && !simulatedByDialer )
   678         {
   685         {
   679         return EFalse;
   686         return EFalse;
   680         }
   687         }
   681 
   688 
   682     return ETrue;
   689     return ETrue;
  1337             SetNumberEntryVisibilityL(ETrue);
  1344             SetNumberEntryVisibilityL(ETrue);
  1338             }
  1345             }
  1339 
  1346 
  1340         else
  1347         else
  1341             {
  1348             {
  1342             TPhoneCmdParamBoolean isSecurityMode;
  1349             if ( !iStateMachine->SecurityMode()->IsSecurityMode() )
  1343             iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
       
  1344 
       
  1345             if ( !isSecurityMode.Boolean() )
       
  1346                 {
  1350                 {
  1347                 __PHONELOG( EBasic, EPhoneControl,
  1351                 __PHONELOG( EBasic, EPhoneControl,
  1348                   "CPhoneState::HandlePhoneForegroundEventL - Force Idle to the foreground" );
  1352                   "CPhoneState::HandlePhoneForegroundEventL - Force Idle to the foreground" );
  1349                 // Bring Idle app to the foreground
  1353                 // Bring Idle app to the foreground
  1350                 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
  1354                 iViewCommandHandle->ExecuteCommandL( EPhoneViewBringIdleToForeground );
  1520     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCommandL( ) ");
  1524     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCommandL( ) ");
  1521     TBool commandStatus = ETrue;
  1525     TBool commandStatus = ETrue;
  1522     switch( aCommand )
  1526     switch( aCommand )
  1523         {
  1527         {
  1524         case EPhoneEmergencyCmdExit:
  1528         case EPhoneEmergencyCmdExit:
  1525             {
       
  1526             //cancel emergency mode.
       
  1527             TPhoneCmdParamBoolean booleanParam;
       
  1528             booleanParam.SetBoolean( EFalse );
       
  1529             iViewCommandHandle->ExecuteCommandL( EPhoneViewSetRestrictedDialer, &booleanParam );
       
  1530             }
       
  1531             // this should be bypasses?
  1529             // this should be bypasses?
  1532         case EPhoneDialerCallHandling:
  1530         case EPhoneDialerCallHandling:
  1533         case EPhoneCmdBack:
  1531         case EPhoneCmdBack:
  1534             BeginTransEffectLC( ENumberEntryClose );
  1532             BeginTransEffectLC( ENumberEntryClose );
  1535             // Remove number entry from screen
  1533             // Remove number entry from screen
  1641             // Launch Phonebook application
  1639             // Launch Phonebook application
  1642             TPhoneCmdParamAppInfo appInfoParam;
  1640             TPhoneCmdParamAppInfo appInfoParam;
  1643             appInfoParam.SetAppUid( KPhoneUidAppPhonebook );
  1641             appInfoParam.SetAppUid( KPhoneUidAppPhonebook );
  1644             iViewCommandHandle->ExecuteCommandL(
  1642             iViewCommandHandle->ExecuteCommandL(
  1645                 EPhoneViewActivateApp, &appInfoParam );
  1643                 EPhoneViewActivateApp, &appInfoParam );
  1646             }
       
  1647             break;
       
  1648 
       
  1649         case EPhoneNumberAcqSecurityDialer:
       
  1650             {
       
  1651             if ( IsOnScreenDialerSupported() && !IsNumberEntryUsedL() )
       
  1652                 {
       
  1653                 iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNote );
       
  1654                 TPhoneCmdParamBoolean visibleMode;
       
  1655                 visibleMode.SetBoolean( ETrue );
       
  1656                 iViewCommandHandle->ExecuteCommandL(
       
  1657                             EPhoneViewSetStatusPaneVisible, &visibleMode );
       
  1658 
       
  1659 
       
  1660                 // Set emergency CBA, empty - exit
       
  1661                 iCbaManager->SetCbaL( EPhoneEmergencyModeNoteCBA );
       
  1662 
       
  1663                 // Set dialer to restricted mode.
       
  1664                 TPhoneCmdParamBoolean booleanParam;
       
  1665                 booleanParam.SetBoolean( ETrue );
       
  1666                 iViewCommandHandle->ExecuteCommandL( EPhoneViewSetRestrictedDialer, &booleanParam );
       
  1667 
       
  1668                 NumberEntryManagerL()->CreateNumberEntryL();
       
  1669                 }
       
  1670             }
  1644             }
  1671             break;
  1645             break;
  1672 
  1646 
  1673         case EPhoneDialerCmdContacts:
  1647         case EPhoneDialerCmdContacts:
  1674             {
  1648             {
  3384 // CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled
  3358 // CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled
  3385 // -----------------------------------------------------------
  3359 // -----------------------------------------------------------
  3386 //
  3360 //
  3387 EXPORT_C TBool CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled()
  3361 EXPORT_C TBool CPhoneState::IsSimStateNotPresentWithSecurityModeEnabled()
  3388     {
  3362     {
  3389     TPhoneCmdParamBoolean isSecurityMode;
  3363     if ( SimState() == EPESimNotPresent && iStateMachine->SecurityMode()->IsSecurityMode() )
  3390     TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode ) );
       
  3391     if ( SimState() == EPESimNotPresent && isSecurityMode.Boolean() )
       
  3392         {
  3364         {
  3393         return ETrue;
  3365         return ETrue;
  3394         }
  3366         }
  3395     else
  3367     else
  3396         {
  3368         {
  3440 // -----------------------------------------------------------------------------
  3412 // -----------------------------------------------------------------------------
  3441 //
  3413 //
  3442 EXPORT_C void CPhoneState::StartShowSecurityNoteL()
  3414 EXPORT_C void CPhoneState::StartShowSecurityNoteL()
  3443     {
  3415     {
  3444     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::StartShowSecurityNoteL ");
  3416     __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::StartShowSecurityNoteL ");
  3445 
       
  3446     // Set security mode on.
       
  3447     TPhoneCmdParamBoolean securityMode;
       
  3448     securityMode.SetBoolean( ETrue );
       
  3449     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSecurityMode, &securityMode );
       
  3450 
  3417 
  3451     // Remove number entry from screen
  3418     // Remove number entry from screen
  3452     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
  3419     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
  3453 
  3420 
  3454     TPhoneCmdParamBoolean visibleMode;
  3421     TPhoneCmdParamBoolean visibleMode;
  3872             &numberEntryCountParam );
  3839             &numberEntryCountParam );
  3873     TInt neLength( numberEntryCountParam.Integer() );
  3840     TInt neLength( numberEntryCountParam.Integer() );
  3874 
  3841 
  3875     if( neLength == 1 )
  3842     if( neLength == 1 )
  3876         {
  3843         {
  3877         TPhoneCmdParamBoolean isSecurityMode;
  3844          if ( !iStateMachine->SecurityMode()->IsSecurityMode() )
  3878         iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
       
  3879 
       
  3880         if ( !isSecurityMode.Boolean() )
       
  3881             {
  3845             {
  3882             OnlyHashInNumberEntryL();
  3846             OnlyHashInNumberEntryL();
  3883             }
  3847             }
  3884         }
  3848         }
  3885     }
  3849     }
  4083         &globalNotifierParam );
  4047         &globalNotifierParam );
  4084     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
  4048     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetEikonNotifiersDisabled,
  4085         &globalNotifierParam );
  4049         &globalNotifierParam );
  4086 
  4050 
  4087     // uncapture App and Camera keys if not security mode
  4051     // uncapture App and Camera keys if not security mode
  4088     TPhoneCmdParamBoolean isSecurityMode;
  4052     if ( !iStateMachine->SecurityMode()->IsSecurityMode() )
  4089     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSecurityModeStatus, &isSecurityMode );
       
  4090     if ( !isSecurityMode.Boolean() )
       
  4091         {
  4053         {
  4092         CaptureKeysDuringCallNotificationL( EFalse );
  4054         CaptureKeysDuringCallNotificationL( EFalse );
  4093         }
  4055         }
  4094     
  4056     
  4095     CPhonePubSubProxy::Instance()->ChangePropertyValue(
  4057     CPhonePubSubProxy::Instance()->ChangePropertyValue(