equal
deleted
inserted
replaced
18 #include <mtp/mmtpobjectmgr.h> |
18 #include <mtp/mmtpobjectmgr.h> |
19 #include <mtp/cmtptypearray.h> |
19 #include <mtp/cmtptypearray.h> |
20 #include <mtp/mtpdatatypeconstants.h> |
20 #include <mtp/mtpdatatypeconstants.h> |
21 #include <mtp/mmtpstoragemgr.h> |
21 #include <mtp/mmtpstoragemgr.h> |
22 |
22 |
|
23 #include "cmtpdataprovidercontroller.h" |
23 #include "cmtpdevicedatastore.h" |
24 #include "cmtpdevicedatastore.h" |
24 #include "cmtpgetobjecthandles.h" |
25 #include "cmtpgetobjecthandles.h" |
25 #include "mtpdevicedpconst.h" |
26 #include "mtpdevicedpconst.h" |
26 #include "mtpdevdppanic.h" |
27 #include "mtpdevdppanic.h" |
27 |
28 |
28 // Class constants. |
29 // Class constants. |
29 __FLOG_STMT(_LIT8(KComponent,"GetObjectHandles");) |
30 __FLOG_STMT(_LIT8(KComponent,"GetObjectHandles");) |
|
31 |
|
32 static const TInt KMTPGetObjectHandlesTimeOut(1); |
30 |
33 |
31 /** |
34 /** |
32 Two-phase construction method |
35 Two-phase construction method |
33 @param aPlugin The data provider plugin |
36 @param aPlugin The data provider plugin |
34 @param aFramework The data provider framework |
37 @param aFramework The data provider framework |
75 GetObjectHandles request handler |
78 GetObjectHandles request handler |
76 */ |
79 */ |
77 void CMTPGetObjectHandles::ServiceL() |
80 void CMTPGetObjectHandles::ServiceL() |
78 { |
81 { |
79 __FLOG(_L8("ServiceL - Entry")); |
82 __FLOG(_L8("ServiceL - Entry")); |
|
83 |
|
84 if(iSingletons.DpController().EnumerateState() != CMTPDataProviderController::EEnumeratedFulllyCompleted) |
|
85 { |
|
86 TUint storageId = Request().Uint32(TMTPTypeRequest::ERequestParameter1); |
|
87 TUint handle = Request().Uint32(TMTPTypeRequest::ERequestParameter3); |
|
88 TUint enumerateState = iSingletons.DpController().StorageEnumerateState(storageId); |
|
89 if ( (enumerateState < CMTPDataProviderController::EEnumeratingPhaseOneDone) |
|
90 || (enumerateState != CMTPDataProviderController::EEnumeratedFulllyCompleted && handle != KMTPHandleAll)) |
|
91 { |
|
92 if (iTimeoutCount++ >= KMTPGetObjectHandlesTimeOut) |
|
93 { |
|
94 __FLOG(_L8("Wait for enumeration time out, return busy.")); |
|
95 SendResponseL(EMTPRespCodeDeviceBusy); |
|
96 iTimeoutCount = 0; |
|
97 return; |
|
98 } |
|
99 else |
|
100 { |
|
101 __FLOG(_L8("Enumeration not completed, suspend request.")); |
|
102 RegisterPendingRequest(20); |
|
103 return; |
|
104 } |
|
105 } |
|
106 } |
|
107 |
|
108 iTimeoutCount = 0; |
|
109 |
80 RMTPObjectMgrQueryContext context; |
110 RMTPObjectMgrQueryContext context; |
81 RArray<TUint> handles; |
111 RArray<TUint> handles; |
82 CleanupClosePushL(context); |
112 CleanupClosePushL(context); |
83 CleanupClosePushL(handles); |
113 CleanupClosePushL(handles); |
84 delete iHandles; |
114 delete iHandles; |