satengine/SatServer/SystemState/src/CSatSystemState.cpp
branchRCL_3
changeset 19 7d48bed6ce0c
parent 8 ba42c4bd84dd
child 20 987c9837762f
--- a/satengine/SatServer/SystemState/src/CSatSystemState.cpp	Thu Aug 19 10:28:14 2010 +0300
+++ b/satengine/SatServer/SystemState/src/CSatSystemState.cpp	Tue Aug 31 15:45:17 2010 +0300
@@ -16,6 +16,7 @@
 */
 
 
+
 #include    <mtclreg.h>
 #include    <smsclnt.h>
 #include    <smutset.h>
@@ -25,8 +26,14 @@
 #include    <ProfileEngineSDKCRKeys.h>
 #include    <settingsinternalcrkeys.h>
 #include    <satdomainpskeys.h>
-#include    <activeidle2domainpskeys.h>
-#include    <ScreensaverInternalPSKeys.h>
+#define Q_OS_SYMBIAN // needed to activate homescreendomainpskeys.h
+#include    <homescreendomainpskeys.h>
+
+// ******************************************************************
+// TODO: ScreensaverInternalPSKeys.h does no longer exist.
+// Must find an alternative way to check screen locked state.
+// #include    <ScreensaverInternalPSKeys.h>
+// ******************************************************************
 #include    <ctsydomainpskeys.h>
 #include    <sbdefs.h>
 #include    <BTSapDomainPSKeys.h>
@@ -269,16 +276,15 @@
 TBool CSatSystemState::IsPhoneInIdleStateL()
     {
     LOG( SIMPLE, "SATSYSTEMSTATE: CSatSystemState::IsPhoneInIdleState calling" )
-    TInt idleStatus;
+    TInt idleStatus(EHomeScreenIdleState) ;
 
     // Get the idle status from P&S
     User::LeaveIfError( RProperty::Get(
-        KPSUidAiInformation,
-        KActiveIdleState,
-        idleStatus ) );
-
-    // Returns true if phone in idle state.
-    const TBool result( EPSAiForeground == idleStatus );
+        KHsCategoryUid, 
+        KHsCategoryStateKey, 
+        idleStatus));
+    // Returns true if phone in idle state. 
+    const TBool result( EHomeScreenIdleState == idleStatus ); 
 
     LOG2( SIMPLE, "SATSYSTEMSTATE: CSatSystemState::IsPhoneInIdleState exiting \
         with value: %d", result )
@@ -294,6 +300,11 @@
     LOG( SIMPLE, 
     "SATSYSTEMSTATE: CSatSystemState::IsScreenSaverActivedFromIdle calling" )
     TBool result( EFalse );
+
+    /*
+    // TODO: This method can no longer be used for checking screen saver status.
+    // Must find an alternative method.
+
     TInt screenSaverActive( -1 );
 
     // Get the idle status from P&S
@@ -312,7 +323,8 @@
     LOG2( SIMPLE, 
         "SATSYSTEMSTATE: CSatSystemState:: IsScreenSaverActivedFromIdle \
          err: %d", err )
-        
+    */
+
     LOG2( SIMPLE, 
         "SATSYSTEMSTATE: CSatSystemState:: \
         IsScreenSaverActivedFromIdle exiting with value: %d", result )