coreapplicationuis/SysAp/Src/SysApAppUi.cpp
branchRCL_3
changeset 82 4610cd70c542
parent 70 739cef680932
equal deleted inserted replaced
70:739cef680932 82:4610cd70c542
    57 #include <StringLoader.h>
    57 #include <StringLoader.h>
    58 #include <secuisystemlock.h>
    58 #include <secuisystemlock.h>
    59 #include <secui.h>
    59 #include <secui.h>
    60 #include <settingsinternalcrkeys.h>
    60 #include <settingsinternalcrkeys.h>
    61 
    61 
    62 #include "sysapganhandler.h"
       
    63 #include <AknNotifierController.h>
    62 #include <AknNotifierController.h>
    64 #include <eikappui.h>
    63 #include <eikappui.h>
    65 #include <es_enum.h>
    64 #include <es_enum.h>
    66 #include <data_caging_path_literals.hrh>
    65 #include <data_caging_path_literals.hrh>
    67 #include <eikon.hrh>
    66 #include <eikon.hrh>
    68 
    67 
    69 #include "SysApSimChanged.h"
    68 #include "SysApSimChanged.h"
    70 
    69 
    71 #include <sysap.rsg>
    70 #include <SysAp.rsg>
    72 #include "SysApLightsController.h"
    71 #include "SysApLightsController.h"
    73 
    72 
    74 #include "SysApPubSubObserver.h"
    73 #include "SysApPubSubObserver.h"
    75 #include "SysApProfileObserver.h"
    74 #include "SysApProfileObserver.h"
    76 
    75 
   246 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   245 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   247     iShutdownContinued( EFalse ),
   246     iShutdownContinued( EFalse ),
   248     iSysApAudioRoutingObserver( NULL ),
   247     iSysApAudioRoutingObserver( NULL ),
   249     iSysApCenRepCallForwardingObserver( NULL ),
   248     iSysApCenRepCallForwardingObserver( NULL ),
   250     iSysApCenRepMsgWaitingObserver( NULL ),
   249     iSysApCenRepMsgWaitingObserver( NULL ),
   251     iSysApGanHandler( NULL ),
   250 	iKeyBoardRepeatCount(-1)
   252   	iKeyBoardRepeatCount(-1)
       
   253     {
   251     {
   254     TRACES( RDebug::Print( _L("CSysApAppUi::CSysApAppUi()") ) );
   252     TRACES( RDebug::Print( _L("CSysApAppUi::CSysApAppUi()") ) );
   255     }
   253     }
   256 
   254 
   257 // ----------------------------------------------------------------------------
   255 // ----------------------------------------------------------------------------
   488 
   486 
   489     // Create HAC setting observer now because telephony state may change before entering to normal state
   487     // Create HAC setting observer now because telephony state may change before entering to normal state
   490     TRACES( RDebug::Print( _L("CCSysApAppUi::ConstructL  trying CSysApCenRepHacSettingObserver::NewL") ) );
   488     TRACES( RDebug::Print( _L("CCSysApAppUi::ConstructL  trying CSysApCenRepHacSettingObserver::NewL") ) );
   491     iSysApCenRepHacSettingObserver = CSysApCenRepHacSettingObserver::NewL( *this );
   489     iSysApCenRepHacSettingObserver = CSysApCenRepHacSettingObserver::NewL( *this );
   492     
   490     
   493    
   491     DeactivatePSMifBatteryNotLowL ();
   494     
   492     
   495     if( iSysApFeatureManager->GanSupported() )
       
   496         {
       
   497 
       
   498 
       
   499 				RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsGanPropertyGanMode, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy  );
       
   500 				RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsGanPropertySignalLevel, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy  );
       
   501         iSysApGanHandler = CSysApGanHandler::NewL( *this );
       
   502         }
       
   503 
       
   504     TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: END") ) );
   493     TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: END") ) );
   505     }
   494     }
   506 
   495 
   507 
   496 
   508 // ----------------------------------------------------------------------------
   497 // ----------------------------------------------------------------------------
   578 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   567 #endif // RD_STARTUP_ANIMATION_CUSTOMIZATION
   579 
   568 
   580     delete iSysApPowerKeyMenuObserver;
   569     delete iSysApPowerKeyMenuObserver;
   581 
   570 
   582     delete iSysApStartupController;
   571     delete iSysApStartupController;
   583 
       
   584     delete iSysApGanHandler;
       
   585 
   572 
   586 #ifdef RD_MULTIPLE_DRIVE
   573 #ifdef RD_MULTIPLE_DRIVE
   587     iInsertedMemoryCards.Close();
   574     iInsertedMemoryCards.Close();
   588     delete  iSysApDriveEjectHandler;
   575     delete  iSysApDriveEjectHandler;
   589     delete iSysApDriveUnlockHandler;
   576     delete iSysApDriveUnlockHandler;
   760 				TInt errorCode2 = RProperty::Get( KPSUidStartup, KStartupSecurityCodeQueryStatus, securityQueryState);
   747 				TInt errorCode2 = RProperty::Get( KPSUidStartup, KStartupSecurityCodeQueryStatus, securityQueryState);
   761             	TRACES( RDebug::Print( _L( "CSysApAppUi::HandleKeyEventL(): Reading value of KCoreAppUIsDisableKeyguard - State Value: %d"),alarmState));
   748             	TRACES( RDebug::Print( _L( "CSysApAppUi::HandleKeyEventL(): Reading value of KCoreAppUIsDisableKeyguard - State Value: %d"),alarmState));
   762             	TRACES( RDebug::Print( _L( "CSysApAppUi::HandleKeyEventL(): Reading value of KStartupSecurityCodeQueryStatus - State Value: %d"),securityQueryState));
   749             	TRACES( RDebug::Print( _L( "CSysApAppUi::HandleKeyEventL(): Reading value of KStartupSecurityCodeQueryStatus - State Value: %d"),securityQueryState));
   763             	TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) );
   750             	TInt callState( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) );
   764 				//Disable keylock if Alarm is active or if a Security code query is active on the display
   751 				//Disable keylock if Alarm is active or if a Security code query is active on the display
   765 				if ( alarmState == ECoreAppUIsDisableKeyguard || securityQueryState == ESecurityQueryActive 
   752 				if ( alarmState == ECoreAppUIsDisableKeyguard || securityQueryState == ESecurityQueryActive )
   766 					  || callState == EPSCTsyCallStateRinging || iDeviceLockEnabled)
       
   767                  	{
   753                  	{
   768 					KeyLock().DisableWithoutNote();               	
   754 					KeyLock().DisableWithoutNote();               	
   769                  	}
   755                  	}
   770 			    else
   756 			    else
   771          		 	{
   757          		 	{
   772                     KeyLock().EnableWithoutNote();
   758                     if( callState != EPSCTsyCallStateConnected && !iDeviceLockEnabled)
       
   759                         {
       
   760                         KeyLock().EnableWithoutNote();
       
   761                         }
   773          			}
   762          			}
   774                 }
   763                 }
   775             else
   764             else
   776                 {
   765                 {
   777                 if ( aKeyEvent.iScanCode == EStdKeyDevice2 )
   766                 if ( aKeyEvent.iScanCode == EStdKeyDevice2 )
  1901 // ----------------------------------------------------------------------------
  1890 // ----------------------------------------------------------------------------
  1902 
  1891 
  1903 void CSysApAppUi::UpdateSignalBarsL( const TInt aState )
  1892 void CSysApAppUi::UpdateSignalBarsL( const TInt aState )
  1904     {
  1893     {
  1905     TRACES( RDebug::Print( _L("CSysApAppUi::UpdateSignalBarsL aState: %d"), aState ) );
  1894     TRACES( RDebug::Print( _L("CSysApAppUi::UpdateSignalBarsL aState: %d"), aState ) );
  1906     if( iSysApGanHandler && iSysApGanHandler->IsInGanMode() )
  1895 
  1907         {
  1896     if( aState == KAknSignalOffLineMode || (iSysApOfflineModeController->OfflineModeActive() && !iEmergencyCallActive) )
  1908         iSignalNotify->SetSignalLevelL( iSysApGanHandler->GanSignalLevel() );
       
  1909         }
       
  1910 	else if( aState == KAknSignalOffLineMode || (iSysApOfflineModeController->OfflineModeActive() && !iEmergencyCallActive) )
       
  1911         {
  1897         {
  1912         iSignalNotify->SetSignalLevelL( KAknSignalOffLineMode );
  1898         iSignalNotify->SetSignalLevelL( KAknSignalOffLineMode );
  1913         }
  1899         }
  1914     else if( aState <= 0 )
  1900     else if( aState <= 0 )
  1915         {
  1901         {
  1958             {
  1944             {
  1959             iSignalNotify->SetCommonPacketDataStateL( EAknSignalCommonPacketDataIndicatorOff );
  1945             iSignalNotify->SetCommonPacketDataStateL( EAknSignalCommonPacketDataIndicatorOff );
  1960             }
  1946             }
  1961         iSignalNotify->SetWcdmaStateL( EAknSignalWcdmaIndicatorOff );
  1947         iSignalNotify->SetWcdmaStateL( EAknSignalWcdmaIndicatorOff );
  1962         iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff);
  1948         iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff);
  1963         TRACES( RDebug::Print(_L("CSysApAppUi::SetSignalIndicatorL: gan off" ) ) );
       
  1964         iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorOff );
       
  1965         }
  1949         }
  1966     else
  1950     else
  1967         {
  1951         {
  1968         if( iSysApGanHandler && iSysApGanHandler->IsInGanMode() )
  1952         // The device is in Online Mode
  1969             {
  1953         switch ( networkMode )
  1970             // Enter GAN: set GAN signal bar
  1954             {
  1971             SetSignalIndicatorGanL();
  1955             case ESysApGSM:
  1972             iGanEnabled = ETrue;
  1956                 SetSignalIndicatorGsmL();
  1973             }
  1957                 break;
  1974         else
  1958 
  1975             {
  1959             case ESysApWCDMA:
  1976             if( iGanEnabled )
  1960                 SetSignalIndicatorWcdmaL();
  1977                 {
  1961                 break;
  1978                 UpdateSignalBarsL();
  1962 
  1979                 iGanEnabled = EFalse;
  1963             default:
  1980                 }
  1964                 break;
  1981 
       
  1982             // The device is in Online Mode
       
  1983             switch ( networkMode )
       
  1984                 {
       
  1985                 case ESysApGSM:
       
  1986                     SetSignalIndicatorGsmL();
       
  1987                     break;
       
  1988 
       
  1989                 case ESysApWCDMA:
       
  1990                     SetSignalIndicatorWcdmaL();
       
  1991                     break;
       
  1992 
       
  1993                 default:
       
  1994                     break;
       
  1995                 }
       
  1996             }
  1965             }
  1997         }
  1966         }
  1998     }
  1967     }
  1999 
  1968 
  2000 // ----------------------------------------------------------------------------
  1969 // ----------------------------------------------------------------------------
  2238         }
  2207         }
  2239     else
  2208     else
  2240         {
  2209         {
  2241         iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff );
  2210         iSignalNotify->SetHsdpaStateL( EAknSignalHsdpaIndicatorOff );
  2242         iSignalNotify->SetWcdmaStateL( signalWcdmaIndicatorState );
  2211         iSignalNotify->SetWcdmaStateL( signalWcdmaIndicatorState );
  2243         }
       
  2244     }
       
  2245 
       
  2246 // ----------------------------------------------------------------------------
       
  2247 // CSysApAppUi::SetSignalIndicatorGanL()
       
  2248 // ----------------------------------------------------------------------------
       
  2249 void CSysApAppUi::SetSignalIndicatorGanL()
       
  2250     {
       
  2251     TRACES( RDebug::Print(_L("CSysApAppUi::SetSignalIndicatorGanL: available" ) ) );
       
  2252 
       
  2253     TInt gprsStatus( 0 );
       
  2254     gprsStatus = StateOfProperty( KUidSystemCategory, KPSUidGprsStatusValue );
       
  2255 
       
  2256     TRACES( RDebug::Print( _L("CSysApAppUi::SetSignalIndicatorGanL gprsStatus: %d" ), gprsStatus ) );
       
  2257 
       
  2258     switch ( gprsStatus )
       
  2259         {
       
  2260         case EPSGprsContextActive:
       
  2261             iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorContext );
       
  2262             break;
       
  2263 
       
  2264         case EPSGprsContextActivating:
       
  2265             iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorEstablishingContext );
       
  2266             break;
       
  2267 
       
  2268         case EPSGprsSuspend:
       
  2269             iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorSuspended );
       
  2270             break;
       
  2271 
       
  2272         case EPSGprsAttach:
       
  2273             iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorAttached );
       
  2274             break;
       
  2275 
       
  2276         case EPSGprsMultibleContextActive:
       
  2277             iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorMultipdp );
       
  2278             break;
       
  2279 
       
  2280         case EPSGprsUnattached:
       
  2281         default:
       
  2282             iSignalNotify->SetUmaStateL( EAknSignalUmaIndicatorAvailable );
       
  2283             break;
       
  2284         }
  2212         }
  2285     }
  2213     }
  2286 
  2214 
  2287 // ----------------------------------------------------------------------------
  2215 // ----------------------------------------------------------------------------
  2288 // CSysApAppUi::HandleGprsNotesL()
  2216 // CSysApAppUi::HandleGprsNotesL()
  4556     DoSwStateNormalConstructionL();
  4484     DoSwStateNormalConstructionL();
  4557 
  4485 
  4558     InitializeStatusPaneAreaL();
  4486     InitializeStatusPaneAreaL();
  4559     CheckSilentModeL();
  4487     CheckSilentModeL();
  4560     HandleAccessoryProfileInStartupL();
  4488     HandleAccessoryProfileInStartupL();
  4561     DeactivatePSMifBatteryNotLowL ();
       
  4562     
  4489     
  4563     if ( iSysApFeatureManager->MmcSupported() )
  4490     if ( iSysApFeatureManager->MmcSupported() )
  4564         {
  4491         {
  4565 #ifndef RD_MULTIPLE_DRIVE
  4492 #ifndef RD_MULTIPLE_DRIVE
  4566         MountMMC();
  4493         MountMMC();
  6853                 ShowQueryL( ESysApBattLowPowerSavingQuery );
  6780                 ShowQueryL( ESysApBattLowPowerSavingQuery );
  6854                 }
  6781                 }
  6855             else // default low warning note must be shown
  6782             else // default low warning note must be shown
  6856                 {
  6783                 {
  6857                 // activate partial power save mode on first low warning
  6784                 // activate partial power save mode on first low warning
  6858                 iSysApPsmController->DoEnablePartialPsm( ETrue ); // activated on first warning note
  6785                 // Enabling Partial Psm automatically disabled 
       
  6786                 //iSysApPsmController->DoEnablePartialPsm( ETrue ); // activated on first warning note 
  6859                 //Display Battery Low note.
  6787                 //Display Battery Low note.
  6860                 ShowUiNoteL( EBatteryLowNote );    
  6788                 ShowUiNoteL( EBatteryLowNote );    
  6861                 }                
  6789                 }                
  6862             }
  6790             }
  6863         else
  6791         else
  6936     
  6864     
  6937     if ( aEnable )
  6865     if ( aEnable )
  6938         {
  6866         {
  6939         iSysApPsmController->DoEnableFullPsm( ETrue );    
  6867         iSysApPsmController->DoEnableFullPsm( ETrue );    
  6940         }
  6868         }
       
  6869     
       
  6870     // Enabling Partial Psm when the user selects 'No' is diabled.
       
  6871     /*
  6941     else
  6872     else
  6942         {
  6873         {
  6943         iSysApPsmController->DoEnablePartialPsm( ETrue );     
  6874         //iSysApPsmController->DoEnablePartialPsm( ETrue );  // bhaskar     
  6944         }        
  6875         }
       
  6876      */
       
  6877               
  6945     }
  6878     }
  6946 
  6879 
  6947 // ----------------------------------------------------------------------------
  6880 // ----------------------------------------------------------------------------
  6948 // CSysApAppUi::HandleDeactivatePsmQueryResponse
  6881 // CSysApAppUi::HandleDeactivatePsmQueryResponse
  6949 // ----------------------------------------------------------------------------
  6882 // ----------------------------------------------------------------------------