14 * Description: application class. |
14 * Description: application class. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include <e32property.h> |
18 #include <e32property.h> |
|
19 #include <e32debug.h> |
19 #include "hslaunch.h" |
20 #include "hslaunch.h" |
20 |
21 |
21 // ========================= DECLARATIONS ================================== |
22 // ========================= DECLARATIONS ================================== |
22 _LIT( KHsExeName, "homescreen.exe" ); |
23 _LIT( KHsExeName, "homescreen.exe" ); |
23 _LIT( KHsProcessName, "Home screen" ); |
24 _LIT( KHsProcessName, "Home screen" ); |
258 // CHsLaunch::ProcessEndedL() |
259 // CHsLaunch::ProcessEndedL() |
259 // From MHsProcessMonitorObserver |
260 // From MHsProcessMonitorObserver |
260 // ----------------------------------------------------------------------------- |
261 // ----------------------------------------------------------------------------- |
261 // |
262 // |
262 void CHsLaunch::ProcessEnded( const TExitType& aExitType, |
263 void CHsLaunch::ProcessEnded( const TExitType& aExitType, |
263 const TInt /*aExitReason*/, |
264 const TInt aExitReason, |
264 const TExitCategoryName& /*aExitCategory*/ ) |
265 const TExitCategoryName& /*aExitCategory*/ ) |
265 { |
266 { |
266 // Only respond to panic. EExitTerminate and EExitKill are ignored. |
|
267 if( aExitType != EExitPanic ) |
|
268 { |
|
269 return; |
|
270 } |
|
271 |
|
272 TInt crashCount = 0; |
267 TInt crashCount = 0; |
273 TInt error = RProperty::Get( KPSCategoryUid, |
268 TInt error = RProperty::Get( KPSCategoryUid, |
274 KPSCrashCountKey, |
269 KPSCrashCountKey, |
275 crashCount ); |
270 crashCount ); |
276 |
271 |
277 if( error == KErrNone ) |
272 // increment crash count in cenrep if the process has panic'd or killed with |
278 { |
273 // an error code |
279 crashCount++; |
274 if( aExitType == EExitPanic || |
280 error = RProperty::Set( KPSCategoryUid, |
275 ( aExitType == EExitKill && aExitReason != KErrNone ) ) |
281 KPSCrashCountKey, |
276 { |
282 crashCount ); |
277 if( error == KErrNone ) |
283 } |
278 { |
284 |
279 crashCount++; |
285 if( error == KErrNone ) |
280 error = RProperty::Set( KPSCategoryUid, |
286 { |
281 KPSCrashCountKey, |
287 User::After( KSleepOnRetry ); |
282 crashCount ); |
288 Activate(); |
283 } |
289 } |
284 |
290 else |
285 if( error == KErrNone ) |
291 { |
286 { |
292 ShutdownApp( error ); |
287 User::After( KSleepOnRetry ); |
|
288 Activate(); |
|
289 } |
|
290 else |
|
291 { |
|
292 ShutdownApp( error ); |
|
293 } |
293 } |
294 } |
294 } |
295 } |
295 |
296 |
296 // ----------------------------------------------------------------------------- |
297 // ----------------------------------------------------------------------------- |
297 // CHsLaunch::ProcessMonitoringErrorL() |
298 // CHsLaunch::ProcessMonitoringErrorL() |