1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
361 /** |
361 /** |
362 @internalComponent |
362 @internalComponent |
363 */ |
363 */ |
364 void CAppShutter::NextL() |
364 void CAppShutter::NextL() |
365 { |
365 { |
366 if (iNextWgIndex==iWgIds->Count()) |
366 while (iNextWgIndex < iWgIds->Count()) |
367 { |
|
368 CheckCompleteL(); |
|
369 } |
|
370 else |
|
371 { |
367 { |
372 const RWsSession::TWindowGroupChainInfo wgId=(*iWgIds)[iNextWgIndex++]; |
368 const RWsSession::TWindowGroupChainInfo wgId=(*iWgIds)[iNextWgIndex++]; |
373 CApaWindowGroupName* wgName=CApaWindowGroupName::NewLC(iWsSession,wgId.iId); |
369 CApaWindowGroupName* wgName=CApaWindowGroupName::NewLC(iWsSession,wgId.iId); |
374 if (!IsWgIdValid(wgId.iId) || wgName->IsSystem() || wgName->Hidden()) |
370 |
375 { |
371 // Skip invalid window groups. |
376 NextL(); |
372 // Note that if the window group name is null then CApaWindowGroupName |
|
373 // uses a default name that yields an app uid of zero. |
|
374 if (wgName->AppUid().iUid == 0 || wgName->IsSystem() || wgName->Hidden()) |
|
375 { |
|
376 CleanupStack::PopAndDestroy(); // wgName |
377 } |
377 } |
378 else |
378 else |
379 { |
379 { |
380 TPtrC docName=wgName->DocName(); |
380 TPtrC docName=wgName->DocName(); |
381 CEikServBackupSession::TClosedFile data; |
381 CEikServBackupSession::TClosedFile data; |
382 if (docName.Length()) |
382 if (docName.Length()) |
383 { |
383 { |
384 data.iDocName=docName; |
384 data.iDocName=docName; |
385 } |
385 } |
386 data.iUid=wgName->AppUid(); |
386 data.iUid=wgName->AppUid(); |
|
387 CleanupStack::PopAndDestroy(); // wgName |
|
388 |
387 // We don't want to restart server apps |
389 // We don't want to restart server apps |
388 if (wgId.iParentId <= 0) |
390 if (wgId.iParentId <= 0) |
389 { |
391 { |
390 iClosedFiles.AppendL(data); |
392 iClosedFiles.AppendL(data); |
391 } |
393 } |
402 { |
404 { |
403 iTimer->Cancel(); |
405 iTimer->Cancel(); |
404 } |
406 } |
405 // If hardware use patchable constant if not default to 5 seconds |
407 // If hardware use patchable constant if not default to 5 seconds |
406 iTimer->Start(KUIKONBackupCloseAllFilesTimeout,KUIKONBackupCloseAllFilesTimeout,TCallBack(TimerCallBackL,this)); |
408 iTimer->Start(KUIKONBackupCloseAllFilesTimeout,KUIKONBackupCloseAllFilesTimeout,TCallBack(TimerCallBackL,this)); |
407 } |
409 return; |
408 CleanupStack::PopAndDestroy(); // wgName |
410 } |
409 } |
411 } |
410 } |
412 |
411 |
413 CheckCompleteL(); |
412 /** |
|
413 @internalComponent |
|
414 */ |
|
415 TBool CAppShutter::IsWgIdValid(TInt aWgId) |
|
416 { |
|
417 TBuf<600> name; |
|
418 const TInt r=iWsSession.GetWindowGroupNameFromIdentifier(aWgId,name); |
|
419 return r==KErrNone; |
|
420 } |
414 } |
421 |
415 |
422 /** |
416 /** |
423 @internalComponent |
417 @internalComponent |
424 */ |
418 */ |