--- a/securitydialogs/Autolock/src/AutoLockValueObserver.cpp Thu Jul 15 19:36:50 2010 +0300
+++ b/securitydialogs/Autolock/src/AutoLockValueObserver.cpp Thu Aug 19 10:45:23 2010 +0300
@@ -23,7 +23,8 @@
#include <ctsydomainpskeys.h>
#include "AutolockAppUiPS.h"
#include "AutoLockValueObserverPS.h"
-
+#include <coreapplicationuisdomainpskeys.h>
+#include <startupdomainpskeys.h>
// ================= MEMBER FUNCTIONS =======================
//
@@ -64,6 +65,9 @@
iProperty.Attach(KPSUidCtsyCallInformation, KCTsyCallState);
iProperty.Subscribe(iStatus);
SetActive();
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+ #endif
return KErrNone;
}
//
@@ -74,6 +78,9 @@
//
void CValueObserver::Stop()
{
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+ #endif
Cancel();
}
//
@@ -83,7 +90,10 @@
// ----------------------------------------------------------
//
CValueObserver::CValueObserver(CAutolockAppUi* aAppUi) : CActive(0), iAppUi(aAppUi)
- {
+ {
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+ #endif
}
//
// ----------------------------------------------------------
@@ -94,6 +104,9 @@
void CValueObserver::ConstructL()
{
// Add this active object to the scheduler.
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+ #endif
CActiveScheduler::Add(this);
}
//
@@ -104,15 +117,82 @@
//
void CValueObserver::RunL()
{
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0 );
+ #endif
+ TInt atForeground = iAppUi->IsForeground();
+ TInt value(EStartupUiPhaseUninitialized);
+ RProperty::Get(KPSUidStartup, KPSStartupUiPhase, value);
TInt callState;
iProperty.Get( callState );
- if (callState == EPSCTsyCallStateNone && !iAppUi->IsForeground())
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) callState=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, callState );
+ RDebug::Printf( "%s %s (%u) EPSCTsyCallStateNone=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EPSCTsyCallStateNone );
+ RDebug::Printf( "%s %s (%u) EPSCTsyCallStateUninitialized=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EPSCTsyCallStateUninitialized );
+ RDebug::Printf( "%s %s (%u) atForeground=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, atForeground );
+ RDebug::Printf( "%s %s (%u) KPSStartupUiPhase value=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, value );
+ RDebug::Printf( "%s %s (%u) EStartupUiPhaseSystemWelcomeDone=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, EStartupUiPhaseSystemWelcomeDone );
+ #endif
+
+
+ if (callState == EPSCTsyCallStateNone && !atForeground)
{
- // app back to foreground
- iAppUi->BringAppToForegroundL();
+ if( value<EStartupUiPhaseSystemWelcomeDone )
+ {
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) re-start=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
+ #endif
+ Start();
+ }
+ else
+ {
+ // app back to foreground
+ TInt iAppUi_Locked = iAppUi->Locked();
+ TInt alocked = RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, value);
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) alocked=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, alocked );
+ RDebug::Printf( "%s %s (%u) iAppUi_Locked=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, iAppUi_Locked );
+ #endif
+ if(iAppUi_Locked)
+ {
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) BringAppToForegroundL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
+ #endif
+ iAppUi->BringAppToForegroundL();
+ }
+ }
}
else
{
+ {
+ if( value<EStartupUiPhaseSystemWelcomeDone )
+ {
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) 1=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
+ #endif
+ if( callState != EPSCTsyCallStateNone && callState != EPSCTsyCallStateUninitialized && !atForeground)
+ {
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) 2=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 2 );
+ #endif
+ iAppUi->BringAppToForegroundL();
+ }
+ else if( (callState == EPSCTsyCallStateNone || callState == EPSCTsyCallStateUninitialized) && atForeground)
+ {
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) calling BringAppToForegroundL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 );
+ #endif
+ iAppUi->BringAppToForegroundL();
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) calling SwitchToPreviousAppL=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 2 );
+ #endif
+ iAppUi->SwitchToPreviousAppL();
+ #if defined(_DEBUG)
+ RDebug::Printf( "%s %s (%u) done=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 3 );
+ #endif
+ }
+ }
+ }
Start();
}