taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp
branchRCL_3
changeset 17 b8fae6b8a148
parent 11 ff572dfe6d86
child 18 d05a55b217df
equal deleted inserted replaced
12:9674c1a575e9 17:b8fae6b8a148
    15  *
    15  *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include "tsfswengine.h"
    19 #include "tsfswengine.h"
       
    20 #include "tscpsnotifier.h"
       
    21 #include "tsfswdatalist.h"
    20 #include "tsfsalwaysshownapplist.h"
    22 #include "tsfsalwaysshownapplist.h"
    21 #include "tsfshiddenapplist.h"
    23 #include "tsfshiddenapplist.h"
    22 #include "tsfswidgetlist.h"
    24 #include "tsfswidgetlist.h"
    23 #include "tsfswiconcache.h"
       
    24 #include "tspreviewprovider.h"
    25 #include "tspreviewprovider.h"
    25 #include "tsfswclient.h"
    26 #include "tsfswclient.h"
    26 #include <apgtask.h>
    27 #include <apgtask.h>
    27 #include <AknDef.h>
    28 #include <AknDef.h>
    28 #include <apgwgnam.h>
    29 #include <apgwgnam.h>
    32 #include <s32mem.h>
    33 #include <s32mem.h>
    33 #include <bitmaptransforms.h>
    34 #include <bitmaptransforms.h>
    34 #include "enginelogging.h"
    35 #include "enginelogging.h"
    35 
    36 
    36 // time to wait before refreshing content
    37 // time to wait before refreshing content
    37 const TInt KContentRefreshDelay = 500000; // 0.5 sec
    38 const TInt KContentRefreshDelay = 50000; // 0.05 sec
    38 
    39 
    39 // for screenshots, they are scaled down to (screensize/this_factor).
    40 // for screenshots, they are scaled down to (screensize/this_factor).
    40 const TInt KScreenSizeFactor = 2;
    41 const TInt KScreenSizeFactor = 2;
    41 
    42 
    42 // format to get a lowercase hex string prefixed with 0x
    43 // format to get a lowercase hex string prefixed with 0x
    43 _LIT( KHexFmt, "0x%x" );
    44 _LIT( KHexFmt, "0x%x" );
       
    45 
       
    46 const TUid KTsCameraUid = { 0x101F857a };
       
    47 
       
    48 //close command for widget
       
    49 const TInt KCloseWidgetCmd(9);
       
    50 //handle close cmd for s60 widgets
       
    51 _LIT(KWidgetAppName, "widgetlauncher.exe");
       
    52 //handle close cmd for CWRT widgets
       
    53 _LIT(KWidgetAppNameWgt,"wgtwidgetlauncher.exe");
    44 
    54 
    45 // --------------------------------------------------------------------------
    55 // --------------------------------------------------------------------------
    46 // CTsFswEngine::NewL
    56 // CTsFswEngine::NewL
    47 // --------------------------------------------------------------------------
    57 // --------------------------------------------------------------------------
    48 //
    58 //
    84     iEnv = CEikonEnv::Static();
    94     iEnv = CEikonEnv::Static();
    85 
    95 
    86     User::LeaveIfError( iWsSession.Connect() );
    96     User::LeaveIfError( iWsSession.Connect() );
    87     User::LeaveIfError( iAppArcSession.Connect() );
    97     User::LeaveIfError( iAppArcSession.Connect() );
    88 
    98 
    89     iHiddenAppList = CTsFsHiddenAppList::NewL( *this );
    99     iDataList = CTsFswDataList::NewL(*this);
    90     iAlwaysShownAppList = CTsFsAlwaysShownAppList::NewL();
       
    91 
       
    92     iWidgetsSupported = FeatureManager::FeatureSupported( KFeatureIdWebWidgets );
   100     iWidgetsSupported = FeatureManager::FeatureSupported( KFeatureIdWebWidgets );
    93     if ( iWidgetsSupported )
       
    94         {
       
    95         iWidgetList = CTsFsWidgetList::NewL();
       
    96         }
       
    97 
       
    98     // create app icon retriever instance
       
    99     iAppIcons = CTsFswIconCache::NewL();
       
   100 
   101 
   101     // get an initial list of tasks
   102     // get an initial list of tasks
   102     iAppDataRefreshNeeded = ETrue;
   103     iDataList->SetAppDataRefreshNeeded();
   103     CollectTasksL();
   104     CollectTasksL();
   104 
   105 
   105     // listen for app screenshots
   106     // listen for app screenshots
   106     iPreviewProvider = CTsFastSwapPreviewProvider::NewL( *this );
   107     iPreviewProvider = CTsFastSwapPreviewProvider::NewL( *this );
   107     SetPreviewParams();
   108     SetPreviewParams();
   114             Swi::KUidSoftwareInstallKey ) == KErrNone )
   115             Swi::KUidSoftwareInstallKey ) == KErrNone )
   115         {
   116         {
   116         iSwiProp.Subscribe( iStatus );
   117         iSwiProp.Subscribe( iStatus );
   117         SetActive();
   118         SetActive();
   118         }
   119         }
       
   120     iCpsWidgetPublisher = CTSCpsNotifier::NewL(*this);
   119     }
   121     }
   120 
   122 
   121 // --------------------------------------------------------------------------
   123 // --------------------------------------------------------------------------
   122 // CTsFswEngine::~CTsFswEngine
   124 // CTsFswEngine::~CTsFswEngine
   123 // --------------------------------------------------------------------------
   125 // --------------------------------------------------------------------------
   128     iSwiProp.Close();
   130     iSwiProp.Close();
   129 
   131 
   130     delete iUpdateStarter;
   132     delete iUpdateStarter;
   131     delete iPreviewProvider;
   133     delete iPreviewProvider;
   132 
   134 
   133     // delete the bitmaps as the hash map cannot do that
       
   134     THashMapIter<TInt, CFbsBitmap*> iter( iScreenshots );
       
   135     while ( const TInt* key = iter.NextKey() )
       
   136         {
       
   137         CFbsBitmap** value = iter.CurrentValue();
       
   138         delete *value;
       
   139         }
       
   140     iScreenshots.Close();
       
   141     delete iAppIcons;
       
   142 
       
   143     iData.ResetAndDestroy();
       
   144     iWgIds.Close();
   135     iWgIds.Close();
   145 
   136 
   146     delete iHiddenAppList;
       
   147     delete iAlwaysShownAppList;
       
   148     delete iWidgetList;
       
   149     iAppArcSession.Close();
   137     iAppArcSession.Close();
   150     iWsSession.Close();
   138     iWsSession.Close();
   151 
   139 
   152     for ( TInt i = 0; i < iRotaTasks.Count(); i++ )
   140     for ( TInt i = 0; i < iRotaTasks.Count(); i++ )
   153         {
   141         {
   154         iRotaTasks[i]->Cancel();
   142         iRotaTasks[i]->Cancel();
   155         delete iRotaTasks[i];
   143         delete iRotaTasks[i];
   156         }
   144         }
   157     iRotaTasks.Close();
   145     iRotaTasks.Close();
   158 //    delete iContextUtility;
   146     delete iDataList;
       
   147     delete iCpsWidgetPublisher;
   159     }
   148     }
   160 
   149 
   161 // --------------------------------------------------------------------------
   150 // --------------------------------------------------------------------------
   162 // CTsFswEngine::FswDataL
   151 // CTsFswEngine::FswDataL
   163 // --------------------------------------------------------------------------
   152 // --------------------------------------------------------------------------
   164 //
   153 //
   165 EXPORT_C const RTsFswArray& CTsFswEngine::FswDataL()
   154 EXPORT_C const RTsFswArray& CTsFswEngine::FswDataL()
   166     {
   155     {
   167     TSLOG_CONTEXT( FswDataL, TSLOG_LOCAL );
   156     TSLOG_CONTEXT( FswDataL, TSLOG_LOCAL );
   168     TSLOG1_IN( "dirty flag = %d", iTaskListDirty );
   157     TSLOG_OUT();
   169 
   158     return iDataList->FswDataL();
   170     // check the dirty flag and refresh if needed
       
   171     if ( iTaskListDirty )
       
   172         {
       
   173         CollectTasksL();
       
   174         // dirty flag is cleared in the above call
       
   175         }
       
   176 
       
   177     // Get app icon for entries without screenshot,
       
   178     // do this only here as the app icon is not needed in case a screenshot
       
   179     // is already available.
       
   180     for ( TInt i = 0, ie = iData.Count(); i != ie; ++i )
       
   181         {
       
   182         if ( !iData[i]->ScreenshotHandle() )
       
   183             {
       
   184             CFbsBitmap* bmp;
       
   185             CFbsBitmap* mask;
       
   186             TUid appUid = iData[i]->AppUid();
       
   187             // this will leave with -46 in case of widgets if we do not have AllFiles cap
       
   188             TRAPD( err, iAppIcons->GetIconL( appUid, bmp, mask ) );
       
   189             if ( err == KErrNone && bmp )
       
   190                 {
       
   191                 iData[i]->SetAppIconHandles( bmp->Handle(),
       
   192                     mask ? mask->Handle() : 0 );
       
   193                 }
       
   194             else
       
   195                 {
       
   196                 iAppIcons->DefaultIcon( bmp, mask );
       
   197                 iData[i]->SetAppIconHandles( bmp->Handle(),
       
   198                     mask ? mask->Handle() : 0 );
       
   199                 }
       
   200             }
       
   201         }
       
   202 
       
   203     TSLOG_OUT();
       
   204     return iData;
       
   205     }
   159     }
   206 
   160 
   207 // --------------------------------------------------------------------------
   161 // --------------------------------------------------------------------------
   208 // CTsFswEngine::CloseAppL
   162 // CTsFswEngine::CloseAppL
   209 // --------------------------------------------------------------------------
   163 // --------------------------------------------------------------------------
   216     if( iWidgetsSupported && 0 > aWgId )
   170     if( iWidgetsSupported && 0 > aWgId )
   217         {
   171         {
   218         // convert aWgId to an index in the list of running widgets and close widget
   172         // convert aWgId to an index in the list of running widgets and close widget
   219         CloseWidgetL( -aWgId -1 );
   173         CloseWidgetL( -aWgId -1 );
   220         }
   174         }
   221     else if( !iAlwaysShownAppList->IsAlwaysShownApp( AppUidForWgIdL( aWgId ) ) )
   175     else if( !iDataList->AlwaysShownApps()->IsAlwaysShownApp( AppUidForWgIdL( aWgId ) ) )
   222         {
   176         {
   223         // send window group event to kill the app
   177         // send window group event to kill the app
   224         TWsEvent event;
   178         TWsEvent event;
   225         event.SetTimeNow();
   179         event.SetTimeNow();
   226         event.SetType( KAknShutOrHideApp );
   180         event.SetType( KAknShutOrHideApp );
   240     TSLOG1_IN( "aWgId = %d", aWgId );
   194     TSLOG1_IN( "aWgId = %d", aWgId );
   241 
   195 
   242     if ( iWidgetsSupported && aWgId < 0 )
   196     if ( iWidgetsSupported && aWgId < 0 )
   243         {
   197         {
   244         // for widgets clients see a wgid that is -1*(index+1)
   198         // for widgets clients see a wgid that is -1*(index+1)
   245         const RWidgetInfoArray& arr( iWidgetList->RunningWidgets() );
   199         const RWidgetInfoArray& arr( iDataList->Widgets()->RunningWidgets() );
   246         // convert aWgId to an index in the list of running widgets
   200         // convert aWgId to an index in the list of running widgets
   247         TInt idx = -aWgId - 1;
   201         TInt idx = -aWgId - 1;
   248         // if index is valid then handle the widget specially
   202         // if index is valid then handle the widget specially
   249         if ( idx >= 0 && idx < arr.Count() )
   203         if ( idx >= 0 && idx < arr.Count() )
   250             {
   204             {
   265 // CTsFswEngine::SwitchToWidgetL
   219 // CTsFswEngine::SwitchToWidgetL
   266 // --------------------------------------------------------------------------
   220 // --------------------------------------------------------------------------
   267 //
   221 //
   268 void CTsFswEngine::SwitchToWidgetL( TInt aWidgetIndex )
   222 void CTsFswEngine::SwitchToWidgetL( TInt aWidgetIndex )
   269     {
   223     {
   270     const RWidgetInfoArray& arr( iWidgetList->RunningWidgets() );
   224     const RWidgetInfoArray& arr( iDataList->Widgets()->RunningWidgets() );
   271     RApaLsSession ls;
       
   272     User::LeaveIfError( ls.Connect() );
       
   273     CleanupClosePushL( ls );
       
   274     CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
   225     CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
   275     cmdLine->SetCommandL( EApaCommandRun );
   226     cmdLine->SetCommandL( EApaCommandRun );
   276     TApaAppInfo info;
   227     TApaAppInfo info;
   277     iAppArcSession.GetAppInfo( info, arr[aWidgetIndex]->iUid ); // codescanner::accessArrayElementWithoutCheck2 (aWidgetIndex checked in SwitchToAppL())
   228     iAppArcSession.GetAppInfo( info, arr[aWidgetIndex]->iUid ); // codescanner::accessArrayElementWithoutCheck2 (aWidgetIndex checked in SwitchToAppL())
   278     cmdLine->SetExecutableNameL( info.iFullName );
   229     cmdLine->SetExecutableNameL( info.iFullName );
   279     ls.StartApp( *cmdLine );
   230     iAppArcSession.StartApp( *cmdLine );
   280     CleanupStack::PopAndDestroy( 2, &ls );
   231     CleanupStack::PopAndDestroy(cmdLine);
   281     }
   232     }
   282 
   233 
   283 // --------------------------------------------------------------------------
   234 // --------------------------------------------------------------------------
   284 // CTsFswEngine::UpdateTaskList
   235 // CTsFswEngine::UpdateTaskList
   285 // Callback from appui
   236 // Callback from appui
   288 void CTsFswEngine::UpdateTaskList()
   239 void CTsFswEngine::UpdateTaskList()
   289     {
   240     {
   290     TSLOG_CONTEXT( UpdateTaskList, TSLOG_LOCAL );
   241     TSLOG_CONTEXT( UpdateTaskList, TSLOG_LOCAL );
   291     TSLOG_IN();
   242     TSLOG_IN();
   292 
   243 
   293     // If no clients are subscribed for fsw content change notifications
   244     // There can be many calls in a row, use a timer to prevent degrading
   294     // then there is no need to waste time with rebuilding the task list,
   245     // device performance.
   295     // just set the dirty flag.
   246     if ( !iUpdateStarter->IsActive() )
   296     TInt listenerCount = iObserver.FswDataListenerCount();
   247         {
   297     TSLOG1( TSLOG_INFO, "listener count = %d", listenerCount );
   248         iUpdateStarter->Start( KContentRefreshDelay, 0,
   298     if ( listenerCount > 0 )
       
   299         {
       
   300         // There can be many calls in a row, use a timer to prevent degrading
       
   301         // device performance.
       
   302         if ( !iUpdateStarter->IsActive() )
       
   303             {
       
   304             iUpdateStarter->Start( KContentRefreshDelay, 0,
       
   305                 TCallBack( UpdateStarterCallback, this ) );
   249                 TCallBack( UpdateStarterCallback, this ) );
   306             }
   250         }
   307         }
   251     iDataList->SetDirty();
   308     else
       
   309         {
       
   310         iTaskListDirty = ETrue;
       
   311         }
       
   312 
   252 
   313     // screenshot taking support - call Register and Unregister when needed
   253     // screenshot taking support - call Register and Unregister when needed
   314     UpdatePreviewContent();
   254     UpdatePreviewContent();
   315 
   255 
   316     // get the foreground app uid and publish it to CFW if different than before
   256     // get the foreground app uid and publish it to CFW if different than before
   347             }
   287             }
   348 
   288 
   349         CApaWindowGroupName* wgn = CApaWindowGroupName::NewLC(
   289         CApaWindowGroupName* wgn = CApaWindowGroupName::NewLC(
   350             iWsSession, allWgIds[i].iId );
   290             iWsSession, allWgIds[i].iId );
   351         TUid newUid = wgn->AppUid();
   291         TUid newUid = wgn->AppUid();
   352         TBool hidden = wgn->Hidden() || iHiddenAppList->IsHiddenL(
   292         TBool hidden = wgn->Hidden() || iDataList->HiddenApps()->IsHiddenL(
   353             newUid, iWsSession, allWgIds[i].iId );
   293             newUid, iWsSession, allWgIds[i].iId );
   354         CleanupStack::PopAndDestroy( wgn );
   294         CleanupStack::PopAndDestroy( wgn );
   355 
   295 
   356         if ( !hidden && newUid.iUid )
   296         if ( !hidden && newUid.iUid )
   357             {
   297             {
   408 // --------------------------------------------------------------------------
   348 // --------------------------------------------------------------------------
   409 //
   349 //
   410 TBool CTsFswEngine::CollectTasksL()
   350 TBool CTsFswEngine::CollectTasksL()
   411     {
   351     {
   412     TSLOG_CONTEXT( CollectTasksL, TSLOG_LOCAL );
   352     TSLOG_CONTEXT( CollectTasksL, TSLOG_LOCAL );
   413     TSLOG_IN();
   353     TBool changed = iDataList->CollectTasksL();
   414 
       
   415     // clear dirty flag
       
   416     iTaskListDirty = EFalse;
       
   417 
       
   418     TBool changed = EFalse;
       
   419     RTsFswArray newList;
       
   420     CleanupResetAndDestroyPushL( newList );
       
   421 
       
   422     // update app data if needed
       
   423     // (usually on startup and when new apps might have been installed)
       
   424     if ( iAppDataRefreshNeeded )
       
   425         {
       
   426         TSLOG0( TSLOG_INFO, "refreshing app data" );
       
   427         iAppArcSession.GetAllApps();
       
   428         iAlwaysShownAppList->InitializeAlwaysShownListL();
       
   429         iAppDataRefreshNeeded = EFalse;
       
   430         }
       
   431 
       
   432     // get all window groups
       
   433     RArray<RWsSession::TWindowGroupChainInfo> allWgIds;
       
   434     CleanupClosePushL( allWgIds );
       
   435     User::LeaveIfError( iWsSession.WindowGroupList( 0, &allWgIds ) );
       
   436     TInt count = allWgIds.Count();
       
   437 
       
   438     for ( TInt i = 0; i < count; ++i )
       
   439         {
       
   440         // ignore uninteresting entries (e.g. embedded apps)
       
   441         if ( allWgIds[i].iParentId > 0 )
       
   442             {
       
   443             continue;
       
   444             }
       
   445         
       
   446         // get window group name
       
   447         TInt wgId = allWgIds[i].iId;
       
   448         CApaWindowGroupName* windowName =
       
   449             CApaWindowGroupName::NewLC( iWsSession, wgId );
       
   450         TUid appUid = windowName->AppUid();
       
   451         
       
   452         // ignore entries with null uid
       
   453         if ( !appUid.iUid )
       
   454             {
       
   455             CleanupStack::PopAndDestroy( windowName );
       
   456             continue;
       
   457             }
       
   458         
       
   459         // will append the task to our own list only if it is not hidden
       
   460         TBool onHiddenList = iHiddenAppList->IsHiddenL(
       
   461             appUid, iWsSession, wgId );
       
   462 
       
   463         // get screen number (-1=console, 0=main screen, 1=cover ui)
       
   464         TInt appScreen = 0;
       
   465         TInt scrNumErr = iAppArcSession.GetDefaultScreenNumber( appScreen, appUid );
       
   466 
       
   467         // check if it is on always-shown list
       
   468         TBool mustShow = iAlwaysShownAppList->IsAlwaysShownApp( appUid );
       
   469 
       
   470 #ifdef _DEBUG
       
   471         const TDesC& captionDbg( windowName->Caption() );
       
   472         TSLOG4( TSLOG_INFO, "[%d] wgid=%d appuid=%x (%S)", i, wgId,
       
   473             appUid.iUid, &captionDbg );
       
   474         TSLOG4( TSLOG_INFO, "hidden=%d onhiddenlist=%d mustshow=%d scrno=%d",
       
   475             windowName->Hidden(), onHiddenList, mustShow, appScreen );
       
   476 #endif
       
   477 
       
   478         // if this is the widget app then save wgid for later use
       
   479         // and ignore it, but include running widgets instead
       
   480         if ( iWidgetsSupported && appUid.iUid == KWidgetAppUidValue )
       
   481             {
       
   482             changed = ETrue;
       
   483             }
       
   484         // add item to task list if it is always-shown OR it is not hidden
       
   485         // and it is not on cover ui
       
   486         else if ( mustShow
       
   487                 || ( !onHiddenList
       
   488                     && !windowName->Hidden()
       
   489                     && ( appScreen == 0 || appScreen == -1 )
       
   490                     && scrNumErr == KErrNone ) )
       
   491             {
       
   492             if ( AddEntryL( wgId, appUid, windowName, newList, EFalse ) )
       
   493                 {
       
   494                 changed = ETrue;
       
   495                 }
       
   496             }
       
   497         CleanupStack::PopAndDestroy( windowName );
       
   498         }
       
   499     CleanupStack::PopAndDestroy( &allWgIds );
       
   500     CheckWidgetsL(newList);
       
   501     
       
   502     // if counts for old and new lists do not match then there is a change for sure,
       
   503     // probably an app has been closed
       
   504     if ( iData.Count() != newList.Count() )
       
   505         {
       
   506         changed = ETrue;
       
   507         }
       
   508 
       
   509     // move pointers from the temporary list into the real one
       
   510     iData.ResetAndDestroy();
       
   511     TInt newListCount = newList.Count();
       
   512     TSLOG1( TSLOG_INFO, "new list count = %d", newListCount );
       
   513     for ( TInt i = 0; i < newListCount; ++i )
       
   514         {
       
   515         TSLOG3( TSLOG_INFO, "[%d] %S wgid=%d",
       
   516             i, &newList[i]->AppName(), newList[i]->WgId() );
       
   517         iData.AppendL( newList[i] );
       
   518         newList[i] = 0;
       
   519         }
       
   520     CleanupStack::PopAndDestroy( &newList );
       
   521     
       
   522     TSLOG1_OUT( "change flag = %d", changed );
   354     TSLOG1_OUT( "change flag = %d", changed );
   523     return changed;
   355     return changed;
   524     }
   356     }
   525 
   357 
   526 // --------------------------------------------------------------------------
   358     
   527 // CTsFswEngine::AddEntryL
       
   528 // --------------------------------------------------------------------------
       
   529 //
       
   530 TBool CTsFswEngine::AddEntryL( TInt aWgId, const TUid& aAppUid,
       
   531         CApaWindowGroupName* aWgName, RTsFswArray& aNewList,
       
   532         TBool aIsWidget )
       
   533     {
       
   534     TBool changed = EFalse;
       
   535     CTsFswEntry* entry = CTsFswEntry::NewLC();
       
   536     entry->SetWgId( aWgId );
       
   537     entry->SetAppUid( aAppUid );
       
   538     entry->SetWidget( aIsWidget );
       
   539 
       
   540     // check if present in old list and if yes then take some of the old data
       
   541     TBool found = CheckIfExistsL( *entry, aAppUid, changed, aNewList );
       
   542 
       
   543     // if not present previously then find out app name
       
   544     // and check if screenshot is already available
       
   545     if ( !found )
       
   546         {
       
   547         // when adding a new entry to the list it is changed for sure
       
   548         changed = ETrue;
       
   549         HBufC* name = FindAppNameLC( aWgName, aAppUid, aWgId );
       
   550         if ( name )
       
   551             {
       
   552             entry->SetAppNameL( *name );
       
   553             }
       
   554         CleanupStack::PopAndDestroy( name );
       
   555         TInt h = LookupScreenshotHandle( aWgId );
       
   556         if ( h )
       
   557             {
       
   558             entry->SetScreenshotHandle( h );
       
   559             }
       
   560         entry->SetAlwaysShown( iAlwaysShownAppList->IsAlwaysShownApp( aAppUid ) );
       
   561         if ( aWgName )
       
   562             {
       
   563             entry->SetSystemApp( aWgName->IsSystem() );
       
   564             }
       
   565         }
       
   566 
       
   567     // add to new list, ownership is transferred
       
   568     aNewList.AppendL( entry );
       
   569     CleanupStack::Pop( entry );
       
   570     return changed;
       
   571     }
       
   572 
       
   573 // --------------------------------------------------------------------------
       
   574 // CTsFswEngine::CheckIfExistsL
       
   575 // --------------------------------------------------------------------------
       
   576 //
       
   577 TBool CTsFswEngine::CheckIfExistsL( CTsFswEntry& aEntry,
       
   578         const TUid& aAppUid,
       
   579         TBool& aChanged,
       
   580         RTsFswArray& aNewList )
       
   581     {
       
   582     for ( TInt entryIdx = 0, oldCount = iData.Count();
       
   583             entryIdx < oldCount; ++entryIdx )
       
   584         {
       
   585         // Enough to check appuid, no need to bother with wgid as the
       
   586         // screenshot handle is up-to-date or will be updated later anyway.
       
   587         if ( iData[entryIdx]->AppUid() == aAppUid )
       
   588             {
       
   589             // if positions do not match then the list is different than before
       
   590             if ( entryIdx != aNewList.Count() )
       
   591                 {
       
   592                 aChanged = ETrue;
       
   593                 }
       
   594             CTsFswEntry* oldEntry = iData[entryIdx];
       
   595             aEntry.SetAppNameL( oldEntry->AppName() );
       
   596             aEntry.SetScreenshotHandle( oldEntry->ScreenshotHandle() );
       
   597             aEntry.SetAlwaysShown( oldEntry->AlwaysShown() );
       
   598             aEntry.SetSystemApp( oldEntry->SystemApp() );
       
   599             return ETrue;
       
   600             }
       
   601         }
       
   602     return EFalse;
       
   603     }
       
   604     
       
   605 // --------------------------------------------------------------------------
       
   606 // CTsFswEngine::CheckWidgetsL
       
   607 // --------------------------------------------------------------------------
       
   608 //
       
   609 void CTsFswEngine::CheckWidgetsL( RTsFswArray& aNewList )
       
   610     {
       
   611     if( iWidgetsSupported )
       
   612         {
       
   613         iWidgetList->InitializeWidgetListL();
       
   614         const RWidgetInfoArray& arr( iWidgetList->RunningWidgets() );
       
   615         for ( TInt i = 0, ie = arr.Count(); i != ie; ++i )
       
   616             {
       
   617             //verify if widget is working in full screen mode
       
   618             if( arr[i]->iFileSize )
       
   619                 {
       
   620                 // wgid will be a special negative value
       
   621                 // windowgroupname is not needed here so pass NULL
       
   622                 AddEntryL( -(i+1), arr[i]->iUid, 0, aNewList, ETrue );
       
   623                 }
       
   624             }
       
   625         }
       
   626     }
       
   627 
       
   628 // --------------------------------------------------------------------------
       
   629 // CTsFswEngine::HiddenAppListUpdated
   359 // CTsFswEngine::HiddenAppListUpdated
   630 // Callback from the hidden app list watcher
   360 // Callback from the hidden app list watcher
   631 // --------------------------------------------------------------------------
   361 // --------------------------------------------------------------------------
   632 //
   362 //
   633 void CTsFswEngine::HiddenAppListUpdated()
   363 void CTsFswEngine::HiddenAppListUpdated()
   644     CApaWindowGroupName* windowName =
   374     CApaWindowGroupName* windowName =
   645         CApaWindowGroupName::NewLC( iWsSession, aWgId );
   375         CApaWindowGroupName::NewLC( iWsSession, aWgId );
   646     TUid appUid = windowName->AppUid();
   376     TUid appUid = windowName->AppUid();
   647     CleanupStack::PopAndDestroy( windowName );
   377     CleanupStack::PopAndDestroy( windowName );
   648     return appUid;
   378     return appUid;
   649     }
   379 
   650 
       
   651 // --------------------------------------------------------------------------
       
   652 // CTsFswEngine::FindParentWgId
       
   653 // --------------------------------------------------------------------------
       
   654 //
       
   655 TInt CTsFswEngine::FindParentWgId( TInt aWgId )
       
   656     {
       
   657     TInt parent( KErrNotFound );
       
   658     RArray<RWsSession::TWindowGroupChainInfo> allWgIds;
       
   659     // Ask for window group list from RWsSession
       
   660     TInt error = iWsSession.WindowGroupList( 0, &allWgIds );
       
   661     if ( !error )
       
   662         {
       
   663         TInt count( allWgIds.Count() );
       
   664         for ( TInt i( 0 ); i < count; i++ )
       
   665             {
       
   666             RWsSession::TWindowGroupChainInfo info = allWgIds[i];
       
   667             if ( info.iId == aWgId && info.iParentId > 0)
       
   668                 {
       
   669                 parent = info.iParentId;
       
   670                 break;
       
   671                 }
       
   672             }
       
   673         }
       
   674     allWgIds.Close();
       
   675     return parent;
       
   676     }
       
   677 
       
   678 // --------------------------------------------------------------------------
       
   679 // CTsFswEngine::FindMostTopParentWgId
       
   680 // --------------------------------------------------------------------------
       
   681 //
       
   682 TInt CTsFswEngine::FindMostTopParentWgId( TInt aWgId )
       
   683     {
       
   684     TInt parent( KErrNotFound );
       
   685     parent = FindParentWgId( aWgId );
       
   686     if( parent != KErrNotFound)
       
   687         {
       
   688         TInt topParent = FindMostTopParentWgId(parent);
       
   689         if( topParent != KErrNotFound )
       
   690             {
       
   691             parent = topParent;
       
   692             }
       
   693         }
       
   694     return parent;
       
   695     }
   380     }
   696 
   381 
   697 // --------------------------------------------------------------------------
   382 // --------------------------------------------------------------------------
   698 // CTsFswEngine::FindAppNameLC
   383 // CTsFswEngine::FindAppNameLC
   699 // --------------------------------------------------------------------------
   384 // --------------------------------------------------------------------------
   747 // CTsFswEngine::CopyBitmapL
   432 // CTsFswEngine::CopyBitmapL
   748 // --------------------------------------------------------------------------
   433 // --------------------------------------------------------------------------
   749 //
   434 //
   750 CFbsBitmap* CTsFswEngine::CopyBitmapL( TInt aFbsHandle, TBool aKeepAspectRatio )
   435 CFbsBitmap* CTsFswEngine::CopyBitmapL( TInt aFbsHandle, TBool aKeepAspectRatio )
   751     {
   436     {
       
   437     TSLOG_CONTEXT( CopyBitmapL, TSLOG_LOCAL );
       
   438     
   752     CFbsBitmap* ret = new (ELeave) CFbsBitmap;
   439     CFbsBitmap* ret = new (ELeave) CFbsBitmap;
   753     CleanupStack::PushL( ret );
   440     CleanupStack::PushL( ret );
   754     CFbsBitmap* bmp = new (ELeave) CFbsBitmap;
   441     CFbsBitmap* bmp = new (ELeave) CFbsBitmap;
   755     CleanupStack::PushL( bmp );
   442     CleanupStack::PushL( bmp );
   756     User::LeaveIfError( bmp->Duplicate( aFbsHandle ) );
   443     User::LeaveIfError( bmp->Duplicate( aFbsHandle ) );
   786     CleanupStack::PopAndDestroy( doubleBufferGc );
   473     CleanupStack::PopAndDestroy( doubleBufferGc );
   787     CleanupStack::PopAndDestroy( doubleBufferDev );
   474     CleanupStack::PopAndDestroy( doubleBufferDev );
   788     CleanupStack::PopAndDestroy( bmp );
   475     CleanupStack::PopAndDestroy( bmp );
   789     CleanupStack::Pop( ret );
   476     CleanupStack::Pop( ret );
   790 
   477 
       
   478     TSLOG_OUT();
   791     return ret;
   479     return ret;
   792     }
   480     }
   793 
   481 
   794 // --------------------------------------------------------------------------
   482 // --------------------------------------------------------------------------
   795 // CTsFswEngine::UpdatePreviewContent
   483 // CTsFswEngine::UpdatePreviewContent
   854 void CTsFswEngine::HandleFswPpApplicationChange( TInt aWgId, TInt aFbsHandle )
   542 void CTsFswEngine::HandleFswPpApplicationChange( TInt aWgId, TInt aFbsHandle )
   855     {
   543     {
   856     TSLOG_CONTEXT( HandleFswPpApplicationChange, TSLOG_LOCAL );
   544     TSLOG_CONTEXT( HandleFswPpApplicationChange, TSLOG_LOCAL );
   857     TSLOG2_IN( "aWgId = %d aFbsHandle = %d", aWgId, aFbsHandle );
   545     TSLOG2_IN( "aWgId = %d aFbsHandle = %d", aWgId, aFbsHandle );
   858 
   546 
       
   547     TUid appUid;
       
   548     TRAPD( err, appUid = AppUidForWgIdL( aWgId ) );
       
   549     if ( err || appUid == KTsCameraUid )
       
   550         {
       
   551         // Dont't assign screenshot to camera app
       
   552         TSLOG0( TSLOG_LOCAL, "Screenshot for camera - ignore" );
       
   553         iPreviewProvider->AckPreview(aFbsHandle);
       
   554         TSLOG_OUT();
       
   555         return;
       
   556         }
       
   557     
   859     CFbsBitmap* bmp = 0;
   558     CFbsBitmap* bmp = 0;
   860     TRAPD( err, bmp = CopyBitmapL( aFbsHandle, EFalse ) );
   559     TRAP( err, bmp = CopyBitmapL( aFbsHandle, EFalse ) );
   861     iPreviewProvider->AckPreview(aFbsHandle);
   560     iPreviewProvider->AckPreview(aFbsHandle);
   862     if ( err == KErrNone )
   561     if ( err == KErrNone )
   863         {
   562         {
   864         CFbsBitmap** oldbmp = iScreenshots.Find( aWgId );
   563         StoreScreenshot(aWgId, bmp);
   865         if ( oldbmp )
   564 		iDataList->MoveEntryAtStart(appUid.iUid, EFalse);
   866             {
       
   867             delete *oldbmp;
       
   868             }
       
   869         if ( iScreenshots.Insert( aWgId, bmp ) != KErrNone )
       
   870             {
       
   871             delete bmp;
       
   872             iScreenshots.Remove( aWgId );
       
   873             }
       
   874         else
       
   875             {
       
   876             AssignScreenshotHandle( aWgId, bmp->Handle() );
       
   877             }
       
   878         }
   565         }
   879 
   566 
   880     TSLOG_OUT();
   567     TSLOG_OUT();
   881     }
   568     }
   882 
   569 
   888 void CTsFswEngine::HandleFswPpApplicationUnregistered( TInt aWgId )
   575 void CTsFswEngine::HandleFswPpApplicationUnregistered( TInt aWgId )
   889     {
   576     {
   890     TSLOG_CONTEXT( HandleFswPpApplicationUnregistered, TSLOG_LOCAL );
   577     TSLOG_CONTEXT( HandleFswPpApplicationUnregistered, TSLOG_LOCAL );
   891     TSLOG1_IN( "aWgId = %d", aWgId );
   578     TSLOG1_IN( "aWgId = %d", aWgId );
   892 
   579 
   893     CFbsBitmap** bmp = iScreenshots.Find( aWgId );
   580     RemoveScreenshot(aWgId);
   894     if ( bmp )
   581     
   895         {
       
   896         delete *bmp;
       
   897         iScreenshots.Remove( aWgId );
       
   898         AssignScreenshotHandle( aWgId, 0 );
       
   899         }
       
   900 
       
   901     TSLOG_OUT();
   582     TSLOG_OUT();
   902     }
   583     }
   903 
   584 
   904 // --------------------------------------------------------------------------
   585 // --------------------------------------------------------------------------
   905 // CTsFswEngine::HandleFswPpApplicationBitmapRotation
   586 // CTsFswEngine::HandleFswPpApplicationBitmapRotation
   909 void CTsFswEngine::HandleFswPpApplicationBitmapRotation( TInt aWgId, TBool aClockwise )
   590 void CTsFswEngine::HandleFswPpApplicationBitmapRotation( TInt aWgId, TBool aClockwise )
   910     {
   591     {
   911     TSLOG_CONTEXT( HandleFswPpApplicationBitmapRotation, TSLOG_LOCAL );
   592     TSLOG_CONTEXT( HandleFswPpApplicationBitmapRotation, TSLOG_LOCAL );
   912     TSLOG1_IN( "aWgId = %d", aWgId );
   593     TSLOG1_IN( "aWgId = %d", aWgId );
   913     
   594     
   914     CFbsBitmap** bmp = iScreenshots.Find( aWgId );
   595     CFbsBitmap** bmp = iDataList->FindScreenshot(aWgId);
       
   596             
   915     if ( bmp )
   597     if ( bmp )
   916         {
   598         {
   917         // Rotate bitmap
   599         // Rotate bitmap
   918         TRAP_IGNORE( RotateL( **bmp, aWgId, aClockwise ) );
   600         TRAP_IGNORE( RotateL( **bmp, aWgId, aClockwise ) );
   919         // Bitmap in a array is invalid, remove it
   601         // Bitmap in a array is invalid, remove it
   920         delete *bmp;
   602         RemoveScreenshot(aWgId);
   921         iScreenshots.Remove( aWgId );
       
   922         AssignScreenshotHandle( aWgId, 0 );
       
   923         }
   603         }
   924     
   604     
   925     TSLOG_OUT();
   605     TSLOG_OUT();
   926     }
   606     }
   927 
   607 
   966         iRotaTasks.Remove(idx);
   646         iRotaTasks.Remove(idx);
   967         }
   647         }
   968     
   648     
   969     if ( aError == KErrNone )
   649     if ( aError == KErrNone )
   970         {
   650         {
   971         if ( iScreenshots.Insert( aWgId, aBitmap ) != KErrNone )
   651         StoreScreenshot(aWgId, aBitmap);
   972             {
       
   973             delete aBitmap;
       
   974             iScreenshots.Remove( aWgId );
       
   975             AssignScreenshotHandle( aWgId, 0 );
       
   976             }
       
   977         else
       
   978             {
       
   979             AssignScreenshotHandle( aWgId, aBitmap->Handle() );
       
   980             }
       
   981         }
   652         }
   982     else
   653     else
   983         {
   654         {
   984         // Rotation failed, cleanup bitmap
   655         // Rotation failed, cleanup bitmap
   985         delete aBitmap;
   656         delete aBitmap;
   986         }
   657         }
   987     
   658     
   988     TSLOG_OUT();
   659     TSLOG_OUT();
   989     }
       
   990 
       
   991 
       
   992 // --------------------------------------------------------------------------
       
   993 // CTsFswEngine::AssignScreenshotHandle
       
   994 // Called when a screenshot arrives to check if there is a corresponding
       
   995 // application in the task list. Firstly try to match screenshot into parental
       
   996 // application then into standalone one.
       
   997 // --------------------------------------------------------------------------
       
   998 //
       
   999 void CTsFswEngine::AssignScreenshotHandle( TInt aWgIdForScreenshot,
       
  1000         TInt aBitmapHandle )
       
  1001     {
       
  1002     TBool changed = EFalse;
       
  1003     TInt parentWgId = FindMostTopParentWgId( aWgIdForScreenshot );
       
  1004     // now parentWgId is a valid wgid or KErrNotFound (-1)
       
  1005     if (parentWgId != KErrNotFound)
       
  1006 		{
       
  1007 		AssignScreenshotHandle( parentWgId, aBitmapHandle, changed );
       
  1008 		}
       
  1009     if (!changed)
       
  1010 		{
       
  1011 		AssignScreenshotHandle( aWgIdForScreenshot, aBitmapHandle, changed );
       
  1012 		}
       
  1013     if ( changed )
       
  1014         {
       
  1015         iObserver.FswDataChanged();
       
  1016         }
       
  1017     }
       
  1018 
       
  1019 // --------------------------------------------------------------------------
       
  1020 // CTsFswEngine::AssignScreenshotHandle
       
  1021 // Called when a screenshot arrives to check if there is a corresponding
       
  1022 // application in the task list. It might be tried to be match into parental 
       
  1023 // or standalone application.
       
  1024 // --------------------------------------------------------------------------
       
  1025 //
       
  1026 void CTsFswEngine::AssignScreenshotHandle(TInt aWgIdForScreenshot,
       
  1027 		TInt aBitmapHandle, TBool& aAsigned)
       
  1028 	{
       
  1029 	aAsigned = EFalse;
       
  1030 	for (TInt i = 0, ie = iData.Count(); i != ie; ++i)
       
  1031 		{
       
  1032 		if (iData[i]->Widget())
       
  1033 			{
       
  1034 			// Do not do anything for now => no screenshot for widgets.
       
  1035 			continue;
       
  1036 			}
       
  1037 		TInt appWgId = iData[i]->WgId();
       
  1038 		if (appWgId == aWgIdForScreenshot)
       
  1039 			{
       
  1040 			iData[i]->SetScreenshotHandle(aBitmapHandle);
       
  1041 			aAsigned = ETrue;
       
  1042 			break;
       
  1043 			}
       
  1044 		}
       
  1045 	}
       
  1046 
       
  1047 // --------------------------------------------------------------------------
       
  1048 // CTsFswEngine::LookupScreenshotHandle
       
  1049 // Called to check if there is a screenshot already stored for the given
       
  1050 // app. (or a screenshot with a wgid for which aWgIdForApp is the parent)
       
  1051 // --------------------------------------------------------------------------
       
  1052 //
       
  1053 TInt CTsFswEngine::LookupScreenshotHandle( TInt aWgIdForApp )
       
  1054     {
       
  1055     CFbsBitmap** bmp = iScreenshots.Find( aWgIdForApp );
       
  1056     if ( bmp )
       
  1057         {
       
  1058         // there is a screenshot stored for this wgid
       
  1059         return (*bmp)->Handle();
       
  1060         }
       
  1061     else if ( aWgIdForApp > 0 )
       
  1062         {
       
  1063         // must check if there is a screenshot for which aWgIdForApp is the parent
       
  1064         THashMapIter<TInt, CFbsBitmap*> iter( iScreenshots );
       
  1065         while ( const TInt* wgid = iter.NextKey() )
       
  1066             {
       
  1067             if ( FindParentWgId( *wgid ) == aWgIdForApp )
       
  1068                 {
       
  1069                 CFbsBitmap** bmp = iter.CurrentValue();
       
  1070                 return (*bmp)->Handle();
       
  1071                 }
       
  1072             }
       
  1073         }
       
  1074     else if ( aWgIdForApp < 0 )
       
  1075         {
       
  1076         // Must be a widget, wgid is useless in this case.
       
  1077         // Do not do anything for now => no screenshot for widgets.
       
  1078         }
       
  1079     return 0;
       
  1080     }
   660     }
  1081 
   661 
  1082 // --------------------------------------------------------------------------
   662 // --------------------------------------------------------------------------
  1083 // CTsFswEngine::RunL
   663 // CTsFswEngine::RunL
  1084 // --------------------------------------------------------------------------
   664 // --------------------------------------------------------------------------
  1093             TInt operationStatus( value & Swi::KSwisOperationStatusMask );
   673             TInt operationStatus( value & Swi::KSwisOperationStatusMask );
  1094             // When an (un)installation has finished change the flag to
   674             // When an (un)installation has finished change the flag to
  1095             // refresh the app list during the next task list update.
   675             // refresh the app list during the next task list update.
  1096             if ( operationStatus == Swi::ESwisStatusSuccess )
   676             if ( operationStatus == Swi::ESwisStatusSuccess )
  1097                 {
   677                 {
  1098                 iAppDataRefreshNeeded = ETrue;
   678                 iDataList->SetAppDataRefreshNeeded();
  1099                 }
   679                 }
  1100             }
   680             }
  1101         iSwiProp.Subscribe( iStatus );
   681         iSwiProp.Subscribe( iStatus );
  1102         SetActive();
   682         SetActive();
  1103         }
   683         }
  1158 //
   738 //
  1159 void CTsFswEngine::CloseWidgetL(TInt aOffset )
   739 void CTsFswEngine::CloseWidgetL(TInt aOffset )
  1160     {
   740     {
  1161     TSLOG_CONTEXT( CloseWidgetL, TSLOG_LOCAL );
   741     TSLOG_CONTEXT( CloseWidgetL, TSLOG_LOCAL );
  1162     TSLOG1_IN( "aOffset = %d", aOffset );
   742     TSLOG1_IN( "aOffset = %d", aOffset );
  1163     if( iWidgetList->RunningWidgets().Count() <= aOffset )
   743     if( iDataList->Widgets()->RunningWidgets().Count() <= aOffset )
  1164         {
   744         {
  1165         User::Leave(KErrArgument);
   745         User::Leave(KErrArgument);
  1166         }
   746         }
  1167     const CWidgetInfo* widgetInfo(iWidgetList->RunningWidgets()[aOffset]);
   747     const CWidgetInfo* widgetInfo(iDataList->Widgets()->RunningWidgets()[aOffset]);
  1168     const TPtrC bundleName(*widgetInfo->iBundleName);
   748     const TPtrC bundleName(*widgetInfo->iBundleName);
  1169     RApaLsSession ls;
       
  1170     User::LeaveIfError( ls.Connect() );
       
  1171     CleanupClosePushL( ls );
       
  1172     CApaCommandLine* const cmdLine = CApaCommandLine::NewLC();
   749     CApaCommandLine* const cmdLine = CApaCommandLine::NewLC();
  1173     
   750     
  1174     HBufC8* const
   751     HBufC8* const
  1175         opaque( HBufC8::NewLC( bundleName.Size() + 3 * sizeof( TUint32 ) ) );
   752         opaque( HBufC8::NewLC( bundleName.Size() + 3 * sizeof( TUint32 ) ) );
  1176     TPtr8 des ( opaque->Des() );
   753     TPtr8 des ( opaque->Des() );
  1183     stream.WriteInt32L ( KCloseWidgetCmd );
   760     stream.WriteInt32L ( KCloseWidgetCmd );
  1184     CleanupStack::PopAndDestroy( &stream );
   761     CleanupStack::PopAndDestroy( &stream );
  1185     cmdLine->SetCommandL( EApaCommandBackgroundAndWithoutViews );
   762     cmdLine->SetCommandL( EApaCommandBackgroundAndWithoutViews );
  1186     cmdLine->SetOpaqueDataL( *opaque );
   763     cmdLine->SetOpaqueDataL( *opaque );
  1187     CleanupStack::PopAndDestroy( opaque );
   764     CleanupStack::PopAndDestroy( opaque );
  1188     cmdLine->SetExecutableNameL( KWidgetAppName );
   765     
  1189     ls.StartApp( *cmdLine );
   766     if (iDataList->Widgets()->IsCWRTWidget(widgetInfo->iUid))
       
   767     	{
       
   768         cmdLine->SetExecutableNameL( KWidgetAppNameWgt);
       
   769     	}
       
   770     else
       
   771     	{
       
   772         cmdLine->SetExecutableNameL( KWidgetAppName );
       
   773     	}
       
   774     
       
   775     iAppArcSession.StartApp( *cmdLine );
  1190     CleanupStack::PopAndDestroy( cmdLine );
   776     CleanupStack::PopAndDestroy( cmdLine );
  1191     CleanupStack::PopAndDestroy( &ls );
   777     TSLOG_OUT();
  1192     TSLOG_OUT();
   778     }
  1193     }
   779 
  1194 
   780 // --------------------------------------------------------------------------
  1195 
   781 // CTsFswEngine::StoreScreenshot
       
   782 // --------------------------------------------------------------------------
       
   783 //
       
   784 TBool CTsFswEngine::StoreScreenshot(TInt aWgId, CFbsBitmap* aBmp)
       
   785     {
       
   786     TSLOG_CONTEXT( StoreScreenshot, TSLOG_LOCAL );
       
   787     //iDataList would take ownership
       
   788     TBool change = EFalse;
       
   789     change = iDataList->StoreScreenshot(aWgId, aBmp);
       
   790     if(change)
       
   791         {
       
   792         iObserver.FswDataChanged();
       
   793         }
       
   794     TSLOG1_OUT( "Screenshot for  = %d", aWgId );
       
   795     return change;
       
   796     }
       
   797 
       
   798 // --------------------------------------------------------------------------
       
   799 // CTsFswEngine::RemoveScreenshot()
       
   800 // --------------------------------------------------------------------------
       
   801 //
       
   802 void CTsFswEngine::RemoveScreenshot(TInt aWgId)
       
   803     {
       
   804     TBool change = EFalse;
       
   805     change = iDataList->RemoveScreenshot(aWgId);
       
   806     if( change )
       
   807         {
       
   808         iObserver.FswDataChanged();
       
   809         }
       
   810     }
       
   811 
       
   812 // --------------------------------------------------------------------------
       
   813 // CTsFswEngine::HandleWidgetUpdateL()
       
   814 // --------------------------------------------------------------------------
       
   815 //
       
   816 void CTsFswEngine::HandleWidgetUpdateL(TInt aWidgetId, TInt aBitmapHandle)
       
   817     {
       
   818 	TSLOG_CONTEXT( HandleWidgetUpdateL, TSLOG_LOCAL );
       
   819     CFbsBitmap* bmp = 0;
       
   820     TBool contentChanged(EFalse); 
       
   821     if( aBitmapHandle )
       
   822     	{
       
   823 		TRAPD( err, bmp = CopyBitmapL( aBitmapHandle, EFalse ) );
       
   824 		if ( err == KErrNone )
       
   825 			{
       
   826             contentChanged = StoreScreenshot(aWidgetId, bmp);
       
   827 			}
       
   828 		}
       
   829 	if(!contentChanged)
       
   830 		{
       
   831 		iObserver.FswDataChanged();
       
   832 		}
       
   833  
       
   834     iDataList->MoveEntryAtStart(aWidgetId, ETrue);
       
   835     TSLOG_OUT();
       
   836     }
  1196 
   837 
  1197 // --------------------------------------------------------------------------
   838 // --------------------------------------------------------------------------
  1198 // CTsRotationListener::CTsRotationListener
   839 // CTsRotationListener::CTsRotationListener
  1199 // --------------------------------------------------------------------------
   840 // --------------------------------------------------------------------------
  1200 //
   841 //