convergedcallengine/spsettings/src/spsettingsengine.cpp
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
    17 
    17 
    18 
    18 
    19 #include <centralrepository.h>
    19 #include <centralrepository.h>
    20 #include <e32property.h>
    20 #include <e32property.h>
    21 #include <featmgr.h>
    21 #include <featmgr.h>
    22 #include <settingsinternalcrkeys.h> 
    22 #include <settingsinternalcrkeys.h>
    23 #include <cenrepdatabaseutil.h>
    23 #include <cenrepdatabaseutil.h>
    24 
    24 
    25 #include "spsettingsengine.h"
    25 #include "spsettingsengine.h"
    26 #include "spentry.h"
    26 #include "spentry.h"
    27 #include "spproperty.h"
    27 #include "spproperty.h"
   190         CleanupStack::Pop( property );
   190         CleanupStack::Pop( property );
   191         }
   191         }
   192     }
   192     }
   193     
   193     
   194 void CSPSettingsEngine::CleanupPointerArray(  TAny* aPointer )
   194 void CSPSettingsEngine::CleanupPointerArray(  TAny* aPointer )
   195     {
   195 	{
   196     RIpAppPropArray* array = static_cast<RIpAppPropArray*>( aPointer );
   196 	RIpAppPropArray* array = static_cast<RIpAppPropArray*>( aPointer );
   197     array->ResetAndDestroy();
   197 	array->ResetAndDestroy();
   198     }
   198 	}
   199 
   199 
   200 // ---------------------------------------------------------------------------
   200 // ---------------------------------------------------------------------------
   201 // Stores new service provider settings entry
   201 // Stores new service provider settings entry
   202 // ---------------------------------------------------------------------------
   202 // ---------------------------------------------------------------------------
   203 //
   203 //
   205     {
   205     {
   206     XSPSLOGSTRING( "CSPSettingsEngine::AddEntryL() - IN" );
   206     XSPSLOGSTRING( "CSPSettingsEngine::AddEntryL() - IN" );
   207     
   207     
   208     // check the service name is not empty
   208     // check the service name is not empty
   209     if( aEntry.GetServiceName().Length() == 0 )
   209     if( aEntry.GetServiceName().Length() == 0 )
   210         {
   210     	{
   211         User::LeaveIfError( KErrArgument );
   211     	User::LeaveIfError( KErrArgument );
   212         }
   212     	}
   213 
   213 
   214     // construct RIpAppPropArray
   214     // construct RIpAppPropArray
   215     RIpAppPropArray array;
   215     RIpAppPropArray array;
   216     TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
   216 	TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
   217     CleanupStack::PushL( cleanup );
   217 	CleanupStack::PushL( cleanup );
   218     
   218     
   219     ConvertSpEntryToCenRepArrayL( aEntry, array );
   219     ConvertSpEntryToCenRepArrayL( aEntry, array );
   220 
   220 
   221     // Create new unique service ID
   221     // Create new unique service ID
   222     TInt newId = 0;
   222     TInt newId = 0;
   235  TInt CSPSettingsEngine::FindEntryL( TServiceId aServiceId, CSPEntry& aEntry )
   235  TInt CSPSettingsEngine::FindEntryL( TServiceId aServiceId, CSPEntry& aEntry )
   236     {
   236     {
   237     XSPSLOGSTRING2( "CSPSettingsEngine::FindEntryL( %d ) - IN", aServiceId );
   237     XSPSLOGSTRING2( "CSPSettingsEngine::FindEntryL( %d ) - IN", aServiceId );
   238     
   238     
   239     RIpAppPropArray array;
   239     RIpAppPropArray array;
   240     TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
   240 	TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
   241     CleanupStack::PushL( cleanup );
   241 	CleanupStack::PushL( cleanup );
   242 
   242 
   243     TInt err = iCenRepUtils->FindEntryL( aServiceId, array );
   243     TInt err = iCenRepUtils->FindEntryL( aServiceId, array );
   244     
   244     
   245     if( err == KErrNone )
   245     if( err == KErrNone )
   246         {
   246         {
   290         User::Leave( KErrArgument );
   290         User::Leave( KErrArgument );
   291         }
   291         }
   292 
   292 
   293     // construct RIpAppPropArray
   293     // construct RIpAppPropArray
   294     RIpAppPropArray array;
   294     RIpAppPropArray array;
   295     TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
   295 	TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
   296     CleanupStack::PushL( cleanup );
   296 	CleanupStack::PushL( cleanup );
   297     
   297     
   298     ConvertSpEntryToCenRepArrayL( aEntry, array );
   298     ConvertSpEntryToCenRepArrayL( aEntry, array );
   299 
   299 
   300     TInt err = iCenRepUtils->UpdateEntryL( (TInt) serviceId, array );
   300     TInt err = iCenRepUtils->UpdateEntryL( (TInt) serviceId, array );
   301     
   301     
   302     CleanupStack::PopAndDestroy( &array );
   302     CleanupStack::PopAndDestroy( &array );
   303     
   303 	
   304     XSPSLOGSTRING( "CSPSettingsEngine::UpdateEntry() - OUT" );
   304     XSPSLOGSTRING( "CSPSettingsEngine::UpdateEntry() - OUT" );
   305     
   305     
   306     return err;
   306     return err;
   307     }
   307     }
   308 
   308 
   309     
   309 	
   310 // ---------------------------------------------------------------------------
   310 // ---------------------------------------------------------------------------
   311 // Deletes service provider settings entry by service ID
   311 // Deletes service provider settings entry by service ID
   312 // ---------------------------------------------------------------------------
   312 // ---------------------------------------------------------------------------
   313 //
   313 //
   314 TInt CSPSettingsEngine::DeleteEntryL( TServiceId aServiceId )
   314 TInt CSPSettingsEngine::DeleteEntryL( TServiceId aServiceId )
   326 // ---------------------------------------------------------------------------
   326 // ---------------------------------------------------------------------------
   327 // Search property of service provider settings entry by property name
   327 // Search property of service provider settings entry by property name
   328 // ---------------------------------------------------------------------------
   328 // ---------------------------------------------------------------------------
   329 //
   329 //
   330 TInt CSPSettingsEngine::FindPropertyL( TServiceId aServiceId, 
   330 TInt CSPSettingsEngine::FindPropertyL( TServiceId aServiceId, 
   331                                        TServicePropertyName aPropertyName, 
   331     								   TServicePropertyName aPropertyName, 
   332                                        CSPProperty& aProperty )
   332     								   CSPProperty& aProperty )
   333     {
   333     {
   334     XSPSLOGSTRING2( "CSPSettingsEngine::FindPropertyL(%d) - IN", aServiceId );
   334     XSPSLOGSTRING2( "CSPSettingsEngine::FindPropertyL(%d) - IN", aServiceId );
   335 
   335 
   336     CCenRepDatabaseProperty* cenrepProperty = CCenRepDatabaseProperty::NewLC();
   336     CCenRepDatabaseProperty* cenrepProperty = CCenRepDatabaseProperty::NewLC();
   337     TInt err = iCenRepUtils->FindPropertyL( aServiceId, aPropertyName, *cenrepProperty );
   337     TInt err = iCenRepUtils->FindPropertyL( aServiceId, aPropertyName, *cenrepProperty );
   353 // ---------------------------------------------------------------------------
   353 // ---------------------------------------------------------------------------
   354 // Add or update properties of service provider settings entry
   354 // Add or update properties of service provider settings entry
   355 // ---------------------------------------------------------------------------
   355 // ---------------------------------------------------------------------------
   356 //
   356 //
   357 TInt CSPSettingsEngine::AddOrUpdatePropertiesL( TServiceId aServiceId,
   357 TInt CSPSettingsEngine::AddOrUpdatePropertiesL( TServiceId aServiceId,
   358                                                 const RPropertyArray& aPropertyArray )
   358 												const RPropertyArray& aPropertyArray )
   359     {
   359     {
   360     XSPSLOGSTRING2( "CSPSettingsEngine::AddOrUpdatePropertiesL(%d) - IN", aServiceId );
   360     XSPSLOGSTRING2( "CSPSettingsEngine::AddOrUpdatePropertiesL(%d) - IN", aServiceId );
   361 
   361 
   362     // construct RIpAppPropArray
   362     // construct RIpAppPropArray
   363     RIpAppPropArray array;
   363     RIpAppPropArray array;
   364     TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
   364 	TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
   365     CleanupStack::PushL( cleanup );
   365 	CleanupStack::PushL( cleanup );
   366     
   366     
   367     ConvertSpArrayToCenRepArrayL( aPropertyArray, array );
   367     ConvertSpArrayToCenRepArrayL( aPropertyArray, array );
   368     
   368     
   369     TInt err = iCenRepUtils->AddOrUpdatePropertiesL( aServiceId, array );    
   369     TInt err = iCenRepUtils->AddOrUpdatePropertiesL( aServiceId, array );    
   370 
   370 
   541 // ---------------------------------------------------------------------------
   541 // ---------------------------------------------------------------------------
   542 // 
   542 // 
   543 // ---------------------------------------------------------------------------
   543 // ---------------------------------------------------------------------------
   544 //
   544 //
   545 TInt CSPSettingsEngine::FindSubServicePropertiesL( TServiceId aServiceId, 
   545 TInt CSPSettingsEngine::FindSubServicePropertiesL( TServiceId aServiceId, 
   546     TSPItemType aPropertyType,
   546 	TSPItemType aPropertyType,
   547     RPropertyArray& aPropertyArray )
   547     RPropertyArray& aPropertyArray )
   548     {
   548     {
   549     XSPSLOGSTRING2( 
   549     XSPSLOGSTRING2( 
   550         "CSPSettingsEngine::FindSubServicePropertiesL( %d ) - IN", aServiceId );
   550         "CSPSettingsEngine::FindSubServicePropertiesL( %d ) - IN", aServiceId );
   551 
   551 
   584 // ---------------------------------------------------------------------------
   584 // ---------------------------------------------------------------------------
   585 // Deletes service properties
   585 // Deletes service properties
   586 // ---------------------------------------------------------------------------
   586 // ---------------------------------------------------------------------------
   587 //
   587 //
   588 TInt CSPSettingsEngine::DeleteServicePropertiesL( TServiceId aServiceId,
   588 TInt CSPSettingsEngine::DeleteServicePropertiesL( TServiceId aServiceId,
   589                                                   const RPropertyNameArray& aNameArray  )
   589     											  const RPropertyNameArray& aNameArray  )
   590     {
   590     {
   591     XSPSLOGSTRING2( 
   591     XSPSLOGSTRING2( 
   592         "CSPSettingsEngine::FindSubServicePropertyL( %d ) - IN", aServiceId );
   592         "CSPSettingsEngine::FindSubServicePropertyL( %d ) - IN", aServiceId );
   593 
   593 
   594     RArray<TUint32> nameArray;
   594     RArray<TUint32> nameArray;
   614 // ---------------------------------------------------------------------------
   614 // ---------------------------------------------------------------------------
   615 // Find service IDs with same properties
   615 // Find service IDs with same properties
   616 // ---------------------------------------------------------------------------
   616 // ---------------------------------------------------------------------------
   617 //
   617 //
   618 void CSPSettingsEngine::FindServiceIdsFromPropertiesL( const RPropertyArray& aPropertyArray, 
   618 void CSPSettingsEngine::FindServiceIdsFromPropertiesL( const RPropertyArray& aPropertyArray, 
   619                                                        RIdArray& aServiceIds )
   619 													   RIdArray& aServiceIds )
   620     {
   620 	{
   621     XSPSLOGSTRING( "CSPSettingsEngine::FindServiceIdsFromPropertiesL() - IN" );
   621 	XSPSLOGSTRING( "CSPSettingsEngine::FindServiceIdsFromPropertiesL() - IN" );
   622     
   622 	
   623     RArray<TInt> entryIds;
   623     RArray<TInt> entryIds;
   624     CleanupClosePushL( entryIds );
   624     CleanupClosePushL( entryIds );
   625     
   625     
   626     RIpAppPropArray array;
   626     RIpAppPropArray array;
   627     TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
   627 	TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
   628     CleanupStack::PushL( cleanup );
   628 	CleanupStack::PushL( cleanup );
   629     
   629     
   630     // todo custom cleanup stack
   630     // todo custom cleanup stack
   631     ConvertSpArrayToCenRepArrayL( aPropertyArray, array );  
   631     ConvertSpArrayToCenRepArrayL( aPropertyArray, array );  
   632     
   632     
   633     TInt err = iCenRepUtils->FindEntryIdsFromPropertiesL( array, entryIds );
   633     TInt err = iCenRepUtils->FindEntryIdsFromPropertiesL( array, entryIds );
   645         }
   645         }
   646         
   646         
   647     CleanupStack::PopAndDestroy( &array );
   647     CleanupStack::PopAndDestroy( &array );
   648     CleanupStack::PopAndDestroy( &entryIds );
   648     CleanupStack::PopAndDestroy( &entryIds );
   649     
   649     
   650     XSPSLOGSTRING( "CSPSettingsEngine::FindServiceIdsFromPropertiesL() - OUT" );
   650 	XSPSLOGSTRING( "CSPSettingsEngine::FindServiceIdsFromPropertiesL() - OUT" );
   651     }
   651 	}
   652 
   652 
   653 
   653 
   654 
   654 
   655 // ---------------------------------------------------------------------------
   655 // ---------------------------------------------------------------------------
   656 // Check feature is supported or not
   656 // Check feature is supported or not
   657 // ---------------------------------------------------------------------------
   657 // ---------------------------------------------------------------------------
   658 //
   658 //
   659 TBool CSPSettingsEngine::IsFeatureSupportedL( TSPServiceFeature aFeature,
   659 TBool CSPSettingsEngine::IsFeatureSupportedL( TSPServiceFeature aFeature,
   660                                               TBool aWriteAllowed )
   660                                               TBool aWriteAllowed )
   661     {
   661 	{
   662     XSPSLOGSTRING( "CSPSettingsEngine::IsFeatureSupportedL() - IN" );
   662     XSPSLOGSTRING( "CSPSettingsEngine::IsFeatureSupportedL() - IN" );
   663 
   663 
   664     TBool ret = EFalse;
   664     TBool ret = EFalse;
   665     
   665     
   666     // First check P&S key, if P&S key is defined, use the value from P&S key.
   666 	// First check P&S key, if P&S key is defined, use the value from P&S key.
   667     // if not defined, then walk through all the sevices and check there is any service match
   667 	// if not defined, then walk through all the sevices and check there is any service match
   668     TInt mask = 0;
   668 	TInt mask = 0;
   669     TInt value = 0;
   669 	TInt value = 0;
   670     TInt psFlag = 0;
   670 	TInt psFlag = 0;
   671     TInt retProperty = 0;
   671 	TInt retProperty = 0;
   672     
   672 	
   673     switch( aFeature )
   673     switch( aFeature )
   674         {
   674     	{
   675         case ESupportInternetCallFeature:
   675     	case ESupportInternetCallFeature:
   676             {
   676     		{
   677             retProperty = RProperty::Get( KUidSystemCategory, KSPSupportInternetCallKey, psFlag );
   677     		retProperty = RProperty::Get( KUidSystemCategory, KSPSupportInternetCallKey, psFlag );
   678             if( retProperty == KErrNone && psFlag != KSPInitFeatureValue )
   678     		if( retProperty == KErrNone && psFlag != KSPInitFeatureValue )
   679                 {
   679     			{
   680                 ret = psFlag;
   680     			ret = psFlag;
   681                 }
   681     			}
   682             else
   682     		else
   683                 {
   683     			{
   684                 mask = ESupportsInternetCall | ESupportsAlphanumericAddressing | EIsVisibleInCallMenu;
   684 				mask = ESupportsInternetCall | ESupportsAlphanumericAddressing | EIsVisibleInCallMenu;
   685                 value = mask;
   685 				value = mask;
   686                 ret = CheckFeatureL( mask, value );
   686 				ret = CheckFeatureL( mask, value );
   687                 if ( aWriteAllowed )
   687 				if ( aWriteAllowed )
   688                     {                   
   688 				    {				    
   689                     User::LeaveIfError( RProperty::Set( KUidSystemCategory, 
   689 				    User::LeaveIfError( RProperty::Set( KUidSystemCategory, 
   690                         KSPSupportInternetCallKey, ret ) );
   690 				        KSPSupportInternetCallKey, ret ) );
   691                     }
   691 				    }
   692                 }
   692     			}
   693             
   693     		
   694             break;
   694     		break;
   695             }
   695     		}
   696         case ESupportCallOutFeature:
   696     	case ESupportCallOutFeature:
   697             {
   697     		{
   698             retProperty = RProperty::Get( KUidSystemCategory, KSPSupportCallOutKey, psFlag );
   698     		retProperty = RProperty::Get( KUidSystemCategory, KSPSupportCallOutKey, psFlag );
   699             if( retProperty == KErrNone && psFlag != KSPInitFeatureValue )
   699     		if( retProperty == KErrNone && psFlag != KSPInitFeatureValue )
   700                 {
   700     			{
   701                 ret = psFlag;
   701     			ret = psFlag;
   702                 }
   702     			}
   703             else
   703     		else
   704                 {
   704     			{
   705                 mask = ESupportsInternetCall | ESupportsMSISDNAddressing | EIsVisibleInCallMenu;
   705 				mask = ESupportsInternetCall | ESupportsMSISDNAddressing | EIsVisibleInCallMenu;
   706                 value = mask;
   706 				value = mask;
   707                 ret = CheckFeatureL( mask, value );
   707 				ret = CheckFeatureL( mask, value );
   708                 if ( aWriteAllowed )
   708 				if ( aWriteAllowed )
   709                     {                   
   709 				    {				    
   710                     User::LeaveIfError( RProperty::Set( 
   710     				User::LeaveIfError( RProperty::Set( 
   711                         KUidSystemCategory, 
   711     				    KUidSystemCategory, 
   712                         KSPSupportCallOutKey, ret ) );
   712     				    KSPSupportCallOutKey, ret ) );
   713                     }
   713 				    }
   714                 }
   714     			}
   715             break;
   715     		break;
   716             }
   716     		}
   717         
   717     	
   718         case ESupportVoIPSSFeature:
   718     	case ESupportVoIPSSFeature:
   719             {
   719     		{
   720             retProperty = RProperty::Get( KUidSystemCategory, KSPSupportVoIPSSKey, psFlag );
   720     		retProperty = RProperty::Get( KUidSystemCategory, KSPSupportVoIPSSKey, psFlag );
   721             if( retProperty == KErrNone && psFlag != KSPInitFeatureValue )
   721     		if( retProperty == KErrNone && psFlag != KSPInitFeatureValue )
   722                 {
   722     			{
   723                 ret = psFlag;
   723     			ret = psFlag;
   724                 }
   724     			}
   725             else
   725     		else
   726                 {
   726     			{
   727                 mask = ESupportVoIPSS;
   727 				mask = ESupportVoIPSS;
   728                 value = mask;
   728 				value = mask;
   729                 ret = CheckFeatureL( mask, value );
   729 				ret = CheckFeatureL( mask, value );
   730                 if ( aWriteAllowed )
   730 				if ( aWriteAllowed )
   731                     {                   
   731 				    {				    
   732                     User::LeaveIfError( RProperty::Set( 
   732     				User::LeaveIfError( RProperty::Set( 
   733                         KUidSystemCategory, 
   733     				    KUidSystemCategory, 
   734                         KSPSupportVoIPSSKey, ret ) );
   734     				    KSPSupportVoIPSSKey, ret ) );
   735                     }
   735 				    }
   736                 }
   736     			}
   737             break;
   737     		break;
   738             }
   738     		}
   739         
   739     	
   740         case ESupportVoIPFeature:
   740     	case ESupportVoIPFeature:
   741             {
   741     		{
   742             TBool bFeatureMgr = EFalse;
   742     		TBool bFeatureMgr = EFalse;
   743             TBool bDynVoIP = EFalse;
   743     		TBool bDynVoIP = EFalse;
   744             TBool bSubVoIP = EFalse;
   744     		TBool bSubVoIP = EFalse;
   745             
   745     		
   746             //check FeatureManager
   746     		//check FeatureManager
   747             FeatureManager::InitializeLibL();
   747     		FeatureManager::InitializeLibL();
   748             bFeatureMgr = FeatureManager::FeatureSupported( KFeatureIdCommonVoip );
   748     		bFeatureMgr = FeatureManager::FeatureSupported( KFeatureIdCommonVoip );
   749             FeatureManager::UnInitializeLib();
   749     		FeatureManager::UnInitializeLib();
   750             
   750     		
   751             //check dynamic voip flag
   751     		//check dynamic voip flag
   752             CRepository* repository = CRepository::NewLC( KCRUidTelephonySettings );
   752 			CRepository* repository = CRepository::NewLC( KCRUidTelephonySettings );
   753             TInt value = 0;
   753 			TInt value = 0;
   754             TInt err = repository->Get( KDynamicVoIP, value );
   754 			TInt err = repository->Get( KDynamicVoIP, value );
   755             if( value != 0 )
   755 			if( value != 0 )
   756                 {
   756 				{
   757                 bDynVoIP = ETrue;
   757 				bDynVoIP = ETrue;
   758                 }
   758 				}
   759             
   759 			
   760             CleanupStack::PopAndDestroy( repository );
   760 			CleanupStack::PopAndDestroy( repository );
   761             
   761     		
   762             //check subservice voip
   762     		//check subservice voip
   763             RIdArray serviceIds;
   763 			RIdArray serviceIds;
   764             CleanupClosePushL( serviceIds );
   764 			CleanupClosePushL( serviceIds );
   765             FindServiceIdsL( serviceIds );
   765 			FindServiceIdsL( serviceIds );
   766             CSPProperty* property = CSPProperty::NewLC();
   766 			CSPProperty* property = CSPProperty::NewLC();
   767             
   767 			
   768             for( TInt i = 0; i < serviceIds.Count(); i++ )
   768 			for( TInt i = 0; i < serviceIds.Count(); i++ )
   769                 {
   769 				{
   770                 TServiceId serviceId = serviceIds[i];
   770 				TServiceId serviceId = serviceIds[i];
   771                 TInt retProperty = FindPropertyL( serviceId, EPropertyVoIPSubServicePluginId, *property );
   771 				TInt retProperty = FindPropertyL( serviceId, EPropertyVoIPSubServicePluginId, *property );
   772                 if( retProperty == KErrNone )
   772 				if( retProperty == KErrNone )
   773                     {
   773 					{
   774                     bSubVoIP = ETrue;
   774 					bSubVoIP = ETrue;
   775                     break;
   775 					break;
   776                     }
   776 					}
   777                 }
   777 				}
   778             CleanupStack::PopAndDestroy( property );
   778 			CleanupStack::PopAndDestroy( property );
   779             CleanupStack::PopAndDestroy( &serviceIds );
   779 			CleanupStack::PopAndDestroy( &serviceIds );
   780             
   780 			
   781             ret = bFeatureMgr && bDynVoIP && bSubVoIP;
   781 			ret = bFeatureMgr && bDynVoIP && bSubVoIP;
   782             
   782 			
   783             break;
   783     		break;
   784             }
   784     		}
   785         default:
   785 		default:
   786             {
   786 			{
   787             User::Leave( KErrNotSupported );        
   787 			User::Leave( KErrNotSupported );    	
   788             }
   788 			}
   789         }
   789     	}
   790     
   790     
   791     XSPSLOGSTRING( "CSPSettingsEngine::IsFeatureSupportedL() - OUT" );
   791     XSPSLOGSTRING( "CSPSettingsEngine::IsFeatureSupportedL() - OUT" );
   792 
   792 
   793     return ret;
   793     return ret;
   794     }
   794 	}
   795 
   795 
   796 // ---------------------------------------------------------------------------
   796 // ---------------------------------------------------------------------------
   797 // When service table is changed, update the P&S key
   797 // When service table is changed, update the P&S key
   798 // ---------------------------------------------------------------------------
   798 // ---------------------------------------------------------------------------
   799 //
   799 //
   800 void CSPSettingsEngine::UpdateSupportFeaturePSKeyL()
   800 void CSPSettingsEngine::UpdateSupportFeaturePSKeyL()
   801     {
   801 	{
   802     TInt mask = 0;
   802 	TInt mask = 0;
   803     TInt value = 0;
   803 	TInt value = 0;
   804     TBool ret = EFalse;
   804 	TBool ret = EFalse;
   805     
   805 	
   806     //ESupportInternetCallFeature
   806 	//ESupportInternetCallFeature
   807     //ESupportsInternetCall + ESupportsAlphanumericAddressing + EIsVisibleInCallMenu
   807 	//ESupportsInternetCall + ESupportsAlphanumericAddressing + EIsVisibleInCallMenu
   808     mask = ESupportsInternetCall | ESupportsAlphanumericAddressing | EIsVisibleInCallMenu;
   808 	mask = ESupportsInternetCall | ESupportsAlphanumericAddressing | EIsVisibleInCallMenu;
   809     value = mask;
   809 	value = mask;
   810     ret = CheckFeatureL( mask, value );
   810 	ret = CheckFeatureL( mask, value );
   811     User::LeaveIfError( RProperty::Set( KUidSystemCategory, KSPSupportInternetCallKey, ret ) );
   811 	User::LeaveIfError( RProperty::Set( KUidSystemCategory, KSPSupportInternetCallKey, ret ) );
   812     
   812 	
   813     //ESupportCallOutFeature
   813 	//ESupportCallOutFeature
   814     //ESupportsInternetCall + ESupportsMSISDNAddressing + EIsVisibleInCallMenu
   814 	//ESupportsInternetCall + ESupportsMSISDNAddressing + EIsVisibleInCallMenu
   815     mask = ESupportsInternetCall | ESupportsMSISDNAddressing | EIsVisibleInCallMenu;
   815 	mask = ESupportsInternetCall | ESupportsMSISDNAddressing | EIsVisibleInCallMenu;
   816     value = mask;
   816 	value = mask;
   817     ret = CheckFeatureL( mask, value );
   817 	ret = CheckFeatureL( mask, value );
   818     User::LeaveIfError( RProperty::Set( KUidSystemCategory, KSPSupportCallOutKey, ret ) );
   818 	User::LeaveIfError( RProperty::Set( KUidSystemCategory, KSPSupportCallOutKey, ret ) );
   819     
   819 	
   820     //ESupportVoIPSSFeature
   820 	//ESupportVoIPSSFeature
   821     //ESupportVoIPSS
   821 	//ESupportVoIPSS
   822     mask = ESupportVoIPSS;
   822 	mask = ESupportVoIPSS;
   823     value = mask;
   823 	value = mask;
   824     ret = CheckFeatureL( mask, value );
   824 	ret = CheckFeatureL( mask, value );
   825     User::LeaveIfError( RProperty::Set( KUidSystemCategory, KSPSupportVoIPSSKey, ret ) );
   825 	User::LeaveIfError( RProperty::Set( KUidSystemCategory, KSPSupportVoIPSSKey, ret ) );
   826     }
   826 	}
   827 
   827 
   828 // ---------------------------------------------------------------------------
   828 // ---------------------------------------------------------------------------
   829 // Walk through all the sevices and check there is any service match 
   829 // Walk through all the sevices and check there is any service match 
   830 // ---------------------------------------------------------------------------
   830 // ---------------------------------------------------------------------------
   831 //
   831 //
   832 TBool CSPSettingsEngine::CheckFeatureL( TInt aMask, TInt aValue )
   832 TBool CSPSettingsEngine::CheckFeatureL( TInt aMask, TInt aValue )
   833     {
   833 	{
   834     RArray<TInt> entryIds;
   834 	RArray<TInt> entryIds;
   835     CleanupClosePushL( entryIds );
   835 	CleanupClosePushL( entryIds );
   836     iCenRepUtils->FindEntryIdsL( entryIds );
   836 	iCenRepUtils->FindEntryIdsL( entryIds );
   837     CCenRepDatabaseProperty* property = CCenRepDatabaseProperty::NewLC();
   837 	CCenRepDatabaseProperty* property = CCenRepDatabaseProperty::NewLC();
   838     TBool ret = EFalse;
   838 	TBool ret = EFalse;
   839     
   839 	
   840     for( TInt i = 0; i < entryIds.Count(); i++ )
   840 	for( TInt i = 0; i < entryIds.Count(); i++ )
   841         {
   841 		{
   842         TInt entryId = entryIds[i];
   842 		TInt entryId = entryIds[i];
   843         if( entryId == KSPDefaultVoIPServiceId )
   843 		if( entryId == KSPDefaultVoIPServiceId )
   844             {
   844 		    {
   845             continue;
   845 		    continue;
   846             }
   846 		    }
   847             
   847 		    
   848         TInt retProperty = iCenRepUtils->FindPropertyL( entryId, EPropertyServiceAttributeMask, *property );
   848 		TInt retProperty = iCenRepUtils->FindPropertyL( entryId, EPropertyServiceAttributeMask, *property );
   849         if( retProperty == KErrNone )
   849 		if( retProperty == KErrNone )
   850             {
   850 			{
   851             TInt maskValue = 0;
   851 			TInt maskValue = 0;
   852             TInt err = property->GetValue( maskValue );
   852 			TInt err = property->GetValue( maskValue );
   853             if( err == KErrNone )
   853 			if( err == KErrNone )
   854                 {
   854 				{
   855                 if( ( maskValue & aMask ) == (aValue & aMask) )
   855 				if( ( maskValue & aMask ) == (aValue & aMask) )
   856                     {
   856 					{
   857                     // Find matched servcie
   857 					// Find matched servcie
   858                     ret = ETrue;
   858 					ret = ETrue;
   859                     break;
   859 					break;
   860                     }
   860 					}
   861                 }
   861 				}
   862             }
   862 			}
   863         }
   863 		}
   864     
   864 	
   865     CleanupStack::PopAndDestroy( property );
   865 	CleanupStack::PopAndDestroy( property );
   866     CleanupStack::PopAndDestroy( &entryIds );
   866 	CleanupStack::PopAndDestroy( &entryIds );
   867     return ret;
   867 	return ret;
   868     }
   868 	}
   869 
   869 
   870 // ---------------------------------------------------------------------------
   870 // ---------------------------------------------------------------------------
   871 // Check if it is VoIP Service ID
   871 // Check if it is VoIP Service ID
   872 // ---------------------------------------------------------------------------
   872 // ---------------------------------------------------------------------------
   873 //
   873 //
   958 // ---------------------------------------------------------------------------
   958 // ---------------------------------------------------------------------------
   959 // Get Name array from Property array 
   959 // Get Name array from Property array 
   960 // ---------------------------------------------------------------------------
   960 // ---------------------------------------------------------------------------
   961 //
   961 //
   962 void CSPSettingsEngine::NameArrayFromPropertyArrayL( RPropertyNameArray& aNameArray, 
   962 void CSPSettingsEngine::NameArrayFromPropertyArrayL( RPropertyNameArray& aNameArray, 
   963                                                 const RPropertyArray& aPropertyArray )
   963 												const RPropertyArray& aPropertyArray )
   964     {
   964     {
   965     aNameArray.Reset();
   965     aNameArray.Reset();
   966     
   966     
   967     for( TInt i = 0; i < aPropertyArray.Count(); i++ )
   967     for( TInt i = 0; i < aPropertyArray.Count(); i++ )
   968         {
   968         {