mmappcomponents/harvester/server/src/mpxusbeventhandler.cpp
branchRCL_3
changeset 23 4740b34b83ce
parent 14 05b0d2323768
child 30 6f9f6e99a23e
equal deleted inserted replaced
19:51035f0751c2 23:4740b34b83ce
    17 
    17 
    18 
    18 
    19 #include <e32base.h>
    19 #include <e32base.h>
    20 #include <f32file.h>
    20 #include <f32file.h>
    21 #include <e32property.h>
    21 #include <e32property.h>
    22 #ifdef RD_MULTIPLE_DRIVE
       
    23 #include <driveinfo.h>
    22 #include <driveinfo.h>
    24 #endif //RD_MULTIPLE_DRIVE
       
    25 #include <mpxpskeywatcher.h>
    23 #include <mpxpskeywatcher.h>
    26 #include <coreapplicationuisdomainpskeys.h>
    24 #include <coreapplicationuisdomainpskeys.h>
    27 #include <UsbWatcherInternalPSKeys.h>
    25 #include <UsbWatcherInternalPSKeys.h>
    28 #include <usbpersonalityids.h>
    26 #include <usbpersonalityids.h>
    29 #include <MtpPrivatePSKeys.h>
    27 #include <MtpPrivatePSKeys.h>
   149         ConnectUsbMan();
   147         ConnectUsbMan();
   150         }
   148         }
   151     
   149     
   152     // Use the default MMC drive
   150     // Use the default MMC drive
   153     TInt removableDrive( EDriveE );
   151     TInt removableDrive( EDriveE );
   154 #ifdef RD_MULTIPLE_DRIVE
       
   155     User::LeaveIfError( DriveInfo::GetDefaultDrive(
   152     User::LeaveIfError( DriveInfo::GetDefaultDrive(
   156         DriveInfo::EDefaultRemovableMassStorage,
   153         DriveInfo::EDefaultRemovableMassStorage,
   157         removableDrive ) );
   154         removableDrive ) );
   158 #endif // RD_MULTIPLE_DRIVE
       
   159 
   155 
   160     // Handle the Key event
   156     // Handle the Key event
   161     TInt value;
   157     TInt value;
   162     iPSKeyWatcher->GetValue( value );
   158     iPSKeyWatcher->GetValue( value );
   163 
   159 
   174             {
   170             {
   175             MPX_DEBUG1("CMPXUsbEventHandler::DoHandlePSEvent - MTP End");
   171             MPX_DEBUG1("CMPXUsbEventHandler::DoHandlePSEvent - MTP End");
   176             iObserver.HandleSystemEventL( EUSBMTPEndEvent, removableDrive );
   172             iObserver.HandleSystemEventL( EUSBMTPEndEvent, removableDrive );
   177             }
   173             }
   178         MPX_DEBUG1("CMPXUsbEventHandler::DoHandlePSEvent - USB Start");
   174         MPX_DEBUG1("CMPXUsbEventHandler::DoHandlePSEvent - USB Start");
   179 #ifdef RD_MULTIPLE_DRIVE
       
   180         removableDrive = -1;
   175         removableDrive = -1;
   181 #endif // RD_MULTIPLE_DRIVE
       
   182 
   176 
   183         // Notify the state change (may happen more than once)
   177         // Notify the state change (may happen more than once)
   184         iObserver.HandleSystemEventL( EUSBMassStorageStartEvent, removableDrive );
   178         iObserver.HandleSystemEventL( EUSBMassStorageStartEvent, removableDrive );
   185         iState = KUsbPersonalityIdMS;
   179         iState = KUsbPersonalityIdMS;
   186         }
   180         }