211 // IsInactive() |
217 // IsInactive() |
212 // ----------------------------------------------------------------------------- |
218 // ----------------------------------------------------------------------------- |
213 // |
219 // |
214 TBool CTMActivityManager::IsInactive() |
220 TBool CTMActivityManager::IsInactive() |
215 { |
221 { |
|
222 #ifdef MONITOR_LIGHTS |
216 #ifdef _DEBUG |
223 #ifdef _DEBUG |
217 TN_DEBUG3( "CTMActivityManager::IsInactive()= %d, iLights = %d", User::InactivityTime().Int(), iLights); |
224 TN_DEBUG3( "CTMActivityManager::IsInactive()= %d, iLights = %d", User::InactivityTime().Int(), iLights); |
218 #endif |
225 #endif |
|
226 #else |
|
227 TN_DEBUG2( "CTMActivityManager::IsInactive()= %d", User::InactivityTime().Int()); |
|
228 #endif |
219 |
229 |
220 //if lights are off or inactivity timer is less that target the device is not idle |
230 //if lights are off or inactivity timer is less that target the device is not idle |
221 if( User::InactivityTime() >= TTimeIntervalSeconds(iTimeout) || !iLights ) |
231 if( User::InactivityTime() >= TTimeIntervalSeconds(iTimeout) |
|
232 #ifdef MONITOR_LIGHTS |
|
233 || !iLights |
|
234 #endif |
|
235 ) |
222 { |
236 { |
223 TN_DEBUG1( "CTMActivityManager::IsInactive() ETrue"); |
237 TN_DEBUG1( "CTMActivityManager::IsInactive() ETrue"); |
224 return ETrue; |
238 return ETrue; |
225 } |
239 } |
226 TN_DEBUG1( "CTMActivityManager::IsInactive() EFalse"); |
240 TN_DEBUG1( "CTMActivityManager::IsInactive() EFalse"); |
227 return EFalse; |
241 return EFalse; |
228 } |
242 } |
229 |
243 |
|
244 #ifdef MONITOR_LIGHTS |
230 // ----------------------------------------------------------------------------- |
245 // ----------------------------------------------------------------------------- |
231 // LightStatusChanged() |
246 // LightStatusChanged() |
232 // ----------------------------------------------------------------------------- |
247 // ----------------------------------------------------------------------------- |
233 // |
248 // |
234 void CTMActivityManager::LightStatusChanged(TInt /*aTarget*/, CHWRMLight::TLightStatus aStatus) |
249 void CTMActivityManager::LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus) |
235 { |
250 { |
236 TN_DEBUG2( "CTMActivityManager::LightStatusChanged() aStatus == %d", aStatus); |
251 TN_DEBUG3( "CTMActivityManager::LightStatusChanged() aTarget = %d, aStatus == %d", aTarget, aStatus); |
237 |
252 |
238 if( aStatus == CHWRMLight::ELightOff) |
253 if(aTarget & CHWRMLight::EPrimaryDisplay) |
239 { |
254 { |
240 TN_DEBUG1( "CTMActivityManager::LightStatusChanged() -- OFF"); |
255 if( aStatus == CHWRMLight::ELightOff ) |
241 iLights = EFalse; |
256 { |
242 } |
257 TN_DEBUG1( "CTMActivityManager::LightStatusChanged() -- OFF"); |
243 else |
258 iLights = EFalse; |
244 { |
259 } |
245 TN_DEBUG1( "CTMActivityManager::LightStatusChanged() -- ON"); |
260 else |
246 iLights = ETrue; |
261 { |
247 } |
262 TN_DEBUG1( "CTMActivityManager::LightStatusChanged() -- ON"); |
|
263 iLights = ETrue; |
|
264 } |
248 |
265 |
249 NotifyObserver(); |
266 NotifyObserver(); |
250 } |
267 } |
|
268 } |
|
269 #endif |
251 |
270 |
252 // ----------------------------------------------------------------------------- |
271 // ----------------------------------------------------------------------------- |
253 // NotifyObserver() |
272 // NotifyObserver() |
254 // ----------------------------------------------------------------------------- |
273 // ----------------------------------------------------------------------------- |
255 // |
274 // |