securitydialogs/Autolock/src/AutolockGripStatusObserver.cpp
branchRCL_3
changeset 36 2ca12c9f635b
parent 20 53af9c3d61e4
child 47 63339781d179
equal deleted inserted replaced
24:fabe5ded361a 36:2ca12c9f635b
    19 #include <e32debug.h>
    19 #include <e32debug.h>
    20 #include <AknCapServerDefs.h>
    20 #include <AknCapServerDefs.h>
    21 #include <apgtask.h>
    21 #include <apgtask.h>
    22 #include "AutolockGripStatusObserver.h"
    22 #include "AutolockGripStatusObserver.h"
    23 #include "AutolockApp.h"
    23 #include "AutolockApp.h"
       
    24 #include "AutolockAppUiInterface.h"
    24 #include <aknkeylock.h>
    25 #include <aknkeylock.h>
    25 
    26 
    26 
    27 
    27 EXPORT_C CAutolockGripStatusObserver* CAutolockGripStatusObserver::NewL( MAutolockGripStatusObserver* aObserver, RWsSession& aSession )
    28 EXPORT_C CAutolockGripStatusObserver* CAutolockGripStatusObserver::NewL( MAutolockAppUiInterface* aObserver, RWsSession& aSession )
    28     {
    29     {
    29     CAutolockGripStatusObserver* self = new (ELeave) CAutolockGripStatusObserver( aSession );
    30     CAutolockGripStatusObserver* self = new (ELeave) CAutolockGripStatusObserver( aSession );
    30     CleanupStack::PushL( self );
    31     CleanupStack::PushL( self );
    31     self->ConstructL( aObserver );
    32     self->ConstructL( aObserver );
    32     CleanupStack::Pop( self );
    33     CleanupStack::Pop( self );
    33     return self;
    34     return self;
    34     }
    35     }
    35 
    36 
    36 void CAutolockGripStatusObserver::ConstructL( MAutolockGripStatusObserver* aObserver )
    37 void CAutolockGripStatusObserver::ConstructL( MAutolockAppUiInterface* aObserver )
    37     {
    38     {
    38     #if defined(_DEBUG)
    39     #if defined(_DEBUG)
    39     RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::ConstructL") );
    40     RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::ConstructL") );
    40     #endif
    41     #endif
    41     TInt err = iGripStatus.Attach( KPSUidHWRM, KHWRMGripStatus );
    42     TInt err = iGripStatus.Attach( KPSUidHWRM, KHWRMGripStatus );
   144             #if defined(_DEBUG)
   145             #if defined(_DEBUG)
   145         	RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::::GripStatusChangedL => send key event"));
   146         	RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::::GripStatusChangedL => send key event"));
   146         	#endif
   147         	#endif
   147             //the device lock query is on top
   148             //the device lock query is on top
   148         	//generate cancel key event
   149         	//generate cancel key event
   149         	TRawEvent rawEvent;
   150         	iObserver->CancelDeviceLockQuery();
   150         	rawEvent.Set( TRawEvent::EKeyDown, KCancelKeyCode );
       
   151         	iSession.SimulateRawEvent( rawEvent );        	
       
   152             }
   151             }
   153         }
   152         }
   154     }
   153     }
   155 
   154 
   156 // End of File
   155 // End of File