equal
deleted
inserted
replaced
23 #include <bautils.h> |
23 #include <bautils.h> |
24 #include <e32math.h> |
24 #include <e32math.h> |
25 #include <e32property.h> |
25 #include <e32property.h> |
26 #include <mtpprivatepskeys.h> |
26 #include <mtpprivatepskeys.h> |
27 |
27 |
|
28 #include "mmmtpdp_variant.hrh" |
28 #include "cmmmtpdpmetadataaccesswrapper.h" |
29 #include "cmmmtpdpmetadataaccesswrapper.h" |
29 #include "cmmmtpdpmetadatampxaccess.h" |
30 #include "cmmmtpdpmetadatampxaccess.h" |
30 #include "cmmmtpdpmetadatavideoaccess.h" |
31 #include "cmmmtpdpmetadatavideoaccess.h" |
31 #include "mmmtpdputility.h" |
32 #include "mmmtpdputility.h" |
32 #include "tobjectdescription.h" |
33 #include "tobjectdescription.h" |
74 KMtpPSStatus, |
75 KMtpPSStatus, |
75 RProperty::EInt, |
76 RProperty::EInt, |
76 KKeyReadPolicy, |
77 KKeyReadPolicy, |
77 KKeyWritePolicy); |
78 KKeyWritePolicy); |
78 |
79 |
|
80 #ifdef MMMTPDP_RESET_STATUS_CLOSESESSION |
|
81 MmMtpDpUtility::SetPSStatus(EMtpPSStatusUninitialized); |
|
82 #else |
|
83 MmMtpDpUtility::SetPSStatus(EMtpPSStatusReadyToSync); |
|
84 #endif // MMMTPDP_RESET_STATUS_CLOSESESSION |
|
85 |
79 PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::ConstructL" ) ); |
86 PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::ConstructL" ) ); |
80 } |
87 } |
81 |
88 |
82 // --------------------------------------------------------------------------- |
89 // --------------------------------------------------------------------------- |
83 // CMmMtpDpMetadataAccessWrapper::~CMmMtpDpMetadataAccessWrapper |
90 // CMmMtpDpMetadataAccessWrapper::~CMmMtpDpMetadataAccessWrapper |
93 |
100 |
94 delete iMmMtpDpMetadataVideoAccess; |
101 delete iMmMtpDpMetadataVideoAccess; |
95 delete iMmMtpDpMetadataMpxAccess; |
102 delete iMmMtpDpMetadataMpxAccess; |
96 |
103 |
97 // unblock MPX |
104 // unblock MPX |
98 RProperty::Set( KMtpPSUid, |
105 MmMtpDpUtility::SetPSStatus(EMtpPSStatusUninitialized); |
99 KMtpPSStatus, |
106 |
100 EMtpPSStatusUninitialized ); |
|
101 PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::~CMmMtpDpMetadataAccessWrapper" ) ); |
107 PRINT( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::~CMmMtpDpMetadataAccessWrapper" ) ); |
102 } |
108 } |
103 |
109 |
104 // ----------------------------------------------------------------------------- |
110 // ----------------------------------------------------------------------------- |
105 // CMmMtpDpMetadataAccessWrapper::SetReferenceL |
111 // CMmMtpDpMetadataAccessWrapper::SetReferenceL |
335 // ----------------------------------------------------------------------------- |
341 // ----------------------------------------------------------------------------- |
336 // |
342 // |
337 void CMmMtpDpMetadataAccessWrapper::OpenSessionL() |
343 void CMmMtpDpMetadataAccessWrapper::OpenSessionL() |
338 { |
344 { |
339 iOpenCount++; |
345 iOpenCount++; |
|
346 |
|
347 #ifdef MMMTPDP_RESET_STATUS_CLOSESESSION |
|
348 if (iOpenCount == 1) |
|
349 MmMtpDpUtility::SetPSStatus(EMtpPSStatusReadyToSync); |
|
350 #endif // MMMTPDP_RESET_STATUS_CLOSESESSION |
340 } |
351 } |
341 |
352 |
342 // ----------------------------------------------------------------------------- |
353 // ----------------------------------------------------------------------------- |
343 // CMmMtpDpMetadataAccessWrapper::CloseSessionL |
354 // CMmMtpDpMetadataAccessWrapper::CloseSessionL |
344 // |
355 // |
353 iOpenCount--; |
364 iOpenCount--; |
354 |
365 |
355 if ( iOpenCount == 0 ) |
366 if ( iOpenCount == 0 ) |
356 { |
367 { |
357 PRINT( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::CloseSessionL close" ) ); |
368 PRINT( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::CloseSessionL close" ) ); |
358 iMmMtpDpMetadataMpxAccess->CloseSession(); |
369 iMmMtpDpMetadataMpxAccess->CloseSession(); // trigger close and flush CollectionHelper |
359 iMmMtpDpMetadataVideoAccess->CloseSessionL(); |
370 iMmMtpDpMetadataVideoAccess->CloseSessionL(); |
|
371 |
|
372 #ifdef MMMTPDP_RESET_STATUS_CLOSESESSION |
|
373 MmMtpDpUtility::SetPSStatus(EMtpPSStatusUninitialized); |
|
374 #endif // MMMTPDP_RESET_STATUS_CLOSESESSION |
360 } |
375 } |
361 } |
376 } |
362 else |
377 else |
363 { |
378 { |
364 PRINT( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::CloseSessionL already close" ) ); |
379 PRINT( _L( "MM MTP <> CMmMtpDpMetadataAccessWrapper::CloseSessionL already close" ) ); |