contentpublishingsrv/contentharvester/contentharvesterswiplugin/src/chswiplugin.cpp
branchRCL_3
changeset 78 1b207dd38b72
parent 9 d0529222e3f0
equal deleted inserted replaced
74:edd621764147 78:1b207dd38b72
    20 #include <e32std.h>
    20 #include <e32std.h>
    21 
    21 
    22 #include <ecom/implementationproxy.h>
    22 #include <ecom/implementationproxy.h>
    23 #include <contentharvesterpluginuids.hrh>
    23 #include <contentharvesterpluginuids.hrh>
    24 #include <liwservicehandler.h>
    24 #include <liwservicehandler.h>
       
    25 #include <driveinfo.h>
    25 
    26 
    26 #include "cpglobals.h"
    27 #include "cpglobals.h"
    27 #include "chswiusbhandler.h"
    28 #include "chswiusbhandler.h"
    28 #include "chswiusbobserver.h"
    29 #include "chswiusbobserver.h"
    29 
    30 
    73     {
    74     {
    74     iNotifier = CApaAppListNotifier::NewL( this, CActive::EPriorityStandard );
    75     iNotifier = CApaAppListNotifier::NewL( this, CActive::EPriorityStandard );
    75     User::LeaveIfError( iApaLsSession.Connect() );
    76     User::LeaveIfError( iApaLsSession.Connect() );
    76     User::LeaveIfError( iFs.Connect() );
    77     User::LeaveIfError( iFs.Connect() );
    77     
    78     
       
    79     iMassMemoryAvailable = InternalMassMemoryAvailable();
    78     iUsbHandler = CCHSwiUsbHandler::NewL( this, iFs );
    80     iUsbHandler = CCHSwiUsbHandler::NewL( this, iFs );
    79     
    81     
    80     iUsbObserver = CCHSwiUsbObserver::NewL( iUsbHandler, iFs );
    82     iUsbObserver = CCHSwiUsbObserver::NewL( iUsbHandler, iFs );
    81     iUsbObserver->Start();
    83     iUsbObserver->Start();
    82     }
    84     }
   278 // Gets Mass Storage mode.
   280 // Gets Mass Storage mode.
   279 // ----------------------------------------------------------------------------
   281 // ----------------------------------------------------------------------------
   280 //
   282 //
   281 TBool CCHSwiPlugin::IsMassStorageMode()
   283 TBool CCHSwiPlugin::IsMassStorageMode()
   282 	{
   284 	{
   283 	return iMassStorageMode;
   285     if (iMassMemoryAvailable)
       
   286     	{
       
   287     	return iMassStorageMode;
       
   288     	}
       
   289     else
       
   290     	{
       
   291     	return EFalse;
       
   292     	}
   284 	}
   293 	}
   285 
   294 
       
   295 // ----------------------------------------------------------------------------
       
   296 //
       
   297 // ----------------------------------------------------------------------------
       
   298 //
       
   299 TBool CCHSwiPlugin::InternalMassMemoryAvailable( )
       
   300     {
       
   301     TBool result(EFalse);
       
   302     // List all drives in the system
       
   303     TDriveList driveList;
       
   304     TInt error = iFs.DriveList( driveList );
       
   305     
       
   306     if ( KErrNone == error )
       
   307         {
       
   308         for ( TInt driveNumber = EDriveY;
       
   309               driveNumber >= EDriveA;
       
   310               driveNumber-- )
       
   311             {
       
   312             TUint status( 0 );
       
   313             TInt error = DriveInfo::GetDriveStatus( iFs, driveNumber, status );
       
   314             if( (KErrNone == error) && ( status & DriveInfo::EDriveExternallyMountable ) 
       
   315             		&& ( status & DriveInfo::EDriveInternal ) )
       
   316                 {
       
   317                 // Internal Memory
       
   318                 result = ETrue;
       
   319                 break;
       
   320                 }
       
   321             }
       
   322         }
       
   323     return result;
       
   324     }
       
   325 
   286 //  End of File  
   326 //  End of File