coreapplicationuis/SysAp/Src/SysApAppUi.cpp
branchRCL_3
changeset 15 312d2b433792
parent 10 469fa8a78de7
child 17 5e7d68cc22e0
equal deleted inserted replaced
10:469fa8a78de7 15:312d2b433792
   735         else if ( aType == EEventKeyUp )
   735         else if ( aType == EEventKeyUp )
   736             {
   736             {
   737             TRACES( RDebug::Print( _L( "CSysApAppUi::HandleKeyEventL(): aType == EEventKeyUp, PowerKeyIsLockKey = %d, iLastPowerKeyWasShort = %d, iPowerKeyPopupMenuActive = %d, iCharging = %d" ), iSysApFeatureManager->PowerKeyIsLockKey(), iLastPowerKeyWasShort, iPowerKeyPopupMenuActive, iCharging ) );
   737             TRACES( RDebug::Print( _L( "CSysApAppUi::HandleKeyEventL(): aType == EEventKeyUp, PowerKeyIsLockKey = %d, iLastPowerKeyWasShort = %d, iPowerKeyPopupMenuActive = %d, iCharging = %d" ), iSysApFeatureManager->PowerKeyIsLockKey(), iLastPowerKeyWasShort, iPowerKeyPopupMenuActive, iCharging ) );
   738             if ( iSysApFeatureManager->PowerKeyIsLockKey()
   738             if ( iSysApFeatureManager->PowerKeyIsLockKey()
   739                  && iLastPowerKeyWasShort 
   739                  && iLastPowerKeyWasShort 
   740 				 				 && !iPowerKeyPopupMenuActive
   740 				 && !iPowerKeyPopupMenuActive
   741                  && !haveStatusPane  
   741                  && !haveStatusPane  
   742                  && ( aKeyEvent.iScanCode == EStdKeyDevice2 ) )
   742                  && ( aKeyEvent.iScanCode == EStdKeyDevice2 ) )
   743                 {
   743                 {
   744                 //if the power key is the lock key && the last keypress was short && the power menu is not active
   744                 //if the power key is the lock key && the last keypress was short && the power menu is not active
   745                 //then lock the phone
   745                 //then lock the phone
   746                 KeyLock().EnableWithoutNote();
   746                 TInt alarmState=0, securityQueryState=0;
       
   747          		TInt errorCode = RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsDisableKeyguard, alarmState );
       
   748 				TInt errorCode2 = RProperty::Get( KPSUidStartup, KStartupSecurityCodeQueryStatus, securityQueryState);
       
   749             	TRACES( RDebug::Print( _L( "CSysApAppUi::HandleKeyEventL(): Reading value of KCoreAppUIsDisableKeyguard - State Value: %d"),alarmState));
       
   750             	TRACES( RDebug::Print( _L( "CSysApAppUi::HandleKeyEventL(): Reading value of KStartupSecurityCodeQueryStatus - State Value: %d"),securityQueryState));
       
   751 				//Disable keylock if Alarm is active or if a Security code query is active on the display
       
   752 				if ( alarmState == ECoreAppUIsDisableKeyguard || securityQueryState == ESecurityQueryActive )
       
   753                  	{
       
   754 					KeyLock().DisableWithoutNote();               	
       
   755                  	}
       
   756 			    else
       
   757          		 	{
       
   758          			KeyLock().EnableWithoutNote();
       
   759          			}
   747                 }
   760                 }
   748             else
   761             else
   749                 {
   762                 {
   750                 if ( aKeyEvent.iScanCode == EStdKeyDevice2 )
   763                 if ( aKeyEvent.iScanCode == EStdKeyDevice2 )
   751                     {
   764                     {
  1686         }
  1699         }
  1687     else if ( aValue == EChargingStatusNotConnected )
  1700     else if ( aValue == EChargingStatusNotConnected )
  1688         {
  1701         {
  1689         TRACES( RDebug::Print( _L("SysAp: charger removed") ) );
  1702         TRACES( RDebug::Print( _L("SysAp: charger removed") ) );
  1690         iSysApLightsController->ChargerConnectedL( EFalse );    
  1703         iSysApLightsController->ChargerConnectedL( EFalse );    
  1691         iSysApUsbChargerDetector.Reset();
  1704                 
  1692         
       
  1693         if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() &&
  1705         if ( !iSysApUsbChargerDetector.HostOnlyUsbChargingUsed() &&
  1694              iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) )
  1706              iSysApFeatureManager->Supported( KSysApFeatureIdChargerReminderNotes ) )
  1695             {
  1707             {
  1696 		if(showNote)
  1708 			if(showNote)
  1697                 {
  1709                 {
  1698                 ShowUiNoteL( EUnplugChargerNote );
  1710                 ShowUiNoteL( EUnplugChargerNote );
  1699                 }
  1711                 }
  1700             }
  1712             }
       
  1713 		iSysApUsbChargerDetector.Reset();
  1701         }
  1714         }
  1702     else if ( aValue == EChargingStatusNotCharging )
  1715     else if ( aValue == EChargingStatusNotCharging )
  1703         {
  1716         {
  1704         TRACES( RDebug::Print( _L("SysAp: Not charging") ) );
  1717         TRACES( RDebug::Print( _L("SysAp: Not charging") ) );
  1705         }
  1718         }