coreapplicationuis/SysAp/Src/sysapdefaultkeyhandler.cpp
branchRCL_3
changeset 10 469fa8a78de7
parent 6 a72ff4214918
child 17 5e7d68cc22e0
equal deleted inserted replaced
9:332e7bf3b42f 10:469fa8a78de7
    35 #include <u32hal.h>
    35 #include <u32hal.h>
    36 #include <SysAp.rsg>
    36 #include <SysAp.rsg>
    37 #include <centralrepository.h> //for CRepository
    37 #include <centralrepository.h> //for CRepository
    38 #include <settingsinternalcrkeys.h>
    38 #include <settingsinternalcrkeys.h>
    39 #include <keylockpolicyapi.h>
    39 #include <keylockpolicyapi.h>
       
    40 #include <ctsydomainpskeys.h>
    40 #include "sysapdefaultkeyhandler.h"
    41 #include "sysapdefaultkeyhandler.h"
    41 #include "sysapcallback.h"
    42 #include "sysapcallback.h"
    42 #include "SysAp.hrh"
    43 #include "SysAp.hrh"
    43 #include "AknSgcc.h"
    44 #include "AknSgcc.h"
    44 
    45 
   126         }
   127         }
   127     
   128     
   128     //Load keylock slide handling CR 
   129     //Load keylock slide handling CR 
   129     TRAP_IGNORE( iSlideRepository = CRepository::NewL( KCRUidSlideSettings ) );
   130     TRAP_IGNORE( iSlideRepository = CRepository::NewL( KCRUidSlideSettings ) );
   130     iKeylockPolicy = CKeyLockPolicyApi::NewL( EPolicyActivateKeyguard );
   131     iKeylockPolicy = CKeyLockPolicyApi::NewL( EPolicyActivateKeyguard );
       
   132 
       
   133     //Load PhoneCallStatus P&S  
       
   134     TInt err = iCallStateProperty.Attach(KPSUidCtsyCallInformation, KCTsyCallState);
   131     }
   135     }
   132 
   136 
   133 // ---------------------------------------------------------------------------
   137 // ---------------------------------------------------------------------------
   134 // CSysApDefaultKeyHandler::NewL
   138 // CSysApDefaultKeyHandler::NewL
   135 // ---------------------------------------------------------------------------
   139 // ---------------------------------------------------------------------------
   214 						iKeylock->OfferKeyLock();
   218 						iKeylock->OfferKeyLock();
   215 						}
   219 						}
   216 					}
   220 					}
   217 				else
   221 				else
   218 					{ // keylock action is defined by user setting
   222 					{ // keylock action is defined by user setting
   219 					TInt keyGuardSetting;
   223                     TInt status(0);
   220 					iSlideRepository->Get( KSlideKeyguard, keyGuardSetting );
   224                     TInt err = iCallStateProperty.Get( status );
   221 					switch( ( TSlideSettingKeyguard ) keyGuardSetting )
   225                     if (err == KErrNone)
   222 						{
   226                         {
   223 						case ESlideSettingsKeyguardActivatingOn: 
   227                         switch ( status )
   224 						    iKeylock->EnableKeyLock();
   228                             {
   225 						    break;
   229                             case EPSCTsyCallStateUninitialized:
   226 						case ESlideSettingsKeyguardActivatingAskMe: 
   230                             case EPSCTsyCallStateNone:
   227 						    iKeylock->OfferKeyLock();
   231                                 {
   228 							break;
   232     
   229 						case ESlideSettingsKeyguardActivatingOff: 
   233                                 TInt keyGuardSetting;
   230 						    //do nothing
   234                                 iSlideRepository->Get( KSlideKeyguard, keyGuardSetting );
   231 						    break;
   235                                 switch( ( TSlideSettingKeyguard ) keyGuardSetting )
   232 						case ESlideSettingsKeyguardActivatingAutomatic: 
   236                                     {
   233 						    if( iKeypadWasLocked )
   237                                     case ESlideSettingsKeyguardActivatingOn: 
   234 							    {
   238                                         iKeylock->EnableKeyLock();
   235 								iKeylock->EnableKeyLock();
   239                                         break;
   236 								}
   240                                     case ESlideSettingsKeyguardActivatingAskMe: 
   237 							break;
   241                                         iKeylock->OfferKeyLock();
   238 						}
   242                                         break;
       
   243                                     case ESlideSettingsKeyguardActivatingOff: 
       
   244                                         //do nothing
       
   245                                         break;
       
   246                                     case ESlideSettingsKeyguardActivatingAutomatic: 
       
   247                                         if( iKeypadWasLocked )
       
   248                                             {
       
   249                                             iKeylock->EnableKeyLock();
       
   250                                             }
       
   251                                         break;
       
   252                                     }
       
   253                                 }
       
   254                             default: // any other state
       
   255                                 break;
       
   256                             }
       
   257                         }
   239 					}
   258 					}
   240                 // apply default light control
   259                 // apply default light control
   241                 iCallback.ExecCommandL( MSysapCallback::EUpdateLights, TUpdateLightsBuf(EKeyGripClose) );
   260                 iCallback.ExecCommandL( MSysapCallback::EUpdateLights, TUpdateLightsBuf(EKeyGripClose) );
   242                 break;
   261                 break;
   243             
   262