homesync/contentmanager/cmserver/cmfillmanager/src/cmfmupnpmngr.cpp
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  AV Controller UPnP actions handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "upnpavdevice.h"
       
    20 #include "upnpxmlparser.h"
       
    21 #include "upnpavcontroller.h"
       
    22 #include "upnpavbrowsingsession.h"
       
    23 #include "upnpconstantdefs.h"
       
    24 #include "upnpitem.h"
       
    25 #include <w32std.h>
       
    26 
       
    27 #include "upnpitemutility.h"
       
    28 #include "cmfilllistitem.h"
       
    29 #include "cmfmupnpactionobserver.h"
       
    30 #include "cmfmupnpmngr.h"
       
    31 #include "msdebug.h"
       
    32 
       
    33 _LIT8( KCmBrowseFilter,    "*" ); // No filter
       
    34 _LIT8( KCmSortCriteria,    "" ); // No sorting
       
    35 const TInt KStartIndex = 0; // Start from beginning
       
    36 const TInt KRequestedCount = 1; // Only one item browsed at a time
       
    37 const TInt KScreenWidth = 128;
       
    38 const TInt KScreenHeight = 128;
       
    39 _LIT8( KCmFmXMark, "x" );
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // CCmFmUpnpMngr::NewL
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 CCmFmUpnpMngr* CCmFmUpnpMngr::NewL( MCmFmUPnPActionObserver* aObserver )
       
    46     {
       
    47     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::NewL() start"));    
       
    48     CCmFmUpnpMngr* self = CCmFmUpnpMngr::NewLC( aObserver );
       
    49     CleanupStack::Pop( self );
       
    50     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::NewL() end"));
       
    51     return self;
       
    52     }
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // CCmFmUpnpMngr::NewLC
       
    56 // ---------------------------------------------------------------------------
       
    57 //   
       
    58 CCmFmUpnpMngr* CCmFmUpnpMngr::NewLC( MCmFmUPnPActionObserver* aObserver )
       
    59     {
       
    60     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::NewLC() start"));    
       
    61     CCmFmUpnpMngr* self = new ( ELeave ) CCmFmUpnpMngr( aObserver );
       
    62     CleanupStack::PushL( self );
       
    63     self->ConstructL();
       
    64     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::NewLC() end"));
       
    65     return self;  
       
    66     }    
       
    67 
       
    68 // ---------------------------------------------------------------------------
       
    69 // CCmFmUpnpMngr::~CCmFmUpnpMngr
       
    70 // ---------------------------------------------------------------------------
       
    71 //
       
    72 CCmFmUpnpMngr::~CCmFmUpnpMngr()
       
    73     {
       
    74     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::~CCmFmUpnpMngr()"));
       
    75     
       
    76     CancelOperation();
       
    77 
       
    78     delete iURI;
       
    79     delete iParser;
       
    80     delete iItem;
       
    81     }
       
    82 
       
    83 // ---------------------------------------------------------------------------
       
    84 // CCmFmUpnpMngr::CCmFmUpnpMngr
       
    85 // ---------------------------------------------------------------------------
       
    86 //        
       
    87 CCmFmUpnpMngr::CCmFmUpnpMngr( MCmFmUPnPActionObserver* aObserver )
       
    88     : iObserver( aObserver ), iScreenSize( KScreenWidth, KScreenHeight )
       
    89     {
       
    90     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::CCmFmUpnpMngr()"));
       
    91     }
       
    92 
       
    93 // ---------------------------------------------------------------------------
       
    94 // CCmFmUpnpMngr::ConstructL
       
    95 // ---------------------------------------------------------------------------
       
    96 // 
       
    97 void CCmFmUpnpMngr::ConstructL()
       
    98     {
       
    99     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::ConstructL()"));
       
   100     
       
   101     iParser = CUPnPXMLParser::NewL();
       
   102     ScreenSizeL();
       
   103     TRACE(Print(_L("[FILL MNGR]\t Phones screen size = %d x %d"), 
       
   104         iScreenSize.iWidth, iScreenSize.iHeight ));
       
   105     }    
       
   106 
       
   107 // ---------------------------------------------------------------------------
       
   108 // CCmFmUpnpMngr::SetAvController
       
   109 // ---------------------------------------------------------------------------
       
   110 // 
       
   111 void CCmFmUpnpMngr::SetAvController( MUPnPAVController* aAVController )
       
   112     {
       
   113     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::SetAvController()"));
       
   114     
       
   115     if( aAVController )
       
   116         {
       
   117         aAVController->SetDeviceObserver( *this );
       
   118         }    
       
   119     iAVController = aAVController;
       
   120     iBrowseSession = NULL;
       
   121     delete iURI;
       
   122     iURI = NULL;
       
   123     delete iItem;
       
   124     iItem = NULL;       
       
   125     }
       
   126 
       
   127 // ---------------------------------------------------------------------------
       
   128 // CCmFmUpnpMngr::GetMediaServersL
       
   129 // ---------------------------------------------------------------------------
       
   130 //     
       
   131 void CCmFmUpnpMngr::GetMediaServersL( CUpnpAVDeviceList*& aDevices )
       
   132     {
       
   133     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::GetMediaServersL()"));
       
   134     
       
   135     if( iAVController )
       
   136         {
       
   137         aDevices = iAVController->GetMediaServersL();
       
   138         }
       
   139     }
       
   140 
       
   141 // ---------------------------------------------------------------------------
       
   142 // CCmFmUpnpMngr::CheckURIL
       
   143 // ---------------------------------------------------------------------------
       
   144 //     
       
   145 void CCmFmUpnpMngr::CheckURIL( CUpnpAVDevice* aDevice,
       
   146                                CCmFillListItem& aItem )
       
   147     {
       
   148     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::CheckURIL()"));
       
   149     if( iAVController )
       
   150         {
       
   151         iSelectOptimalImageSize = EFalse;
       
   152         if( aItem.Status() == ECmToBeShrinked )
       
   153             {
       
   154             iSelectOptimalImageSize = ETrue;
       
   155             }
       
   156 			
       
   157 	    if( !iBrowseSession )
       
   158 			{
       
   159             // session not found -> create
       
   160             iBrowseSession =
       
   161                 &iAVController->StartBrowsingSessionL( *aDevice );
       
   162             iBrowseSession->SetObserver( *this );   
       
   163 			iDevice = aDevice;
       
   164 			}	
       
   165         else if( ( aDevice != iDevice ) ||
       
   166 	        ( aDevice->Uuid() != iDevice->Uuid() ) )
       
   167 			{
       
   168             // device is different than previosly or pointer to it
       
   169             // has been changed -> create new session
       
   170 			CancelOperation();           
       
   171 			iBrowseSession =
       
   172 				&iAVController->StartBrowsingSessionL( *aDevice );
       
   173 			iBrowseSession->SetObserver( *this );  
       
   174 			iDevice = aDevice;    
       
   175 			}
       
   176 		
       
   177         iBrowseSession->BrowseL( aItem.ItemId(), KCmBrowseFilter, 
       
   178             MUPnPAVBrowsingSession::EMetadata, KStartIndex, 
       
   179             KRequestedCount, KCmSortCriteria );
       
   180         iBrowseStarted.HomeTime();
       
   181         TRACE(Print(_L("[FILL MNGR]\t BROWSE STARTED")));
       
   182 #ifdef _DEBUG
       
   183         TBuf<KMaxName> temp;
       
   184         if( aDevice->Uuid().Length() < KMaxName )
       
   185             {
       
   186             temp.Copy( aDevice->Uuid() );
       
   187             TRACE(Print(_L("[FILL MNGR]\t TARGET DEVICE %S"), &temp ));
       
   188             }
       
   189         temp.Zero();
       
   190         if( aItem.ItemId().Length() < KMaxName )
       
   191             {
       
   192             temp.Copy( aItem.ItemId() );
       
   193             TRACE(Print(_L("[FILL MNGR]\t TARGET ITEM %S"), &temp ));        
       
   194             }
       
   195         temp.Zero();       
       
   196 #endif         
       
   197         }
       
   198     else
       
   199         {
       
   200         TRACE(Print(_L("[FILL MNGR]\t iAVController == NULL"))); 
       
   201         iObserver->URICheckResult( ENoUriAvailable );
       
   202         }        
       
   203     }
       
   204 
       
   205 // ---------------------------------------------------------------------------
       
   206 // CCmFmUpnpMngr::CancelOperation
       
   207 // ---------------------------------------------------------------------------
       
   208 //     
       
   209 void CCmFmUpnpMngr::CancelOperation()
       
   210     {
       
   211     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::CancelOperation()"));
       
   212     
       
   213     if( iBrowseSession )
       
   214         {
       
   215         iAVController->StopBrowsingSession( *iBrowseSession );
       
   216 		iBrowseSession = NULL;
       
   217         }        
       
   218     }
       
   219 
       
   220 // ---------------------------------------------------------------------------
       
   221 // CCmFmUpnpMngr::Uri
       
   222 // ---------------------------------------------------------------------------
       
   223 // 
       
   224 TDesC8& CCmFmUpnpMngr::Uri() const
       
   225     {
       
   226     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::Uri()"));
       
   227     
       
   228     return *iURI;
       
   229     }
       
   230 
       
   231 // ---------------------------------------------------------------------------
       
   232 // CCmFmUpnpMngr::UpnpItem
       
   233 // ---------------------------------------------------------------------------
       
   234 // 
       
   235 CUpnpItem& CCmFmUpnpMngr::UpnpItem() const
       
   236     {
       
   237     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::UpnpItem()"));
       
   238     
       
   239     return *iItem;
       
   240     }
       
   241     
       
   242 // ---------------------------------------------------------------------------
       
   243 // CCmFmUpnpMngr::BrowseResponse
       
   244 // ---------------------------------------------------------------------------
       
   245 // 
       
   246 void CCmFmUpnpMngr::BrowseResponse(
       
   247                     const TDesC8& aBrowseResponse,
       
   248                     TInt aError,
       
   249                     TInt /*aMatches*/,
       
   250                     TInt aTotalCount,
       
   251                     const TDesC8& /*aUpdateId*/
       
   252                     )
       
   253     {
       
   254     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::BrowseResponse()"));   
       
   255     
       
   256     TRACE(Print(_L("[FILL MNGR]\t ParseResultDataL error = %d"), aError ));
       
   257     
       
   258     TRAPD( err, BrowseResponseL( aError, aTotalCount, aBrowseResponse ) );
       
   259     if ( err )
       
   260         {
       
   261         TRACE(Print(_L("[FILL MNGR]\t BrowseResponseL err = %d"), err ));
       
   262         }    
       
   263     }
       
   264                     
       
   265 // ---------------------------------------------------------------------------
       
   266 // CCmFmUpnpMngr::BrowseResponseL
       
   267 // ---------------------------------------------------------------------------
       
   268 //    
       
   269 void CCmFmUpnpMngr::BrowseResponseL( TInt aStatus,
       
   270                                      TInt /*aTotalCount*/,
       
   271                                      const TDesC8& aResultArray )
       
   272     {
       
   273     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::BrowseResponseL()"));
       
   274 
       
   275     RPointerArray<CUpnpObject> tempArray;
       
   276     CleanupClosePushL( tempArray );
       
   277     TInt err( aStatus );
       
   278     TRACE(Print(_L("[FILL MNGR]\t BrowseResponse err = %d"), err )); 
       
   279     if( !err )
       
   280         {
       
   281         TRAP( err, iParser->ParseResultDataL(
       
   282             tempArray, aResultArray ) );        
       
   283         }
       
   284                    
       
   285     /** Browse finished */
       
   286     iBrowseFinished.HomeTime();
       
   287     TTimeIntervalMicroSeconds usecsFrom = 
       
   288         iBrowseFinished.MicroSecondsFrom( iBrowseStarted );
       
   289     TRACE(Print(_L("[FILL MNGR]\t Browse took = %ld microseconds"), 
       
   290         usecsFrom.Int64() ));
       
   291     
       
   292     if( !err )
       
   293         {
       
   294     	if ( tempArray.Count() )
       
   295     		{
       
   296     		if( iItem )
       
   297     		    {
       
   298     		    delete iItem;
       
   299     		    iItem = NULL;
       
   300     		    }
       
   301     		iItem = CUpnpItem::NewL();
       
   302     		// first object is an item, safe to downcast
       
   303     		CUpnpItem* item = static_cast<CUpnpItem*>( tempArray[0] );
       
   304     		iItem->CopyL( *tempArray[0] );
       
   305 
       
   306     		const CUpnpElement& res = UPnPItemUtility::ResourceFromItemL( *item );      		
       
   307     		if( iSelectOptimalImageSize )
       
   308     		    {
       
   309     		    RUPnPElementsArray array;
       
   310     		    UPnPItemUtility::GetResElements( *tempArray[0], array );
       
   311     		    const CUpnpElement& res = ParseImageResolutions( array );  		    
       
   312     		    }
       
   313 
       
   314             if(iURI)
       
   315                 {
       
   316                 delete iURI;
       
   317                 iURI = NULL;            
       
   318                 }                  	        	
       
   319             iURI = res.Value().AllocL();
       
   320             iObserver->URICheckResult( EUriChecked, item, &res );
       
   321     		}
       
   322         else
       
   323             {
       
   324             LOG(_L("[FILL MNGR]\t tempArray.Count() = 0"));
       
   325             iObserver->URICheckResult( ENoUriAvailable );
       
   326             }        
       
   327         }
       
   328     else
       
   329         {
       
   330         LOG(_L("[FILL MNGR]\t err != 0"));
       
   331         iObserver->URICheckResult( ENoUriAvailable );
       
   332         }
       
   333 
       
   334     tempArray.ResetAndDestroy();
       
   335     CleanupStack::PopAndDestroy( &tempArray );            
       
   336     }
       
   337 
       
   338 // ---------------------------------------------------------------------------
       
   339 // CCmFmUpnpMngr::SearchResponse
       
   340 // ---------------------------------------------------------------------------
       
   341 //
       
   342 void CCmFmUpnpMngr::SearchResponse( 
       
   343                 const TDesC8& /*aSearchResponse*/,
       
   344                  TInt /*aError*/,
       
   345                  TInt /*aMatches*/,
       
   346                  TInt /*aTotalCount*/,
       
   347                  const TDesC8& /*aUpdateId*/
       
   348                  )
       
   349     {
       
   350     // None
       
   351     }
       
   352         
       
   353 // ---------------------------------------------------------------------------
       
   354 // CCmFmUpnpMngr::SearchResponse
       
   355 // ---------------------------------------------------------------------------
       
   356 //
       
   357 void CCmFmUpnpMngr::SearchResponse( 
       
   358                  TInt /*aStatus*/,
       
   359                  TInt /*aTotalCount*/,
       
   360                  const RPointerArray<CUpnpObject>& /*aResultArray*/ 
       
   361                  )
       
   362     {
       
   363     // None
       
   364     }
       
   365 
       
   366 // ---------------------------------------------------------------------------
       
   367 // CCmFmUpnpMngr::SearchCapabilitiesResponse
       
   368 // ---------------------------------------------------------------------------
       
   369 //
       
   370 void CCmFmUpnpMngr::SearchCapabilitiesResponse( 
       
   371                  TInt /*aStatus*/,
       
   372                  const TDesC8& /*aSearchCapabilities*/ 
       
   373                  )
       
   374     {
       
   375     // None
       
   376     }                 
       
   377 
       
   378 // ---------------------------------------------------------------------------
       
   379 // CCmFmUpnpMngr::CreateContainerResponse
       
   380 // ---------------------------------------------------------------------------
       
   381 //
       
   382 void CCmFmUpnpMngr::CreateContainerResponse( TInt /*aError*/, 
       
   383                                              const TDesC8& /*aObjectId*/ )
       
   384     {
       
   385     // None
       
   386     }
       
   387 
       
   388 // ---------------------------------------------------------------------------
       
   389 // CCmFmUpnpMngr::DeleteObjectResponse
       
   390 // ---------------------------------------------------------------------------
       
   391 //
       
   392 void CCmFmUpnpMngr::DeleteObjectResponse( TInt /*aStatus*/ )
       
   393     {
       
   394     // None
       
   395     }
       
   396 
       
   397 // ---------------------------------------------------------------------------
       
   398 // CCmFmUpnpMngr::MediaServerDisappeared
       
   399 // ---------------------------------------------------------------------------
       
   400 //
       
   401 void CCmFmUpnpMngr::MediaServerDisappeared(
       
   402     TUPnPDeviceDisconnectedReason /*aReason*/ )
       
   403     {
       
   404     // None
       
   405     }
       
   406 
       
   407 // ---------------------------------------------------------------------------
       
   408 // CCmFmUpnpMngr::ReserveLocalMSServicesCompleted
       
   409 // ---------------------------------------------------------------------------
       
   410 //
       
   411 void CCmFmUpnpMngr::ReserveLocalMSServicesCompleted( TInt /*aStatus*/ )
       
   412     {
       
   413     // None
       
   414     }
       
   415 
       
   416 // ---------------------------------------------------------------------------
       
   417 // CCmFmUpnpMngr::UPnPDeviceDiscovered
       
   418 // ---------------------------------------------------------------------------
       
   419 //
       
   420 void CCmFmUpnpMngr::UPnPDeviceDiscovered( const CUpnpAVDevice& /*aDevice*/ )
       
   421     {
       
   422     }
       
   423   
       
   424 // ---------------------------------------------------------------------------
       
   425 // CCmFmUpnpMngr::UPnPDeviceDisappeared
       
   426 // ---------------------------------------------------------------------------
       
   427 //    
       
   428 void CCmFmUpnpMngr::UPnPDeviceDisappeared( const CUpnpAVDevice& aDevice )
       
   429     {
       
   430     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::UPnPDeviceDisappeared"));
       
   431     if( iDevice )
       
   432         {
       
   433         if( KErrNotFound != iDevice->Uuid().Match( aDevice.Uuid() ) )
       
   434             {
       
   435             LOG(_L("[FILL MNGR]\t Used server disappeared!"));
       
   436             LOG(_L("[FILL MNGR]\t Canceling"));
       
   437             iObserver->URICheckResult( ECanceled );
       
   438             }        
       
   439         }
       
   440     }    
       
   441 
       
   442 // ---------------------------------------------------------------------------
       
   443 // CCmFmUpnpMngr::WLANConnectionLost
       
   444 // ---------------------------------------------------------------------------
       
   445 // 
       
   446 void CCmFmUpnpMngr::WLANConnectionLost()
       
   447     {
       
   448     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::WLANConnectionLost"));
       
   449     iObserver->URICheckResult( ECanceled );
       
   450     }
       
   451 
       
   452 // ---------------------------------------------------------------------------
       
   453 // CCmFmUpnpMngr::ParseImageResolutions
       
   454 // ---------------------------------------------------------------------------
       
   455 // 
       
   456 const CUpnpElement& CCmFmUpnpMngr::ParseImageResolutions( 
       
   457     RUPnPElementsArray& aResElementsArray )
       
   458     {
       
   459     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::ParseImageResolutions"));
       
   460     
       
   461     TInt elementIndex( KErrNone );
       
   462     TSize matchingSize( 0, 0 );
       
   463     for( TInt i = 0 ; i < aResElementsArray.Count(); i++ )
       
   464         {
       
   465         const CUpnpAttribute* attribute = 
       
   466             UPnPItemUtility::FindAttributeByName( *aResElementsArray[i], 
       
   467                 KAttributeResolution() ); 
       
   468         
       
   469         if( attribute )
       
   470             {
       
   471             TPtrC8 resolution( attribute->Value() );
       
   472             TInt index = resolution.Find( KCmFmXMark );
       
   473             if( index != KErrNotFound )
       
   474                 {
       
   475                 TLex8 lexH( resolution.Mid( index + 1 ) );
       
   476                 TInt height( KErrNone );
       
   477                 TInt err = lexH.Val( height ); 
       
   478                 TRACE(Print(_L("[FILL MNGR]\t Val( height ) = %d"), err ));
       
   479                 
       
   480                 TInt width( KErrNone );
       
   481                 TLex8 lexW( resolution.Mid( 0, index ) );
       
   482                 err = lexW.Val( width );
       
   483                 TRACE(Print(_L("[FILL MNGR]\t Val( width ) = %d"), err ));
       
   484                 
       
   485                 TRACE(Print(_L("[FILL MNGR]\t Sizes in landscape mode!!!")));
       
   486                 TRACE(Print(_L("[FILL MNGR]\t Image heigth = %d"), height ));
       
   487                 TRACE(Print(_L("[FILL MNGR]\t Image width = %d"), width ));
       
   488                 if( height >= iScreenSize.iWidth && width >= 
       
   489                     iScreenSize.iHeight )
       
   490                     {
       
   491                     if( matchingSize.iHeight == 0 )
       
   492                         {
       
   493                         matchingSize.iHeight = height;
       
   494                         matchingSize.iWidth = width;
       
   495                         elementIndex = i;
       
   496                         }
       
   497                     else
       
   498                         {
       
   499                         if( matchingSize.iHeight > height && 
       
   500                             matchingSize.iWidth > width )
       
   501                             {
       
   502                             matchingSize.iHeight = height;
       
   503                             matchingSize.iWidth = width;
       
   504                             elementIndex = i;
       
   505                             }
       
   506                         
       
   507                         }                
       
   508                     }                           
       
   509                 }            
       
   510             }
       
   511         else
       
   512             {
       
   513             LOG(_L("[FILL MNGR]\t attribute == NULL"));
       
   514             }            
       
   515         }
       
   516     TRACE(Print(_L("[FILL MNGR]\t Selected height = %d"), 
       
   517         matchingSize.iHeight ));
       
   518     TRACE(Print(_L("[FILL MNGR]\t Selected width = %d"), 
       
   519         matchingSize.iWidth ));
       
   520     TRACE(Print(_L("[FILL MNGR]\t Selected elementIndex = %d"), 
       
   521         elementIndex ));
       
   522     return *aResElementsArray[ elementIndex ];
       
   523     }
       
   524 
       
   525 // ---------------------------------------------------------------------------
       
   526 // CCmFmUpnpMngr::ScreenSizeL
       
   527 // ---------------------------------------------------------------------------
       
   528 //
       
   529 void CCmFmUpnpMngr::ScreenSizeL()
       
   530     {
       
   531     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::ScreenSizeL start"));   
       
   532     RWsSession session;
       
   533     TInt error = session.Connect() ;
       
   534     CleanupClosePushL( session );
       
   535     if ( !error )
       
   536         {
       
   537         CWsScreenDevice* screenDevice = 
       
   538             new ( ELeave ) CWsScreenDevice( session );
       
   539         if ( screenDevice && !screenDevice->Construct() )
       
   540             {
       
   541             iScreenSize = screenDevice->SizeInPixels();
       
   542             }
       
   543         delete screenDevice;
       
   544         screenDevice = NULL;
       
   545         }
       
   546     else
       
   547         {
       
   548         TRACE(Print(_L("[FILL MNGR]\t ScreenSizeL error = %d"), error ));        
       
   549         }    
       
   550 
       
   551     CleanupStack::PopAndDestroy( &session );
       
   552     LOG(_L("[FILL MNGR]\t CCmFmUpnpMngr::ScreenSizeL end"));
       
   553     }
       
   554     
       
   555 // End of file