Revision: 201017 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 17:00:25 +0300
branchRCL_3
changeset 13 53af9c3d61e4
parent 11 9971b621ef6c
child 14 33ad376816a8
Revision: 201017 Kit: 201019
securitydialogs/Autolock/src/AutoLockModel.cpp
securitydialogs/Autolock/src/AutolockAppUi.cpp
securitydialogs/Autolock/src/AutolockContainer.cpp
securitydialogs/Autolock/src/AutolockGripStatusObserver.cpp
securitydialogs/lockapp/src/lockappkeyguardcontrol.cpp
securitydialogs/simlockui/data/SimLockUI.rss
securitydialogs/simlockui/data/SimLockUI_reg.rss
securitydialogs/simlockui/group/bld.inf
--- a/securitydialogs/Autolock/src/AutoLockModel.cpp	Tue Apr 27 17:31:46 2010 +0300
+++ b/securitydialogs/Autolock/src/AutoLockModel.cpp	Tue May 11 17:00:25 2010 +0300
@@ -394,6 +394,7 @@
     #endif//RD_REMOTELOCK
     // lock keys
     iAppUi->LockKeysL();
+    // iAppUi->EnableWGListChangeEventListening();	// this was in previous versions. It's not needed because it will come on top of bigClock
     // app to foreground
     iAppUi->BringAppToForegroundL();
          // Reset inactivity time so that Screensaver gets to
--- a/securitydialogs/Autolock/src/AutolockAppUi.cpp	Tue Apr 27 17:31:46 2010 +0300
+++ b/securitydialogs/Autolock/src/AutolockAppUi.cpp	Tue May 11 17:00:25 2010 +0300
@@ -55,6 +55,9 @@
 #include <apgwgnam.h>
 #include <aknlayoutscalable_avkon.cdl.h>
 
+#include <AknCapServerDefs.h>
+#include <apgtask.h>
+
 //  LOCAL CONSTANTS AND MACROS  
 #define KSysApUid TUid::Uid(0x100058F3)
 #define KPhoneAppUid TUid::Uid(0x100058B3)
@@ -674,7 +677,7 @@
     const TKeyEvent& aKeyEvent,TEventCode aType)
     {
         
-    if ( aKeyEvent.iCode == EKeyBell || (aType == EEventKeyUp && aKeyEvent.iScanCode == EStdKeyDeviceF) )      
+    if ( aKeyEvent.iCode == EKeyBell || (aType == EEventKeyUp && aKeyEvent.iScanCode == EStdKeyDeviceF)  || (aKeyEvent.iCode == EKeyDeviceF) )
 		{
 		if(iLocked)    
  		    HandleCommandL(ESecUiCmdUnlock);
@@ -1054,8 +1057,11 @@
 	if (!iSideKey1)
 		{
 		RWindowGroup& groupWin=iCoeEnv->RootWin();
-		iSideKey1 = groupWin.CaptureKey(EKeySide,0,0);
-		iSideKey2 = groupWin.CaptureKeyUpAndDowns(EStdKeyDevice6, 0, 0);
+		iSideKey1 = groupWin.CaptureKey(EKeyDeviceF,0,0);	// EKeySide -> EKeyDeviceF
+		#if defined(_DEBUG)
+		RDebug::Printf( "%s %s (%u) capturing EStdKeyDeviceF=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EStdKeyDeviceF );
+		#endif
+		iSideKey2 = groupWin.CaptureKeyUpAndDowns(EStdKeyDeviceF, 0, 0);	// EStdKeyDevice6 -> EStdKeyDeviceF
 		}
 	}
 
@@ -1354,9 +1360,32 @@
     	    case EEventKeyUp:	// on touch devices, this happens only for the switch-key, which should turn on the lights.
     	    case EEventKey:
     	    case EEventKeyDown:
-    		if(iLocked)
-	    	        SendMessageToSysAp( EEikSecurityQueryLights );
-	    	        break;
+		    		if(iLocked)
+		    				{	// need to capture the switch-key for the case activeCall because Autolock stays on top, even over Akn
+		    	    	TKeyEvent *key = aEvent.Key();
+		    	    	#if defined(_DEBUG)
+		    	    	RDebug::Printf( "%s %s (%u) key->iCode=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, key->iCode );
+		    	    	RDebug::Printf( "%s %s (%u) key->iScanCode=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, key->iScanCode );
+		    	    	#endif
+		    	   		if ( (key->iScanCode == EStdKeyDeviceF) || (key->iCode == EKeyDeviceF) )
+		    	   			{
+		    	   			#if defined(_DEBUG)
+		    	   			RDebug::Printf( "%s %s (%u) good key=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
+		    	   			#endif
+			    				RWsSession& ws = iEikonEnv->WsSession();
+				        	TApaTaskList tasklist( ws );
+				        	TApaTask capserver = tasklist.FindApp( KAknCapServerUid );
+				        	if( capserver.Exists() )
+				        	    {
+		    	   					#if defined(_DEBUG)
+				        	    RDebug::Printf( "%s %s (%u) found KAknCapServerUid=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, KAknCapServerUid );
+			        	    	#endif
+				        	    capserver.SendKey( *key );
+				        	    }
+		   	        	SendMessageToSysAp( EEikSecurityQueryLights );
+									}
+								}
+    	    	break;
 		    default:
 		    	iGotEventDownDuringCall=0;	// any other event invalidates the Press inside the BigRedButton
 		    	break;
--- a/securitydialogs/Autolock/src/AutolockContainer.cpp	Tue Apr 27 17:31:46 2010 +0300
+++ b/securitydialogs/Autolock/src/AutolockContainer.cpp	Tue May 11 17:00:25 2010 +0300
@@ -254,7 +254,9 @@
 				#if defined(_DEBUG)
 				RDebug::Printf( "%s %s (%u) no Draw value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, value );
 				#endif
-				return;
+				// If it returns, it will not handle orientation changes.
+				// However it will not really draw because the view is hidden
+				// return;
 				}
 			}
 
--- a/securitydialogs/Autolock/src/AutolockGripStatusObserver.cpp	Tue Apr 27 17:31:46 2010 +0300
+++ b/securitydialogs/Autolock/src/AutolockGripStatusObserver.cpp	Tue May 11 17:00:25 2010 +0300
@@ -20,6 +20,8 @@
 #include <AknCapServerDefs.h>
 #include <apgtask.h>
 #include "AutolockGripStatusObserver.h"
+#include "AutolockApp.h"
+#include <aknkeylock.h>
 
 
 EXPORT_C CAutolockGripStatusObserver* CAutolockGripStatusObserver::NewL( MAutolockGripStatusObserver* aObserver, RWsSession& aSession )
@@ -103,6 +105,7 @@
         	#endif
     	    //Grip opened
         	TApaTaskList tasklist( iSession );
+        	/* this is old code. It was changed to a new one, following a suggestion from the Slide-handling team
         	TApaTask capserver = tasklist.FindApp( KAknCapServerUid );
         	if( capserver.Exists() )
         	    {
@@ -113,7 +116,21 @@
         	    key.iScanCode = EStdKeyDevice0;
         	    capserver.SendKey( key );
         	    }
-
+					*/
+					TApaTask capserver = tasklist.FindApp( KUidAutolock ); 
+					if( capserver.Exists() ) 
+					        { 
+					        TKeyEvent key; 
+					        key.iCode = EKeyBell; 
+					        capserver.SendKey( key ); 
+					        } 
+					RAknKeylock2 keylock; 
+					TInt error( keylock.Connect() ); 
+					if ( !error ) 
+					    { 
+					    keylock.DisableWithoutNote(); 
+					    keylock.Close(); 
+					    } 
     		}
         }
     else
--- a/securitydialogs/lockapp/src/lockappkeyguardcontrol.cpp	Tue Apr 27 17:31:46 2010 +0300
+++ b/securitydialogs/lockapp/src/lockappkeyguardcontrol.cpp	Tue May 11 17:00:25 2010 +0300
@@ -28,7 +28,8 @@
 #include <aknnotpi.rsg> // keyguard spesific resources
 #include <AknUtils.h>
 #include <activitymanager.h>
-#include <SecondaryDisplay/AknSecondaryDisplayDefs.h> // publishing keyguard notes to secondary display
+// this is not needed
+// #include <SecondaryDisplay/AknSecondaryDisplayDefs.h> // publishing keyguard notes to secondary display
 #include <featmgr.h> // feature manager
 #include <eikcba.h> // keyguard soft buttons
 #include <eikspane.h>
@@ -158,13 +159,15 @@
     iKeypadLockedNote->ConstructSleepingNoteL( touchEnabled ? R_KEYLOCK_NOTE_DISPLAY_LOCK_ON_TOUCH :
                                                R_KEYLOCK_NOTE_LOCK_ON );
     iKeypadLockedNote->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition( 0, 2 );
-    iKeypadLockedNote->PublishDialogL( EAknKeysLockedNote );
+		// this is not needed
+    // iKeypadLockedNote->PublishDialogL( EAknKeysLockedNote );
 
     iKeypadUnlockedNote = new (ELeave) CLockAppLockedNote();
     iKeypadUnlockedNote->ConstructSleepingNoteL( touchEnabled ? R_KEYLOCK_NOTE_DISPLAY_LOCK_OFF_TOUCH :
                                                  R_KEYLOCK_NOTE_LOCK_OFF );
     iKeypadUnlockedNote->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition( 0, 2 );
-    iKeypadUnlockedNote->PublishDialogL( EAknKeysReleasedNote );
+		// this is not needed
+    // iKeypadUnlockedNote->PublishDialogL( EAknKeysReleasedNote );
 
     iLockedNote = new (ELeave) CLockAppLockedNote();
     if ( touchEnabled )
--- a/securitydialogs/simlockui/data/SimLockUI.rss	Tue Apr 27 17:31:46 2010 +0300
+++ b/securitydialogs/simlockui/data/SimLockUI.rss	Tue May 11 17:00:25 2010 +0300
@@ -32,7 +32,7 @@
 #include <appinfo.rh>
 
 #include "simlockui.hrh"
-#include "simlockui.loc"
+#include <simlockui.loc>
 
 // Resource Identifiers
 RESOURCE RSS_SIGNATURE { }
--- a/securitydialogs/simlockui/data/SimLockUI_reg.rss	Tue Apr 27 17:31:46 2010 +0300
+++ b/securitydialogs/simlockui/data/SimLockUI_reg.rss	Tue May 11 17:00:25 2010 +0300
@@ -39,7 +39,7 @@
     hidden = KAppIsHidden;
     // Uncomment and comment previous line to un-hide
     //hidden = KAppNotHidden;
-    localisable_resource_file="\\resource\\apps\\SimLockUI";
+    //localisable_resource_file="\\resource\\apps\\SimLockUI";
     embeddability = KAppNotEmbeddable;
     newfile = KAppDoesNotSupportNewFile;
     }
--- a/securitydialogs/simlockui/group/bld.inf	Tue Apr 27 17:31:46 2010 +0300
+++ b/securitydialogs/simlockui/group/bld.inf	Tue May 11 17:00:25 2010 +0300
@@ -34,7 +34,9 @@
 PRJ_EXPORTS
 // Export IBY files
 ../rom/simlockui.iby            CORE_MW_LAYER_IBY_EXPORT_PATH( simlockui.iby) 
-../rom/simlockui_resources.iby  LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(simlockui_resources.iby)   
+../rom/simlockui_resources.iby  LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(simlockui_resources.iby) 
+
+../inc/simlockui.loc            MW_LAYER_LOC_EXPORT_PATH(simlockui.loc)  
 
 // For EE texts
 ../rom/simlockui_resources.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(simlockui_resources.iby)