securitydialogs/Autolock/src/AutolockGripStatusObserver.cpp
branchRCL_3
changeset 13 53af9c3d61e4
parent 0 164170e6151a
child 17 2ca12c9f635b
equal deleted inserted replaced
11:9971b621ef6c 13:53af9c3d61e4
    18 #include <e32base.h>
    18 #include <e32base.h>
    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"
       
    24 #include <aknkeylock.h>
    23 
    25 
    24 
    26 
    25 EXPORT_C CAutolockGripStatusObserver* CAutolockGripStatusObserver::NewL( MAutolockGripStatusObserver* aObserver, RWsSession& aSession )
    27 EXPORT_C CAutolockGripStatusObserver* CAutolockGripStatusObserver::NewL( MAutolockGripStatusObserver* aObserver, RWsSession& aSession )
    26     {
    28     {
    27     CAutolockGripStatusObserver* self = new (ELeave) CAutolockGripStatusObserver( aSession );
    29     CAutolockGripStatusObserver* self = new (ELeave) CAutolockGripStatusObserver( aSession );
   101             #if defined(_DEBUG)
   103             #if defined(_DEBUG)
   102         	RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::::GripStatusChangedL => send command"));
   104         	RDebug::Print(_L("(AUTOLOCK)CAutolockGripStatusObserver::::GripStatusChangedL => send command"));
   103         	#endif
   105         	#endif
   104     	    //Grip opened
   106     	    //Grip opened
   105         	TApaTaskList tasklist( iSession );
   107         	TApaTaskList tasklist( iSession );
       
   108         	/* this is old code. It was changed to a new one, following a suggestion from the Slide-handling team
   106         	TApaTask capserver = tasklist.FindApp( KAknCapServerUid );
   109         	TApaTask capserver = tasklist.FindApp( KAknCapServerUid );
   107         	if( capserver.Exists() )
   110         	if( capserver.Exists() )
   108         	    {
   111         	    {
   109         	    TKeyEvent key;
   112         	    TKeyEvent key;
   110         	    key.iCode = EKeyDevice0;
   113         	    key.iCode = EKeyDevice0;
   111         	    key.iModifiers = 0;
   114         	    key.iModifiers = 0;
   112         	    key.iRepeats = 0;
   115         	    key.iRepeats = 0;
   113         	    key.iScanCode = EStdKeyDevice0;
   116         	    key.iScanCode = EStdKeyDevice0;
   114         	    capserver.SendKey( key );
   117         	    capserver.SendKey( key );
   115         	    }
   118         	    }
   116 
   119 					*/
       
   120 					TApaTask capserver = tasklist.FindApp( KUidAutolock ); 
       
   121 					if( capserver.Exists() ) 
       
   122 					        { 
       
   123 					        TKeyEvent key; 
       
   124 					        key.iCode = EKeyBell; 
       
   125 					        capserver.SendKey( key ); 
       
   126 					        } 
       
   127 					RAknKeylock2 keylock; 
       
   128 					TInt error( keylock.Connect() ); 
       
   129 					if ( !error ) 
       
   130 					    { 
       
   131 					    keylock.DisableWithoutNote(); 
       
   132 					    keylock.Close(); 
       
   133 					    } 
   117     		}
   134     		}
   118         }
   135         }
   119     else
   136     else
   120         {
   137         {
   121         #if defined(_DEBUG)
   138         #if defined(_DEBUG)