securitydialogs/SecUi/Src/SecUiSystemLock.cpp
branchGCC_SURGE
changeset 40 604cd42065d1
parent 26 aad866c37519
equal deleted inserted replaced
29:b63e8c2d8cff 40:604cd42065d1
    20 #include    <e32property.h>
    20 #include    <e32property.h>
    21 #include    <PSVariables.h>   // Property values
    21 #include    <PSVariables.h>   // Property values
    22 #include    <coreapplicationuisdomainpskeys.h>
    22 #include    <coreapplicationuisdomainpskeys.h>
    23 #include    "SecUiSystemLock.h"
    23 #include    "SecUiSystemLock.h"
    24 #include    <eikenv.h>
    24 #include    <eikenv.h>
    25 #include    <AknNotifierController.h>
    25 // #include    <AknNotifierController.h>
    26 #include    <rmmcustomapi.h>
    26 #include    <rmmcustomapi.h>
    27 #include    "secuisecuritysettings.h"
    27 #include    "secuisecuritysettings.h"
    28 #include    "SecUiWait.h"
    28 #include    "SecUiWait.h"
    29 #include    <mmtsy_names.h>
    29 #include    <mmtsy_names.h>
    30 #include 	<e32property.h>
    30 #include 	<e32property.h>
    48 // 
    48 // 
    49 // ----------------------------------------------------------
    49 // ----------------------------------------------------------
    50 // 
    50 // 
    51 EXPORT_C CSystemLock* CSystemLock::NewL()
    51 EXPORT_C CSystemLock* CSystemLock::NewL()
    52     {
    52     {
       
    53     RDebug::Printf( "%s %s (%u) this should not be called=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
    53     CSystemLock* self = new(ELeave) CSystemLock();
    54     CSystemLock* self = new(ELeave) CSystemLock();
    54     CleanupStack::PushL(self);
    55     CleanupStack::PushL(self);
    55     self->ConstructL();
    56     self->ConstructL();
    56     CleanupStack::Pop();
    57     CleanupStack::Pop();
    57     return self;
    58     return self;
    62 // 
    63 // 
    63 // ----------------------------------------------------------
    64 // ----------------------------------------------------------
    64 // 
    65 // 
    65 void CSystemLock::ConstructL()    
    66 void CSystemLock::ConstructL()    
    66     {    
    67     {    
       
    68     RDebug::Printf( "%s %s (%u) this should not be called=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
    67     /*****************************************************
    69     /*****************************************************
    68     *    Series 60 Customer / ETel
    70     *    Series 60 Customer / ETel
    69     *    Series 60  ETel API
    71     *    Series 60  ETel API
    70     *****************************************************/
    72     *****************************************************/
    71     /*****************************************************
    73     /*****************************************************
   141         }
   143         }
   142     }
   144     }
   143 //
   145 //
   144 // ----------------------------------------------------------
   146 // ----------------------------------------------------------
   145 // CSystemLock::SetLockedL()
   147 // CSystemLock::SetLockedL()
   146 // Activates system lock 
   148 // Activates system lock
       
   149 // this was used by SysAp, but it's not longer used
   147 // ----------------------------------------------------------
   150 // ----------------------------------------------------------
   148 //
   151 //
   149 EXPORT_C void CSystemLock::SetLockedL()
   152 EXPORT_C void CSystemLock::SetLockedL()
   150     {
   153     {
   151     /*****************************************************
   154     /*****************************************************
   152     *    Series 60 Customer / ETel
   155     *    Series 60 Customer / ETel
   153     *    Series 60  ETel API
   156     *    Series 60  ETel API
   154     *****************************************************/
   157     *****************************************************/
       
   158     RDebug::Printf( "%s %s (%u) this should not be called=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   155     #if defined(_DEBUG)
   159     #if defined(_DEBUG)
   156     RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL()"));
   160     RDebug::Print(_L("(SECUI)CSystemLock::SetLockedL()"));
   157     #endif
   161     #endif
   158     // close fast-swap window
   162     // close fast-swap window
   159             RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   163             RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   160             CDevicelockAccessApi* iDevicelockAccess = CDevicelockAccessApi::NewL( );
   164             CDevicelockAccessApi* iDevicelockAccess = CDevicelockAccessApi::NewL( );
   161            	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   165            	RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   162 						iDevicelockAccess->OfferDevicelock();
   166 						iDevicelockAccess->OfferDevicelock();
   163 						//				EnableDevicelock( EDevicelockManual );
   167 						// this will do				EnableDevicelock( EDevicelockManual );
   164 						RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   168 						RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
   165     }
   169     }
   166 //
   170 //
   167 // ----------------------------------------------------------
   171 // ----------------------------------------------------------
   168 // CSystemLock::RunL()
   172 // CSystemLock::RunL()
   169 // Handles query result
   173 // Handles query result
       
   174 // this was used by SysAp, but it's not longer used
   170 // ----------------------------------------------------------
   175 // ----------------------------------------------------------
   171 // 
   176 // 
   172 void CSystemLock::RunL()
   177 void CSystemLock::RunL()
   173     {    
   178     {    
       
   179     RDebug::Printf( "%s %s (%u) this should not be called=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
       
   180 
   174     #if defined(_DEBUG)
   181     #if defined(_DEBUG)
   175     TInt status(iStatus.Int());
   182     TInt status(iStatus.Int());
   176     RDebug::Print(_L("(SECUI)CSystemLock::RunL(): %d"), status);
   183     RDebug::Print(_L("(SECUI)CSystemLock::RunL(): %d"), status);
   177     #endif
   184     #endif
   178     //lower the flag
   185     //lower the flag
   186     		{
   193     		{
   187     			#if defined(_DEBUG)
   194     			#if defined(_DEBUG)
   188         		RDebug::Print(_L("(SECUI)CSystemLock::RunL() KErrNone"));
   195         		RDebug::Print(_L("(SECUI)CSystemLock::RunL() KErrNone"));
   189         		#endif
   196         		#endif
   190         		// clear notifiers
   197         		// clear notifiers
   191         		AknNotifierController::HideAllNotifications(ETrue);
   198         		// not any more. Avkon is deprecated. Besides, this function should not be called.
       
   199         		// AknNotifierController::HideAllNotifications(ETrue);
   192         		// query approved -> lock system  
   200         		// query approved -> lock system  
   193 			#ifdef RD_REMOTELOCK
   201 			#ifdef RD_REMOTELOCK
   194 				iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EManualLocked);
   202 				iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EManualLocked);
   195 			#else// !RD_REMOTELOCK
   203 			#else// !RD_REMOTELOCK
   196         		iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOn);
   204         		iProperty.Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOn);
   197         	#endif//RD_REMOTELOCK
   205         	#endif//RD_REMOTELOCK
   198         		AknNotifierController::HideAllNotifications(EFalse);
   206         		// not any more. Avkon is deprecated. Besides, this function should not be called.
       
   207         		// AknNotifierController::HideAllNotifications(EFalse);
   199     		}
   208     		}
   200         }
   209         }
   201     else if((iStatus != KErrCancel) && (iStatus != KErrAbort))
   210     else if((iStatus != KErrCancel) && (iStatus != KErrAbort))
   202         {   //Code error or something like that. Show the dialog again.
   211         {   //Code error or something like that. Show the dialog again.
   203             #if defined(_DEBUG)
   212             #if defined(_DEBUG)