--- a/inc/screensavershareddatamonitor.h Fri Feb 19 22:51:44 2010 +0200
+++ b/inc/screensavershareddatamonitor.h Fri Mar 12 15:42:50 2010 +0200
@@ -108,7 +108,9 @@
* Callback fuction. Called when the ShuttingDown state changed
*/
static TInt HandleShuttingDownStateChanged(TAny* aPtr);
-
+
+ static TInt HandleActivateSSChanged( TAny* aPtr );
+
private:
/*
@@ -152,6 +154,9 @@
RProperty iShuttingDownProperty;
CSubscriber* iShuttingDownSubscriber;
+ RProperty iActivateSSProperty;
+ CSubscriber* iActivateSSSubscriber;
+
};
#endif // C_SCREENSAVERSHAREDDATAMONITOR_H
--- a/src/screensaverappui.cpp Fri Feb 19 22:51:44 2010 +0200
+++ b/src/screensaverappui.cpp Fri Mar 12 15:42:50 2010 +0200
@@ -156,7 +156,7 @@
{
if ( aType == EEventKeyUp )
{
- stop = ETrue;
+ //stop = ETrue;
}
}
}
--- a/src/screensaverengine.cpp Fri Feb 19 22:51:44 2010 +0200
+++ b/src/screensaverengine.cpp Fri Mar 12 15:42:50 2010 +0200
@@ -685,10 +685,10 @@
SCRLOGGER_WRITE("HandleInactiveEventL(), starting screensaver");
CScreensaverEngine* _this= STATIC_CAST(CScreensaverEngine*, aPtr);
-
+/*
// Double-start is OK, it will be checked in StartScreenSaver()
_this->StartScreenSaver( );
-
+*/
return KErrNone;
}
--- a/src/screensavershareddatai.cpp Fri Feb 19 22:51:44 2010 +0200
+++ b/src/screensavershareddatai.cpp Fri Mar 12 15:42:50 2010 +0200
@@ -386,7 +386,9 @@
// Check if power save mode has been denied
RProperty::Get( KPSUidScreenSaver, KScreenSaverNoPowerSaveMode, state );
- return ( state != 1 );
+ // TODO: remove when partial mode is working again
+ // return ( state != 1 );
+ return EFalse;
}
// -----------------------------------------------------------------------------
@@ -663,6 +665,8 @@
// Define and initialize "no power save mode" property
// Read: pass, Write: pass
DefineScreensaverProperties( KScreenSaverNoPowerSaveMode, KSSPolicyPass );
+
+ DefineScreensaverProperties( KScreenSaverActivate, KSSPolicyWriteUserData );
}
// -----------------------------------------------------------------------------
--- a/src/screensavershareddatamonitor.cpp Fri Feb 19 22:51:44 2010 +0200
+++ b/src/screensavershareddatamonitor.cpp Fri Mar 12 15:42:50 2010 +0200
@@ -65,6 +65,9 @@
DeleteSubscriber( iShuttingDownSubscriber );
iShuttingDownProperty.Close();
+
+ DeleteSubscriber( iActivateSSSubscriber );
+ iActivateSSProperty.Close();
}
// -----------------------------------------------------------------------------
@@ -133,6 +136,10 @@
iShuttingDownSubscriber = new (ELeave) CSubscriber(
TCallBack(HandleShuttingDownStateChanged, this), iShuttingDownProperty);
iShuttingDownSubscriber->SubscribeL();
+
+ User::LeaveIfError( iActivateSSProperty.Attach( KPSUidScreenSaver, KScreenSaverActivate ) );
+ iActivateSSSubscriber = new( ELeave ) CSubscriber( TCallBack( HandleActivateSSChanged, this ), iActivateSSProperty );
+ iActivateSSSubscriber->SubscribeL();
}
// -----------------------------------------------------------------------------
@@ -236,10 +243,16 @@
// Keys locked - if screensaver is running, this was caused by
// automatic keyguard and screensaver should refresh the view
// to show the keylock indicator
- if ( _this->Model().ScreenSaverIsOn() )
+/* if ( _this->Model().ScreenSaverIsOn() )
{
_this->View()->UpdateAndRefresh();
}
+*/
+ _this->Model().StartScreenSaver();
+ }
+ else
+ {
+ _this->Model().StopScreenSaver();
}
return KErrNone;
@@ -280,4 +293,31 @@
return KErrNone;
}
+
+TInt CScreensaverSharedDataMonitor::HandleActivateSSChanged( TAny* aPtr )
+ {
+ TInt activateState = -1;
+
+ RProperty::Get( KPSUidScreenSaver, KScreenSaverActivate, activateState );
+
+ if( activateState && -1 != activateState )
+ {
+ // Enable SS
+ SCRLOGGER_WRITE("SharedDataMonitor: Activate SS");
+ STATIC_CAST(CScreensaverSharedDataMonitor*, aPtr)->Model().StartScreenSaver();
+ }
+ else if ( !activateState )
+ {
+ // Disable SS
+ SCRLOGGER_WRITE("SharedDataMonitor: Stop SS");
+ STATIC_CAST(CScreensaverSharedDataMonitor*, aPtr)->Model().StopScreenSaver();
+ }
+ else
+ {
+ // Unknown state
+ }
+ return KErrNone;
+ }
+
+
// End of file
--- a/src/screensaversubscriber.cpp Fri Feb 19 22:51:44 2010 +0200
+++ b/src/screensaversubscriber.cpp Fri Mar 12 15:42:50 2010 +0200
@@ -68,8 +68,8 @@
{
if (iStatus.Int() == KErrNone)
{
+ SubscribeL();
iCallBack.CallBack();
- SubscribeL();
}
}