46 #include <CVPbkContactStoreProperties.h> |
46 #include <CVPbkContactStoreProperties.h> |
47 #include <VPbkError.h> |
47 #include <VPbkError.h> |
48 #include <VPbkSimStoreTemplateFunctions.h> |
48 #include <VPbkSimStoreTemplateFunctions.h> |
49 #include <CVPbkAsyncCallback.h> |
49 #include <CVPbkAsyncCallback.h> |
50 |
50 |
|
51 #include <featmgr.h> |
51 namespace VPbkSimStore { |
52 namespace VPbkSimStore { |
52 |
53 |
53 // LOCAL |
54 // LOCAL |
54 namespace { |
55 namespace { |
55 |
56 |
578 // ----------------------------------------------------------------------------- |
579 // ----------------------------------------------------------------------------- |
579 // |
580 // |
580 void CContactStore::StoreReady( MVPbkSimCntStore& /*aStore*/ ) |
581 void CContactStore::StoreReady( MVPbkSimCntStore& /*aStore*/ ) |
581 { |
582 { |
582 TVPbkGsmStoreProperty gsmProperties; |
583 TVPbkGsmStoreProperty gsmProperties; |
583 TInt res = iNativeStore->GetGsmStoreProperties( gsmProperties ); |
584 TInt res = KErrNone; |
584 |
585 if( !FeatureManager::FeatureSupported( KFeatureIdFfTdClmcontactreplicationfromphonebooktousimcard ) ) |
585 if ( res == KErrNone ) |
586 { |
586 { |
587 res= iNativeStore->GetGsmStoreProperties( gsmProperties ); |
587 delete iSupportedFieldTypes; |
588 if ( res == KErrNone ) |
588 iSupportedFieldTypes = NULL; |
589 { |
589 TRAP( res, iSupportedFieldTypes = CSupportedFieldTypes::NewL( |
590 delete iSupportedFieldTypes; |
590 iStoreDomain.FieldTypeMappings(), gsmProperties ) ); |
591 iSupportedFieldTypes = NULL; |
591 iSimStoreCapabilities = gsmProperties.iCaps; |
592 TRAP( res, iSupportedFieldTypes = CSupportedFieldTypes::NewL( |
592 } |
593 iStoreDomain.FieldTypeMappings(), gsmProperties ) ); |
593 |
594 iSimStoreCapabilities = gsmProperties.iCaps; |
|
595 } |
|
596 } |
|
597 else // if contact replication from phonebook to usim card. |
|
598 { |
|
599 TInt resGsm = iNativeStore->GetGsmStoreProperties( gsmProperties ); |
|
600 TVPbkUSimStoreProperty usimProperties; |
|
601 TInt resUsim = iNativeStore->GetUSimStoreProperties( usimProperties ); |
|
602 if( resGsm == KErrNone && resUsim == KErrNone ) |
|
603 { |
|
604 delete iSupportedFieldTypes; |
|
605 iSupportedFieldTypes = NULL; |
|
606 TRAP( res, iSupportedFieldTypes = CSupportedFieldTypes::NewL( |
|
607 iStoreDomain.FieldTypeMappings(), gsmProperties, usimProperties ) ); |
|
608 iSimStoreCapabilities = gsmProperties.iCaps; |
|
609 } |
|
610 else |
|
611 { |
|
612 res = ( resGsm != KErrNone ? resGsm : resUsim ); |
|
613 } |
|
614 } |
|
615 |
594 if ( res != KErrNone ) |
616 if ( res != KErrNone ) |
595 { |
617 { |
596 iStoreState = EStoreNotAvailable; |
618 iStoreState = EStoreNotAvailable; |
597 VPbkSimStoreImpl::SendObserverMessageRV( iStoreObservers, |
619 VPbkSimStoreImpl::SendObserverMessageRV( iStoreObservers, |
598 &MVPbkContactStoreObserver::StoreUnavailable, *this, res ); |
620 &MVPbkContactStoreObserver::StoreUnavailable, *this, res ); |