41 #include <f32file.h> |
41 #include <f32file.h> |
42 #include <sysutil.h> |
42 #include <sysutil.h> |
43 #include <thumbnailmanager.h> |
43 #include <thumbnailmanager.h> |
44 #endif //RD_MPX_TNM_INTEGRATION |
44 #endif //RD_MPX_TNM_INTEGRATION |
45 // cenrep key need to be checked whether USB cable is connected in MTP/Combined Mode |
45 // cenrep key need to be checked whether USB cable is connected in MTP/Combined Mode |
46 #include <UsbWatcherInternalPSKeys.h> |
46 #include <mtpprivatepskeys.h> |
47 #include <usbpersonalityids.h> |
|
48 #include <mpxcollectionuihelper.h> |
47 #include <mpxcollectionuihelper.h> |
49 #include "mpxcollectionuihelperobserver.h" |
48 #include "mpxcollectionuihelperobserver.h" |
50 #include "mpxcollectionhelpercommon.h" |
49 #include "mpxcollectionhelpercommon.h" |
51 |
50 |
52 #include "mpxdeletehelper.h" |
51 #include "mpxdeletehelper.h" |
308 // |
307 // |
309 void CMPXDeleteHelper::RunL() |
308 void CMPXDeleteHelper::RunL() |
310 { |
309 { |
311 MPX_DEBUG3("CMPXDeleteHelper::RunL. [iMoreToDo %d] [iStatus %d]", iMoreToDo, iStatus.Int()); |
310 MPX_DEBUG3("CMPXDeleteHelper::RunL. [iMoreToDo %d] [iStatus %d]", iMoreToDo, iStatus.Int()); |
312 |
311 |
313 // cenrep key need to be checked whether USB cable is connected in MTP/Combined Mode |
312 TInt mtpStatus = EMtpPSStatusUninitialized; |
314 TUsbDeviceState deviceState = EUsbDeviceStateConfigured; |
313 RProperty::Get( KMtpPSUid, KMtpPSStatus, mtpStatus); |
315 if ( !iUsbManConnected ) |
314 |
316 { |
315 MPX_DEBUG2("CMPXCollectionViewHgImp::ConstructL, mtpstatus = %d", mtpStatus); |
317 ConnectUsbMan(); |
316 |
318 } |
317 if (mtpStatus != EMtpPSStatusUninitialized) |
319 |
318 { |
320 if ( iUsbManConnected ) |
319 MPX_DEBUG1("MTP is active, Stop Delete"); |
321 { |
320 CompleteDelete( KErrLocked ); |
322 if ( iUsbMan.GetDeviceState( deviceState ) != KErrNone ) |
321 return; |
323 { |
|
324 deviceState = EUsbDeviceStateConfigured; |
|
325 } |
|
326 } |
|
327 |
|
328 if ( deviceState == EUsbDeviceStateAddress || |
|
329 deviceState == EUsbDeviceStateConfigured ) |
|
330 { |
|
331 TInt usbStatus; |
|
332 RProperty::Get(KPSUidUsbWatcher, KUsbWatcherSelectedPersonality, usbStatus); |
|
333 if ((usbStatus == KUsbPersonalityIdMTP) || (usbStatus == KUsbPersonalityIdPCSuiteMTP)) |
|
334 { |
|
335 MPX_DEBUG1("USB is active, Stop Delete"); |
|
336 CompleteDelete( KErrLocked ); |
|
337 return; |
|
338 } |
|
339 } |
322 } |
340 |
323 |
341 if (iMoreToDo && iStatus.Int() == KErrNone) |
324 if (iMoreToDo && iStatus.Int() == KErrNone) |
342 { |
325 { |
343 DoTaskStep(); |
326 DoTaskStep(); |