Revision: 201013 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 14 Apr 2010 15:58:13 +0300
branchRCL_3
changeset 11 4784a3bc2236
parent 10 1c806ee746e7
child 12 0bfd55b8504e
Revision: 201013 Kit: 201015
group/screensaver.mmp
inc/screensaveractivitymanager.h
inc/screensaverctrlplugin.h
inc/screensaverengine.h
inc/screensavershareddatai.h
inc/screensaverview.h
scrsaver/scrsaverplugins/ScreenSaverAnimPlugin/src/ScreenSaverAnimPluginContainer.cpp
scrsaver/scrsaverplugins/ScreenSaverGifAnimPlugin/src/GifAnimationPluginControl.cpp
src/screensaveractivitymanager.cpp
src/screensaverappui.cpp
src/screensaverctrlmovingtext.cpp
src/screensaverctrlnone.cpp
src/screensaverctrlplugin.cpp
src/screensaverengine.cpp
src/screensaverview.cpp
--- a/group/screensaver.mmp	Wed Mar 31 21:32:18 2010 +0300
+++ b/group/screensaver.mmp	Wed Apr 14 15:58:13 2010 +0300
@@ -64,7 +64,8 @@
 SOURCE      screensaversubscriber.cpp
 SOURCE      screensaverrepositorywatcher.cpp 
 SOURCE      screensavershareddatamonitor.cpp 
-SOURCE      screensaverengine.cpp
+SOURCE      screensaverengine.cpp 
+SOURCE      screensaveractivitymanager.cpp
 
 START RESOURCE screensaver.rss
 HEADER
@@ -95,7 +96,6 @@
 LIBRARY     apgrfx.lib
 LIBRARY     ws32.lib
 LIBRARY     CommonEngine.lib
-LIBRARY     activitymanager.lib
 LIBRARY     aknlayout.lib
 LIBRARY     aknlayout2scalable.lib
 LIBRARY     fbscli.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/screensaveractivitymanager.h	Wed Apr 14 15:58:13 2010 +0300
@@ -0,0 +1,59 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// CScreensaverActivityManager class
+// 
+//
+
+#ifndef SCREENSAVERACTIVITYMANAGER_H
+#define SCREENSAVERACTIVITYMANAGER_H
+
+#include <e32base.h>
+
+
+class CScreensaverActivityManager : public CTimer
+	{
+public:
+ 	static CScreensaverActivityManager* NewL(TInt aPriority);
+	~CScreensaverActivityManager();
+	void Start(TTimeIntervalSeconds aInterval,
+	                    TCallBack aInactiveCallback,
+	                    TCallBack aActiveCallback);
+	void SetInactivityTimeout(TTimeIntervalSeconds aInterval);
+private:
+	void RunL();
+	CScreensaverActivityManager(TInt aPriority);
+	void MonitorInactivity();
+private:
+
+    enum TState {
+        EStUndefined = 0,    //< Never used, reserved
+        EStNotActive,        //< Constructed but not started
+        EStMonForInactivity, //< Monitoring user inactivity mode
+        EStMonForActivity    //< Monitoring user activity mode
+    };
+
+    /** Inactivity interval */
+    TTimeIntervalSeconds iInterval;
+    
+    /** Callback to be used in case that user inactivity is detected */
+	TCallBack            iInactiveCallback;
+	
+    /** Callback to be used in case of user activity after inactivity period */
+	TCallBack            iActiveCallback;
+	
+    /** State of object, what form of monitoring is active. */
+	TState                iState;
+	};
+
+#endif // SCREENSAVERACTIVITYMANAGER_H
--- a/inc/screensaverctrlplugin.h	Wed Mar 31 21:32:18 2010 +0300
+++ b/inc/screensaverctrlplugin.h	Wed Apr 14 15:58:13 2010 +0300
@@ -85,6 +85,13 @@
     * @return TInt  
     */
     TInt SendPluginEvent( TScreensaverEvent aEvent );
+    
+    /**
+    * Returns the implemenataion UID of the plugin
+    * 
+    * @return TUid Implementation UID
+    */
+    TUid PluginImplementationUid() const;
 
 public:
     // From MScreensaverPluginHost
@@ -201,5 +208,11 @@
     * The refresh rate of plugin
     */
     TInt iPluginRefreshRate;
+    
+    /**
+    * The implementation UID of the plugin
+    */
+    TUid iPluginImplUid;
+    
     };
 #endif // C_SCREENSAVERCTRLPLUGIN_H
--- a/inc/screensaverengine.h	Wed Mar 31 21:32:18 2010 +0300
+++ b/inc/screensaverengine.h	Wed Apr 14 15:58:13 2010 +0300
@@ -34,7 +34,7 @@
 const TInt KDefaultScreenSaverTimeout = 2 * 60 * 1000000; // 2 mins
 
 // FORWARD DECLARATIONS
-class CUserActivityManager;
+class CScreensaverActivityManager;
 class CScreensaverSharedDataI;
 class CScreensaverSharedDataMonitor;
 class CScreensaverAppUi;
@@ -146,6 +146,11 @@
     */
     void HandleKeyguardStateChanged( TBool aEnabled );
     
+    /**
+     * Informs the engine that a key event was received
+     */
+    void NotifyKeyEventReceived();
+    
 private:
     
     /**
@@ -180,7 +185,7 @@
     /**
     * Stops monitoring the user activity
     */
-    void StopActivityMonitoring( CUserActivityManager*& aActivityManager );
+    void StopActivityMonitoring( CScreensaverActivityManager*& aActivityManager );
 
     /**
     * Gets the color model from the resource
@@ -230,6 +235,10 @@
     */
     static TInt HandleSuspendTimerExpiry( TAny* aPtr );
 
+    /**
+    * Callback function. Called when activity is no longer ignored
+    */
+    static TInt ResetIgnoreFlagCb( TAny* aPtr );
     
     /**
     * Returns the CScreensaverView
@@ -269,9 +278,14 @@
     TBool iScreenSaverIsPreviewing;
     
     /**
+    * 
+    */
+    TBool iIgnoreNextActivity;
+    
+    /**
     * The trigger for screensaver activation
     */
-    CUserActivityManager* iActivityManagerScreensaver;
+    CScreensaverActivityManager* iActivityManagerScreensaver;
 
     
     /**
@@ -296,7 +310,7 @@
     /**
     * The trigger for screensaver activation, short timeout
     */
-    CUserActivityManager* iActivityManagerScreensaverShort;
+    CScreensaverActivityManager* iActivityManagerScreensaverShort;
     
     /**
     * moved from view class
@@ -326,6 +340,11 @@
     * Owned.
     */
     CPeriodic* iExpiryTimer;
+    
+    /**
+     * Timer to ignore activity events after keylock activated.
+     */
+    CPeriodic* iIgnoreActivityResetTimer;
 
     };
 
--- a/inc/screensavershareddatai.h	Wed Mar 31 21:32:18 2010 +0300
+++ b/inc/screensavershareddatai.h	Wed Apr 14 15:58:13 2010 +0300
@@ -29,6 +29,12 @@
 #include "ScreensaverInternalCRKeys.h"
 #include "screensaverengine.h"
 
+enum
+    {
+    ESSForceLightsOff = 0,
+    ESSForceLightsOn
+    };
+
 // CLASS DECLARATION
 class CRepository;
 class CScreensaverRepositoryWatcher;
--- a/inc/screensaverview.h	Wed Mar 31 21:32:18 2010 +0300
+++ b/inc/screensaverview.h	Wed Apr 14 15:58:13 2010 +0300
@@ -74,6 +74,10 @@
     */
     void CreatePreviewDisplayObjectL();
     
+    /**
+    * Returns true the screensaver doesn't draw anything
+    */
+    TBool IsContentlessScreensaver() const;
 
 public://From CAknView
     
@@ -155,6 +159,11 @@
     * The plugin refresh rate
     */
     TInt iPluginRefreshRate;
+    
+    /**
+    * True if the active screensaver doesn't draw (e.g None)
+    */
+    TBool iIsContentless;
 
     };
 
--- a/scrsaver/scrsaverplugins/ScreenSaverAnimPlugin/src/ScreenSaverAnimPluginContainer.cpp	Wed Mar 31 21:32:18 2010 +0300
+++ b/scrsaver/scrsaverplugins/ScreenSaverAnimPlugin/src/ScreenSaverAnimPluginContainer.cpp	Wed Apr 14 15:58:13 2010 +0300
@@ -607,7 +607,7 @@
     TRect& aRect )  const // Rectangle specifying extent of control
     {
     AknLayoutUtils::LayoutMetricsRect(
-            AknLayoutUtils::EApplicationWindow, 
+            AknLayoutUtils::EMainPane, 
             aRect );
     }
 
--- a/scrsaver/scrsaverplugins/ScreenSaverGifAnimPlugin/src/GifAnimationPluginControl.cpp	Wed Mar 31 21:32:18 2010 +0300
+++ b/scrsaver/scrsaverplugins/ScreenSaverGifAnimPlugin/src/GifAnimationPluginControl.cpp	Wed Apr 14 15:58:13 2010 +0300
@@ -539,7 +539,7 @@
                     CFbsBitGc* graphicsMaskContext = NULL; 
                     User::LeaveIfError( bitmapMaskDevice->CreateContext( graphicsMaskContext ) ); 
                     CleanupStack::PushL( graphicsMaskContext ); 
-                    graphicsContext->DrawBitmap( iTargetSize, &iDrawingBitmap->Mask(), srcRect ); 
+                    graphicsMaskContext->DrawBitmap( iTargetSize, &iDrawingBitmap->Mask(), srcRect ); 
                     CleanupStack::PopAndDestroy( 2 );//graphicsContext,bitmapDevice
                     }
                 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/screensaveractivitymanager.cpp	Wed Apr 14 15:58:13 2010 +0300
@@ -0,0 +1,126 @@
+// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// CScreensaverActivityManager class
+// 
+//
+
+#include "screensaveractivitymanager.h"
+
+CScreensaverActivityManager* CScreensaverActivityManager::NewL(TInt aPriority)
+	{
+	CScreensaverActivityManager* self = new (ELeave) CScreensaverActivityManager(aPriority);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CActiveScheduler::Add(self);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CScreensaverActivityManager::CScreensaverActivityManager(TInt aPriority)
+	: CTimer(aPriority), iInactiveCallback(0,0), iActiveCallback(0,0), iState(EStNotActive)
+	{
+	}
+
+
+CScreensaverActivityManager::~CScreensaverActivityManager()
+	{
+	}
+
+
+void CScreensaverActivityManager::Start(TTimeIntervalSeconds aInterval,
+		TCallBack aInactiveCallback, TCallBack aActiveCallback) 
+	{  	
+	iInterval = aInterval;
+	iInactiveCallback = aInactiveCallback;
+	iActiveCallback = aActiveCallback;
+			
+	if	(iInterval.Int() < 0)
+		{
+		iInterval = TTimeIntervalSeconds(0);
+		}
+		
+	// Cancel outstanding timer, if any
+	CTimer::Cancel();
+	
+	if (iState == EStNotActive || iState == EStMonForInactivity) 
+		{
+		// Begin or contine monitoring for user inactivity
+		MonitorInactivity();
+		}
+	else 
+		{
+		// Continue monitoring for user activity
+		Inactivity(0); 
+		}
+	}
+
+     
+void CScreensaverActivityManager::SetInactivityTimeout(TTimeIntervalSeconds aInterval)
+	{
+	if (iState <= EStNotActive)
+    	{
+    	}
+	Start(aInterval, iInactiveCallback, iActiveCallback); 
+	}
+
+
+void CScreensaverActivityManager::MonitorInactivity()
+	{
+	if (User::InactivityTime() >= iInterval) 
+		{
+		// Already inactive enough, monitor for activity
+		iState = EStMonForActivity;
+		// Monitor for activity, set timer before callback to avoid missing any
+		// user activity should callback take some time.
+		Inactivity(0); 
+		// Inform client that the inactivity interval has ended.
+        (void) iInactiveCallback.CallBack();
+		}
+	else
+		{
+		// Monitor for Inactivity
+		iState = EStMonForInactivity;
+		Inactivity(iInterval);
+		}
+	}
+
+
+void CScreensaverActivityManager::RunL()
+	{
+	if (iStatus == KErrNone)
+		{
+		if (iState == EStMonForInactivity) 
+			{
+			// Looking for Inactivity, found it
+	   	    // Monitor for activity, set timer before callback to avoid missing 
+		    // any user activity should callback take some time.
+       		iState = EStMonForActivity;
+			Inactivity(0); 
+			// Inform client that the inactivity interval has ended.
+ 			(void) iInactiveCallback.CallBack();
+			}
+		else if (iState == EStMonForActivity)
+			{
+			// Looking for activity, found it
+			// Monitor for activity unless MonitorInactivity overrides it
+    		iState = EStMonForInactivity; 
+			MonitorInactivity();
+	        (void) iActiveCallback.CallBack();
+			}	
+		else
+            { // Must never happen, indicates internal state of object incorrect.
+            
+            }
+		}
+	}
--- a/src/screensaverappui.cpp	Wed Mar 31 21:32:18 2010 +0300
+++ b/src/screensaverappui.cpp	Wed Apr 14 15:58:13 2010 +0300
@@ -138,6 +138,7 @@
         {
         return EKeyWasConsumed;
         }
+    iModel->NotifyKeyEventReceived();
 
     if ( aType == EEventKey && aKeyEvent.iCode == EKeyNo )
         {
--- a/src/screensaverctrlmovingtext.cpp	Wed Mar 31 21:32:18 2010 +0300
+++ b/src/screensaverctrlmovingtext.cpp	Wed Apr 14 15:58:13 2010 +0300
@@ -105,6 +105,7 @@
         {
         return;
         }
+
     SCRLOGGER_WRITEF( _L("SCR:CScreensaverCtrlMovingText::Draw, screensaver is on or previewing") );
     // Graphics context to draw on.
     CWindowGc& gc = SystemGc();
@@ -146,6 +147,8 @@
 void CScreensaverCtrlMovingText::StartTimer()
     {
     SCRLOGGER_WRITEF( _L("SCR:CScreensaverCtrlMovingText::StartTimer start") );
+    Model().SharedDataInterface()->SetSSForcedLightsOn( ESSForceLightsOn );
+
     StartCaptureScreenTimer();
 
     StartBarRefreshTimer();
--- a/src/screensaverctrlnone.cpp	Wed Mar 31 21:32:18 2010 +0300
+++ b/src/screensaverctrlnone.cpp	Wed Apr 14 15:58:13 2010 +0300
@@ -75,7 +75,7 @@
     SCRLOGGER_WRITEF( _L("SCR:CScreensaverCtrlNone::ClearScreen start") );
     SwitchDisplayState( KDisplayOn );
     
-    SwitchLights( KMaxLightsOnTime );
+    SwitchLights( ESSForceLightsOn );
     }
 
 // -----------------------------------------------------------------------------
@@ -95,8 +95,7 @@
     SCRLOGGER_WRITEF( _L("SCR:CScreensaverCtrlNone::DrawObject start") );
     SwitchDisplayState( KDisplayOff );
     
-    SwitchLights( 0 );
-    
+    SwitchLights( ESSForceLightsOff );
     }
 
 // -----------------------------------------------------------------------------
--- a/src/screensaverctrlplugin.cpp	Wed Mar 31 21:32:18 2010 +0300
+++ b/src/screensaverctrlplugin.cpp	Wed Apr 14 15:58:13 2010 +0300
@@ -63,6 +63,8 @@
 void CScreensaverCtrlPlugin::StartTimer()
     {
     // Notify plugin that screensaver is starting
+    Model().SharedDataInterface()->SetSSForcedLightsOn( ESSForceLightsOn );
+    
     SendPluginEvent( EScreensaverEventStarting );
     
     
@@ -146,6 +148,15 @@
     return KErrNone;
     }
 
+// ---------------------------------------------------------------------------
+// CScreensaverCtrlPlugin::PluginImplementationUid()
+// ---------------------------------------------------------------------------
+//
+TUid CScreensaverCtrlPlugin::PluginImplementationUid() const
+    {
+    return iPluginImplUid;
+    }
+
 // From MScreensaverPluginHost
 // -----------------------------------------------------------------------------
 // CScreensaverCtrlPlugin::UseStandardIndicators
@@ -544,22 +555,23 @@
     // Skip the first character: '['
     lex.Get();
     
-    TUint screenSaverPluginImpUid;
+    TUint32 tempUid;
     
     // Get the UID
-    TInt err = lex.Val( screenSaverPluginImpUid, EHex );
+    TInt err = lex.Val( tempUid, EHex );
     
     // Bail out, if the UID is not parseable
     if ( err != KErrNone )
         {
         iPlugin = NULL;
         }
+    
+    iPluginImplUid = TUid::Uid( tempUid );
     //codescanner will crib if leaving function inside trap is called
     //after line break within the macro. Hence the following trap call
     //is made in a single line
     TRAP(err, iPlugin = STATIC_CAST( MScreensaverPlugin*, 
-        CScreensaverPluginInterfaceDefinition::NewL( 
-            TUid::Uid( screenSaverPluginImpUid ) ) ) );
+        CScreensaverPluginInterfaceDefinition::NewL( iPluginImplUid ) ) );
     
     if( err != KErrNone )
         return;
--- a/src/screensaverengine.cpp	Wed Mar 31 21:32:18 2010 +0300
+++ b/src/screensaverengine.cpp	Wed Apr 14 15:58:13 2010 +0300
@@ -18,7 +18,6 @@
 
 
 #include <barsread.h>
-#include <activitymanager.h>
 #include <featmgr.h>
 #include <PUAcodes.hrh>
 #include <Profile.hrh>
@@ -32,6 +31,7 @@
 #include "screensaverappui.h"
 #include "ScreensaverUtils.h"
 #include "screensaverutility.h"
+#include "screensaveractivitymanager.h"
 
 
 // Minimum plugin suspension time
@@ -43,6 +43,7 @@
 const TInt KNoPreview = 0;
 
 const TInt KPreviewTimeout = 10000000; // 10 sec
+const TInt KIgnoreActivityTimeout = 500000; // 0.5 sec
 
 const TText KSilentProfileInd= KPuaCodeSilentSymbol;
 const TText KSilentVibraInd= KPuaCodeAprofSilentVibra;
@@ -76,6 +77,7 @@
     delete iIndicatorArray;
     KillTimer( iPreviewTimer );
     KillTimer( iExpiryTimer );
+    KillTimer( iIgnoreActivityResetTimer );
     iAknUiServer.Close();
     }
 
@@ -155,9 +157,10 @@
             // Report whether started from Idle BEFORE bringing to foreground
             iSharedDataI->SetSSStartedFromIdleStatus();
             
-            iSharedDataI->SetSSForcedLightsOn(1);
-
-            ScreensaverUtility::BringToForeground();
+            if ( !View()->IsContentlessScreensaver() )
+                {
+                ScreensaverUtility::BringToForeground();
+                }
 
             SCRLOGGER_WRITE("Model: SS is displaying (BringToForeground)");
 
@@ -202,7 +205,6 @@
         View()->HideDisplayObject();
         }
 
-
     if( iScreenSaverIsPreviewing )
         {
         iSharedDataI->SetScreensaverPreviewMode( KNoPreview );
@@ -226,6 +228,7 @@
 void CScreensaverEngine::StartPreviewModeL( )
     {
     SCRLOGGER_WRITEF(_L("SCR: Inside CScreensaverEngine::StartPreviewModeL()") );
+    iActivityManagerScreensaverShort->SetInactivityTimeout(0);
     
     iScreenSaverIsPreviewing = ETrue;
     // Change the display object into what's being previewed
@@ -245,7 +248,10 @@
     
     iSharedDataI->SetScreensaverPreviewState( EScreenSaverPreviewStart );
 
-    ScreensaverUtility::BringToForeground();
+    if ( !View()->IsContentlessScreensaver() )
+        {
+        ScreensaverUtility::BringToForeground();
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -557,14 +563,14 @@
 
     // Start monitoring activity for screensaver
     iActivityManagerScreensaver
-        = CUserActivityManager::NewL( CActive::EPriorityStandard );
+        = CScreensaverActivityManager::NewL( CActive::EPriorityStandard );
         iActivityManagerScreensaver->Start( Timeout(), 
             TCallBack( HandleInactiveEventL,this ),
             TCallBack( HandleActiveEventL, this ) );
 
     // Start monitoring activity for screensaver, short timeout
     iActivityManagerScreensaverShort
-        = CUserActivityManager::NewL( CActive::EPriorityStandard );
+        = CScreensaverActivityManager::NewL( CActive::EPriorityUserInput );
     
         iActivityManagerScreensaverShort->Start( KTimeoutShort, 
             TCallBack( HandleInactiveEventShortL, this ), 
@@ -575,7 +581,7 @@
 // CScreensaverEngine::StopActivityMonitoring
 // -----------------------------------------------------------------------------
 //
-void CScreensaverEngine::StopActivityMonitoring( CUserActivityManager*& aActivityManager )
+void CScreensaverEngine::StopActivityMonitoring( CScreensaverActivityManager*& aActivityManager )
     {
     if ( aActivityManager )
         {
@@ -728,7 +734,15 @@
 TInt CScreensaverEngine::HandleActiveEventShortL( TAny* aPtr )
     {
     SCRLOGGER_WRITE("HandleActiveEventShortL(), stopping saver");
-    STATIC_CAST(CScreensaverEngine*, aPtr)->StopScreenSaver();
+    CScreensaverEngine* _this= STATIC_CAST(CScreensaverEngine*, aPtr);
+    if ( !_this->iIgnoreNextActivity )
+        {
+        _this->StopScreenSaver();
+        }
+    else
+        {
+        _this->iActivityManagerScreensaverShort->SetInactivityTimeout(0);
+        }
     return KErrNone;
     }
 
@@ -743,6 +757,7 @@
     CScreensaverEngine* _this= STATIC_CAST(CScreensaverEngine*, aPtr);
     // Restore inactivity timeout if it was reset at keylock activation
     _this->iActivityManagerScreensaverShort->SetInactivityTimeout(KTimeoutShort);
+    _this->iIgnoreNextActivity = EFalse;
     
     if ( _this->iSharedDataI->IsKeyguardOn() )
         {
@@ -771,16 +786,43 @@
     }
 
 // ---------------------------------------------------------------------------
+// CScreensaverEngine::ResetIgnoreFlagCb
+// ---------------------------------------------------------------------------
+//
+TInt CScreensaverEngine::ResetIgnoreFlagCb( TAny* aPtr )
+    {
+    CScreensaverEngine* engine = STATIC_CAST(CScreensaverEngine*, aPtr);
+    engine->KillTimer( engine->iIgnoreActivityResetTimer );
+    engine->iIgnoreNextActivity = EFalse;
+    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
 // CScreensaverEngine::HandleKeyguardStateChanged
 // ---------------------------------------------------------------------------
 //
 void CScreensaverEngine::HandleKeyguardStateChanged( TBool aEnabled )
     {
+    KillTimer( iIgnoreActivityResetTimer );
     if ( aEnabled )
         {
-        // Keyguard switch generates an activity event still, let the inactivity
-        // handler start the screensaver after one second
-        iActivityManagerScreensaverShort->SetInactivityTimeout(1);
+        if ( !iScreenSaverIsOn )
+            {
+            // Start the screensaver, but set the ignore flag in case keylock
+            // was activated using the side switch. The switch will generate
+            // activity that must be ignored.
+            StartScreenSaver();
+            iIgnoreNextActivity = ETrue;
+            
+            iIgnoreActivityResetTimer = CPeriodic::New( EPriorityLow );
+            if ( iIgnoreActivityResetTimer )
+                {
+                iIgnoreActivityResetTimer->Start( KIgnoreActivityTimeout, 
+                                                  KIgnoreActivityTimeout, 
+                                                  TCallBack( ResetIgnoreFlagCb, this ) );
+                }
+            }
         }
     else
         {
@@ -788,6 +830,18 @@
         }
     }
 
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CScreensaverEngine::NotifyKeyEventReceived()
+    {
+    if ( iSharedDataI->IsKeyguardOn() )
+        {
+        iIgnoreNextActivity = ETrue;
+        }
+    }
+
 // -----------------------------------------------------------------------------
 // CScreensaverEngine::View
 // -----------------------------------------------------------------------------
--- a/src/screensaverview.cpp	Wed Mar 31 21:32:18 2010 +0300
+++ b/src/screensaverview.cpp	Wed Apr 14 15:58:13 2010 +0300
@@ -31,6 +31,7 @@
 #include "screensaverengine.h"
 #include "screensavershareddatai.h"
 
+const TUid KBigClockScreensaverPluginImplUid = { 0x2002E6DE };
 
 // -----------------------------------------------------------------------------
 // CScreensaverView::NewLC
@@ -93,6 +94,13 @@
         case EDisplayPlugin:
             {
             iControl = CScreensaverCtrlPlugin::NewL();
+            CScreensaverCtrlPlugin* pluginCtrl = 
+                STATIC_CAST( CScreensaverCtrlPlugin*, iControl );
+            if ( pluginCtrl->PluginImplementationUid() ==
+                 KBigClockScreensaverPluginImplUid )
+                {
+                iIsContentless = ETrue;
+                }
             break;
             }
             
@@ -106,6 +114,7 @@
         case EDisplayNone:
             {
             iControl = CScreensaverCtrlNone::NewL();
+            iIsContentless = ETrue;
             break;
             }
             
@@ -156,6 +165,15 @@
         EScreenSaverPreviewError );
     }
 
+// ---------------------------------------------------------------------------
+// CScreensaverView::IsContentlessScreensaver
+// ---------------------------------------------------------------------------
+//
+TBool CScreensaverView::IsContentlessScreensaver() const
+    {
+    return iIsContentless;
+    }
+
 // -----------------------------------------------------------------------------
 // CScreensaverView::Id
 // -----------------------------------------------------------------------------
@@ -203,8 +221,11 @@
     {
     SCRLOGGER_WRITEF(_L("SCR: CScreensaverView::HideDisplayObject "));
     iControl->StopDrawObject();
-    
-    ScreensaverUtility::SendToBackground();
+
+    if ( !IsContentlessScreensaver() )
+        {
+        ScreensaverUtility::SendToBackground();
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -257,5 +278,6 @@
         delete iControl;
         iControl = NULL;
         }
+    iIsContentless = EFalse;
     }
 // End of file