equal
deleted
inserted
replaced
19 |
19 |
20 // INCLUDE FILES |
20 // INCLUDE FILES |
21 #include <e32base.h> |
21 #include <e32base.h> |
22 #include <e32std.h> |
22 #include <e32std.h> |
23 #include <f32file.h> |
23 #include <f32file.h> |
24 #include <activeidle2domainpskeys.h> |
24 #include <homescreendomainpskeys.h> |
25 #include <e32property.h> //for RProperty |
25 #include <e32property.h> //for RProperty |
26 #include "IdleObserver.h" |
26 #include "IdleObserver.h" |
27 #include "DRMHelperServer.h" |
27 #include "DRMHelperServer.h" |
28 |
28 |
29 // EXTERNAL DATA STRUCTURES |
29 // EXTERNAL DATA STRUCTURES |
132 void CIdleObserver::ConstructL() |
132 void CIdleObserver::ConstructL() |
133 { |
133 { |
134 #ifdef _DRM_TESTING |
134 #ifdef _DRM_TESTING |
135 CreateLogL(); //test |
135 CreateLogL(); //test |
136 #endif |
136 #endif |
137 User::LeaveIfError( iProperty.Attach( KPSUidAiInformation, KActiveIdleState ) ); |
137 User::LeaveIfError( iProperty.Attach( KHsCategoryUid, KHsCategoryStateKey ) ); |
138 } |
138 } |
139 |
139 |
140 // ----------------------------------------------------------------------------- |
140 // ----------------------------------------------------------------------------- |
141 // CIdleObserver::NewL |
141 // CIdleObserver::NewL |
142 // Two-phased constructor. |
142 // Two-phased constructor. |
198 WriteCurrentTimeL(); |
198 WriteCurrentTimeL(); |
199 //test code end |
199 //test code end |
200 #endif |
200 #endif |
201 |
201 |
202 // Resubscribe before processing new value to prevent missing updates |
202 // Resubscribe before processing new value to prevent missing updates |
203 TInt idleStauts = 0; |
203 TInt idleStatus = 0; |
204 TInt err( iStatus.Int() ); |
204 TInt err( iStatus.Int() ); |
205 if (err == KErrNone) |
205 if (err == KErrNone) |
206 { |
206 { |
207 StartL(); |
207 StartL(); |
208 User::LeaveIfError( iProperty.Get( |
208 User::LeaveIfError( iProperty.Get( |
209 KPSUidAiInformation, |
209 KHsCategoryUid, |
210 KActiveIdleState, idleStauts ) ); |
210 KHsCategoryStateKey, idleStatus ) ); |
211 if ( idleStauts == EPSAiForeground ) |
211 if ( idleStatus == EHomeScreenApplicationForeground ) |
212 { |
212 { |
213 iServer.HandleIdleL(); |
213 iServer.HandleIdleL(); |
214 } |
214 } |
215 } |
215 } |
216 else if ( err != KErrCancel ) |
216 else if ( err != KErrCancel ) |