convergedconnectionhandler/cchserver/src/cchspshandler.cpp
changeset 0 a4daefaec16c
child 20 be41ab7b952f
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  CCCHSPSHandler implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <spsettings.h>
       
    21 #include <spentry.h>
       
    22 #include <spproperty.h>
       
    23 
       
    24 #include "cchspshandler.h"
       
    25 #include "cchlogger.h"
       
    26 
       
    27 // EXTERNAL DATA STRUCTURES
       
    28 // None
       
    29 
       
    30 // EXTERNAL FUNCTION PROTOTYPES
       
    31 // None
       
    32 
       
    33 // CONSTANTS
       
    34 // None
       
    35 
       
    36 // MACROS
       
    37 // None
       
    38 
       
    39 // LOCAL CONSTANTS AND MACROS
       
    40 // None
       
    41 
       
    42 // MODULE DATA STRUCTURES
       
    43 // None
       
    44 
       
    45 // LOCAL FUNCTION PROTOTYPES
       
    46 // None
       
    47 
       
    48 // FORWARD DECLARATIONS
       
    49 // None
       
    50 
       
    51 // ============================= LOCAL FUNCTIONS =============================
       
    52 
       
    53 // ============================ MEMBER FUNCTIONS =============================
       
    54 
       
    55 // ---------------------------------------------------------------------------
       
    56 // CCCHSPSHandler::CCCHSPSHandler
       
    57 // C++ default constructor can NOT contain any code, that might leave.
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 CCCHSPSHandler::CCCHSPSHandler( CCCHServerBase& aServer ):
       
    61     iServer( aServer )
       
    62     {
       
    63     // No implementation required
       
    64     }
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // CCCHSPSHandler::ConstructL
       
    68 // Symbian 2nd phase constructor can leave.
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 void CCCHSPSHandler::ConstructL()
       
    72     {
       
    73     iSettings = CSPSettings::NewL();
       
    74     }
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // CCCHSPSHandler::NewL
       
    78 // Two-phased constructor.
       
    79 // ---------------------------------------------------------------------------
       
    80 //
       
    81 CCCHSPSHandler* CCCHSPSHandler::NewL( CCCHServerBase& aServer )
       
    82     {
       
    83     CCCHSPSHandler* self = CCCHSPSHandler::NewLC( aServer );
       
    84     CleanupStack::Pop( self );
       
    85     return self;
       
    86     }
       
    87 
       
    88 // ---------------------------------------------------------------------------
       
    89 // CCCHSPSHandler::NewLC
       
    90 // Two-phased constructor.
       
    91 // ---------------------------------------------------------------------------
       
    92 //
       
    93 CCCHSPSHandler* CCCHSPSHandler::NewLC( CCCHServerBase& aServer )
       
    94     {
       
    95     CCCHSPSHandler* self = new (ELeave) CCCHSPSHandler( aServer );
       
    96     CleanupStack::PushL( self );
       
    97     self->ConstructL();
       
    98     return self;
       
    99     }
       
   100 
       
   101 // Destructor
       
   102 CCCHSPSHandler::~CCCHSPSHandler()
       
   103     {
       
   104     delete iSettings;
       
   105     iSettings = NULL;
       
   106     }
       
   107 
       
   108 // ---------------------------------------------------------------------------
       
   109 // CCCHSPSHandler::GetServicesCountL
       
   110 // (other items were commented in a header).
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 TInt CCCHSPSHandler::GetServicesCountL() const
       
   114     {
       
   115     CCHLOGSTRING2( "CCCHSPSHandler::GetServicesCountL : %d", 
       
   116         iSettings->SettingsCountL() );
       
   117             
       
   118     return iSettings->SettingsCountL();
       
   119     }
       
   120 
       
   121 // ---------------------------------------------------------------------------
       
   122 // CCCHSPSHandler::GetServiceIdsL
       
   123 // (other items were commented in a header).
       
   124 // ---------------------------------------------------------------------------
       
   125 //
       
   126 void CCCHSPSHandler::GetServiceIdsL( RArray<TUint>& aServiceIds ) const
       
   127     {
       
   128     CCHLOGSTRING( "CCCHSPSHandler::GetServiceIdsL: IN" );
       
   129     
       
   130     TRAP_IGNORE( iSettings->FindServiceIdsL( aServiceIds ) );
       
   131     
       
   132     CCHLOGSTRING2
       
   133         ( "CCCHSPSHandler::GetServiceIdsL: OUT: %d", aServiceIds.Count() );
       
   134     }
       
   135 
       
   136 // ---------------------------------------------------------------------------
       
   137 // CCCHSPSHandler::GetServiceInfoL
       
   138 // (other items were commented in a header).
       
   139 // ---------------------------------------------------------------------------
       
   140 //
       
   141 void CCCHSPSHandler::GetServiceInfoL( const TUint32 aServiceId, 
       
   142     TCCHService& aService ) const
       
   143     {
       
   144     CCHLOGSTRING( "CCCHSPSHandler::GetServiceInfoL: IN" );
       
   145     TInt err( KErrNone );
       
   146     // Get entry
       
   147     CSPEntry* entry = CSPEntry::NewLC();
       
   148     err = iSettings->FindEntryL( aServiceId, *entry );
       
   149     CCHLOGSTRING2( "iSettings->FindEntryL err: %d", err );
       
   150     if ( KErrNone == err )
       
   151         {
       
   152         // Read service id and service name
       
   153         aService.iServiceId = aServiceId;
       
   154         RBuf buf;
       
   155         buf.Create( entry->GetServiceName(), KCCHMaxServiceNameLength );
       
   156         aService.iServiceName.Copy( buf );
       
   157         buf.Close();
       
   158         
       
   159         // get all service properties a.k.a subservices
       
   160         RPropertyArray properties;
       
   161         properties = entry->GetAllProperties();
       
   162         
       
   163         TServicePropertyName propertyName;
       
   164         TUint count( 0 );
       
   165         TInt pServiceId( 0 );
       
   166         TInt pSnap( 0 );
       
   167         TInt pIap( 0 );
       
   168 	    TBool pSnapLocked( EFalse );
       
   169         
       
   170         for ( TInt i( 0 ); i < properties.Count() &&
       
   171             count < KCCHMaxSubservicesCount; i++ )
       
   172             {
       
   173             propertyName = properties[ i ]->GetName();
       
   174             
       
   175             // Check is subservice valid
       
   176             TBool valid( EFalse );
       
   177             TRAPD( error, valid = ValidSubserviceL( aServiceId, propertyName ) );
       
   178             if ( KErrNone == error && valid )
       
   179                 {
       
   180     	        aService.iSubservices[ count ].iConnectionInfo.iServiceSelection.iType = 
       
   181                     propertyName == 
       
   182                         EPropertyVoIPSubServicePluginId ? ECCHVoIPSub : 
       
   183                     propertyName == 
       
   184                         EPropertyPresenceSubServicePluginId ? ECCHPresenceSub : 
       
   185                     propertyName == 
       
   186                         EPropertyIMSubServicePluginId ? ECCHIMSub : 
       
   187                     propertyName == 
       
   188                         EPropertyVMBXSubServicePluginId ? ECCHVMBxSub : 
       
   189                     ECCHUnknown;
       
   190                 
       
   191                 if ( ECCHUnknown != aService.iSubservices[ count ].iConnectionInfo.iServiceSelection.iType )
       
   192                     {
       
   193                     aService.iSubservices[ count ].iConnectionInfo.iServiceSelection.iServiceId = aServiceId;
       
   194                     aService.iSubservices[ count ].iState     = ECCHUninitialized;              
       
   195                     
       
   196                     GetSettingsIdL( aServiceId, 
       
   197                         aService.iSubservices[ count ].iConnectionInfo.iServiceSelection.iType, 
       
   198                         pServiceId );
       
   199                     aService.iSubservices[ count ].iSubserviceId = 
       
   200                         static_cast<TUint> ( pServiceId );
       
   201                     
       
   202                     GetSNAPIdL( aServiceId, 
       
   203                         aService.iSubservices[ count ].iConnectionInfo.iServiceSelection.iType, 
       
   204                         pSnap );
       
   205                     aService.iSubservices[ count ].iConnectionInfo.iSNAPId = 
       
   206                         static_cast<TUint32> ( pSnap );
       
   207                     
       
   208                     GetSNAPIdL( aServiceId, 
       
   209                         aService.iSubservices[ count ].iConnectionInfo.iServiceSelection.iType, 
       
   210                         pSnapLocked );
       
   211                     aService.iSubservices[ count ].iConnectionInfo.iSNAPLocked = 
       
   212                         static_cast<TUint32> ( pSnapLocked );
       
   213                     
       
   214                     GetIapIdL( aServiceId, 
       
   215                         aService.iSubservices[ count ].iConnectionInfo.iServiceSelection.iType, 
       
   216                         pIap );
       
   217                     aService.iSubservices[ count ].iConnectionInfo.iIapId  = 
       
   218                             static_cast<TUint32> ( pIap ); 
       
   219                         
       
   220                     count++;
       
   221                     }
       
   222                 }
       
   223             }    
       
   224         }    
       
   225     else
       
   226         {
       
   227         User::Leave( err );
       
   228         }
       
   229             
       
   230     CleanupStack::PopAndDestroy( entry );
       
   231     
       
   232     CCHLOGSTRING( "CCCHSPSHandler::GetServiceInfoL: OUT" );
       
   233     }
       
   234 
       
   235 // ---------------------------------------------------------------------------
       
   236 // CCCHSPSHandler::GetConnectivityPluginUidL
       
   237 // (other items were commented in a header).
       
   238 // ---------------------------------------------------------------------------
       
   239 //
       
   240 void CCCHSPSHandler::GetConnectivityPluginUidL( TUint32 aServiceId,
       
   241     TCCHSubserviceType aType, 
       
   242     TUid& aUid ) const
       
   243     {
       
   244     CCHLOGSTRING( "CCCHSPSHandler::GetConnectivityPluginUidL: IN" );
       
   245     CCHLOGSTRING2( "CCCHSPSHandler::GetConnectivityPluginUidL: aServiceId %d",
       
   246         aServiceId );
       
   247     CCHLOGSTRING2( "CCCHSPSHandler::GetConnectivityPluginUidL: aType %d",
       
   248         aType );
       
   249         
       
   250     TInt pUid( 0 );
       
   251     TInt error( KErrNone );
       
   252     TServicePropertyName propertyType( EPropertyUnknown ); 
       
   253     
       
   254     switch( aType )
       
   255         {        
       
   256         case ECCHVoIPSub:
       
   257             {
       
   258             propertyType = EPropertyVoIPSubServicePluginId;
       
   259             }
       
   260             break;
       
   261         case ECCHPresenceSub:
       
   262             {
       
   263             propertyType = EPropertyPresenceSubServicePluginId;
       
   264             }
       
   265             break;
       
   266         case ECCHIMSub:
       
   267             {
       
   268             propertyType = EPropertyIMSubServicePluginId;
       
   269             }
       
   270             break;
       
   271         case ECCHVMBxSub:
       
   272             {
       
   273             propertyType = EPropertyVMBXSubServicePluginId;
       
   274             }
       
   275             break;
       
   276         default:
       
   277             error = KErrNotFound;
       
   278             break;
       
   279         }
       
   280    
       
   281     if ( KErrNone == error )
       
   282         {
       
   283         CSPProperty* property = CSPProperty::NewLC();
       
   284         error = iSettings->FindPropertyL( aServiceId, 
       
   285             propertyType, *property );
       
   286             
       
   287         if ( KErrNone == error )
       
   288             {
       
   289             property->GetValue( pUid );
       
   290             // Convert TUint32 to TUid
       
   291             aUid = TUid::Uid( pUid );
       
   292             }
       
   293         else
       
   294             {
       
   295             CCHLOGSTRING2( "CCH: iSettings->FindPropertyL err: %d" , error );
       
   296             User::Leave( error );
       
   297             }
       
   298         CleanupStack::PopAndDestroy( property );
       
   299         }
       
   300         
       
   301     CCHLOGSTRING2( 
       
   302         "CCCHSPSHandler::GetConnectivityPluginUidL: aUid 0x%X", aUid );   
       
   303     }
       
   304 
       
   305 // ---------------------------------------------------------------------------
       
   306 // CCCHSPSHandler::GetSNAPIdL
       
   307 // (other items were commented in a header).
       
   308 // ---------------------------------------------------------------------------
       
   309 //
       
   310 void CCCHSPSHandler::GetSNAPIdL( TUint32 aServiceId,
       
   311     TCCHSubserviceType aType,
       
   312     TInt& aSNAPId ) const
       
   313     {
       
   314     CCHLOGSTRING( "CCCHSPSHandler::GetSNAPIdL: IN" );
       
   315     CCHLOGSTRING2( "CCCHSPSHandler::GetSNAPIdL: aServiceId %d", aServiceId );
       
   316     CCHLOGSTRING2( "CCCHSPSHandler::GetSNAPIdL: aType %d", aType );
       
   317     
       
   318     TSPItemType propertyType( EItemTypeNotDefined );
       
   319     TServicePropertyName propertyName( EPropertyUnknown );
       
   320     RPropertyArray subproperties;
       
   321     CleanupClosePushL( subproperties );
       
   322     
       
   323     ChangeToPropertyStyleL( aType, propertyType, propertyName );
       
   324        
       
   325     // Find correct subservice
       
   326     TInt err( iSettings->FindSubServicePropertiesL( 
       
   327         aServiceId, propertyType, subproperties ) );
       
   328     CCHLOGSTRING2( "CCH: iSettings->FindSubServicePropertiesL err: %d" , err );            
       
   329     for ( TInt i( 0 ); i < subproperties.Count(); i++ )
       
   330         {
       
   331         // Read subservice's SNAP Id
       
   332         if ( propertyName == subproperties[ i ]->GetName() )
       
   333             {                
       
   334             subproperties[ i ]->GetValue( aSNAPId );
       
   335             i = subproperties.Count();               
       
   336             }
       
   337         }    
       
   338     
       
   339     subproperties.ResetAndDestroy( );
       
   340     CleanupStack::PopAndDestroy( &subproperties );
       
   341     CCHLOGSTRING2( "CCCHSPSHandler::GetSNAPIdL: aSNAPId %d", aSNAPId );
       
   342     }
       
   343 
       
   344 // ---------------------------------------------------------------------------
       
   345 // CCCHSPSHandler::GetIapIdL
       
   346 // (other items were commented in a header).
       
   347 // ---------------------------------------------------------------------------
       
   348 //
       
   349 void CCCHSPSHandler::GetIapIdL( TUint32 aServiceId,
       
   350     TCCHSubserviceType aType,
       
   351     TInt& aIapId ) const
       
   352     {
       
   353     CCHLOGSTRING( "CCCHSPSHandler::GetIapIdL: IN" );
       
   354     CCHLOGSTRING2( "CCCHSPSHandler::GetIapIdL: aServiceId %d", aServiceId );
       
   355     CCHLOGSTRING2( "CCCHSPSHandler::GetIapIdL: aType %d", aType );
       
   356     
       
   357     TSPItemType propertyType( EItemTypeNotDefined );
       
   358     TServicePropertyName propertyName( EPropertyUnknown );
       
   359     RPropertyArray subproperties;
       
   360     CleanupClosePushL( subproperties );
       
   361     
       
   362     ChangeToPropertyStyleL( aType, propertyType, propertyName );
       
   363            
       
   364     // Find correct subservice
       
   365     TInt err( iSettings->FindSubServicePropertiesL( 
       
   366         aServiceId, propertyType, subproperties ) );
       
   367     CCHLOGSTRING2( "CCH: iSettings->FindSubServicePropertiesL err: %d" , err );
       
   368     for ( TInt i( 0 ); i < subproperties.Count(); i++ )
       
   369         {
       
   370         // Read subservice's IAP Id
       
   371         if ( propertyName == subproperties[ i ]->GetName() )
       
   372             {                
       
   373             subproperties[ i ]->GetValue( aIapId );
       
   374             i = subproperties.Count();               
       
   375             }
       
   376         }    
       
   377     
       
   378     subproperties.ResetAndDestroy( );
       
   379     CleanupStack::PopAndDestroy( &subproperties );
       
   380     CCHLOGSTRING2( "CCCHSPSHandler::GetIapIdL: aIapId %d", aIapId );    
       
   381     }
       
   382 
       
   383 // ---------------------------------------------------------------------------
       
   384 // CCCHSPSHandler::GetSettingsIdL
       
   385 // (other items were commented in a header).
       
   386 // ---------------------------------------------------------------------------
       
   387 //
       
   388 void CCCHSPSHandler::GetSettingsIdL( TUint32 aServiceId,
       
   389     TCCHSubserviceType aType,
       
   390     TInt& aId ) const
       
   391     {
       
   392     TSPItemType propertyType( EItemTypeNotDefined );
       
   393     TServicePropertyName propertyName( EPropertyUnknown );
       
   394     RPropertyArray subproperties;
       
   395     CleanupClosePushL( subproperties );
       
   396     
       
   397     ChangeToPropertyStyleL( aType, propertyType, propertyName );
       
   398            
       
   399     // Find correct subservice
       
   400     TInt err( iSettings->FindSubServicePropertiesL( 
       
   401         aServiceId, propertyType, subproperties ) );
       
   402     CCHLOGSTRING2( "CCH: iSettings->FindSubServicePropertiesL err: %d" , err );
       
   403     for ( TInt i( 0 ); i < subproperties.Count(); i++ )
       
   404         {
       
   405         // Read subservice's Id
       
   406         if ( propertyName == subproperties[ i ]->GetName() )
       
   407             {                
       
   408             TInt id( 0 );
       
   409             subproperties[ i ]->GetValue( id );
       
   410             aId = id;
       
   411             i = subproperties.Count();               
       
   412             }
       
   413         }    
       
   414     
       
   415     subproperties.ResetAndDestroy( );
       
   416     CleanupStack::PopAndDestroy( &subproperties );
       
   417     }
       
   418         
       
   419 // ---------------------------------------------------------------------------
       
   420 // CCCHSPSHandler::LoadAtStartUpL
       
   421 // (other items were commented in a header).
       
   422 // ---------------------------------------------------------------------------
       
   423 //
       
   424 void CCCHSPSHandler::LoadAtStartUpL( TUint32 aServiceId,
       
   425     TCCHSubserviceType aType,
       
   426     TBool& aEnabled ) const
       
   427     {
       
   428     
       
   429     TSPItemType propertyType( EItemTypeNotDefined );
       
   430     TServicePropertyName propertyName( EPropertyUnknown );
       
   431     RPropertyArray subproperties;
       
   432     CleanupClosePushL( subproperties );
       
   433     
       
   434     ChangeToPropertyStyleL( aType, propertyType, propertyName );
       
   435            
       
   436     // Find correct subservice
       
   437     TInt err( iSettings->FindSubServicePropertiesL( 
       
   438         aServiceId, propertyType, subproperties ) );
       
   439     CCHLOGSTRING2( "CCH: iSettings->FindSubServicePropertiesL err: %d" , err );
       
   440     for ( TInt i( 0 ); i < subproperties.Count(); i++ )
       
   441         {
       
   442         // Read subservice's On/Off information 
       
   443         if ( propertyName == subproperties[ i ]->GetName() )
       
   444             {
       
   445             TOnOff onOff( EOONotSet );                
       
   446             subproperties[ i ]->GetValue( onOff );
       
   447             aEnabled = onOff == EOn;
       
   448             i = subproperties.Count();               
       
   449             }
       
   450         }    
       
   451     subproperties.ResetAndDestroy( );
       
   452     CleanupStack::PopAndDestroy( &subproperties );
       
   453     }
       
   454 
       
   455 // ---------------------------------------------------------------------------
       
   456 // CCCHSPSHandler::SetLoadAtStartUpL
       
   457 // (other items were commented in a header).
       
   458 // ---------------------------------------------------------------------------
       
   459 //
       
   460 void CCCHSPSHandler::SetLoadAtStartUpL( const TUint32 aServiceId,
       
   461     const TCCHSubserviceType aType,
       
   462     const TBool aOnOff ) const
       
   463     {
       
   464        
       
   465     CCHLOGSTRING2( "CCCHSPSHandler::SetLoadAtStartUpL: aOnOff %d", aOnOff );   
       
   466     TSPItemType propertyType( EItemTypeNotDefined );
       
   467     TServicePropertyName propertyName( EPropertyUnknown );
       
   468     RPropertyArray subproperties;
       
   469     CleanupClosePushL( subproperties );
       
   470     
       
   471     TOnOff onOff( EOONotSet );
       
   472     onOff = aOnOff ? EOn : EOff;
       
   473     
       
   474     // Get property name
       
   475     ChangeToPropertyStyleL( aType, propertyType, propertyName );
       
   476    
       
   477     CSPProperty* propLoadAtStartUp = CSPProperty::NewLC();
       
   478     
       
   479     propLoadAtStartUp->SetName( propertyName );
       
   480     propLoadAtStartUp->SetValue( onOff );
       
   481     
       
   482     subproperties.Append( propLoadAtStartUp );
       
   483     CleanupStack::Pop( propLoadAtStartUp );
       
   484     TInt err( iSettings->AddOrUpdatePropertiesL( aServiceId, subproperties ) );
       
   485     CCHLOGSTRING2( "CCH: iSettings->AddOrUpdatePropertiesL err: %d" , err );
       
   486     subproperties.ResetAndDestroy();
       
   487     CleanupStack::PopAndDestroy( &subproperties );
       
   488     }
       
   489 
       
   490 // ---------------------------------------------------------------------------
       
   491 // CCCHSPSHandler::ChangeToPropertyStyleL
       
   492 // (other items were commented in a header).
       
   493 // ---------------------------------------------------------------------------
       
   494 //
       
   495 void CCCHSPSHandler::ChangeToPropertyStyleL( 
       
   496     TCCHSubserviceType aType,
       
   497     TSPItemType& aPropertyType,
       
   498     TServicePropertyName& aPropertyName ) const
       
   499     {
       
   500     switch( aType )
       
   501         {
       
   502         case ECCHVoIPSub:
       
   503             {
       
   504             aPropertyType = EItemTypeVoIPSubProperty;
       
   505             aPropertyName = ESubPropertyVoIPEnabled;
       
   506             }
       
   507             break;
       
   508         case ECCHPresenceSub:
       
   509             {
       
   510             aPropertyType = EItemTypePresenceSubProperty;
       
   511             aPropertyName = ESubPropertyPresenceEnabled;
       
   512             }
       
   513             break;
       
   514         case ECCHIMSub:
       
   515             {            
       
   516             aPropertyType = EItemTypeIMSubProperty;
       
   517             aPropertyName = ESubPropertyIMEnabled;
       
   518             }
       
   519             break;
       
   520         case ECCHVMBxSub:
       
   521             {
       
   522             aPropertyType = EItemTypeVMBXSubProperty;
       
   523             aPropertyName = ESubPropertyVMBXEnabled;
       
   524             }
       
   525             break;
       
   526         default:
       
   527             {
       
   528             User::Leave( KErrNotFound );
       
   529             }            
       
   530             break;
       
   531         }        
       
   532     }
       
   533 
       
   534 // ---------------------------------------------------------------------------
       
   535 // CCCHSPSHandler::ValidSubserviceL
       
   536 // (other items were commented in a header).
       
   537 // ---------------------------------------------------------------------------
       
   538 //
       
   539 TBool CCCHSPSHandler::ValidSubserviceL( 
       
   540     const TUint32 aServiceId,
       
   541     TServicePropertyName aPropertyName ) const
       
   542     {
       
   543     CCHLOGSTRING2
       
   544         ( "CCCHSPSHandler::ValidSubservice aServiceId: %d" , aServiceId );
       
   545         
       
   546     TBool valid( EFalse );
       
   547     TInt propertyId( KErrNone );
       
   548     
       
   549     CSPProperty* property = CSPProperty::NewLC();
       
   550     
       
   551     switch( aPropertyName )
       
   552         {
       
   553         case EPropertyVoIPSubServicePluginId:
       
   554             {
       
   555             CCHLOGSTRING( "Subservice: EPropertyVoIPSubServicePluginId" );
       
   556             
       
   557             // Until further notice VoIP property is always valid
       
   558             valid = ETrue;
       
   559             break;
       
   560             }
       
   561         case EPropertyPresenceSubServicePluginId:
       
   562             {
       
   563             CCHLOGSTRING( "Subservice: EPropertyPresenceSubServicePluginId" );
       
   564             
       
   565             valid = KErrNone != iSettings->FindPropertyL( aServiceId, 
       
   566                 ESubPropertyPresenceSettingsId, *property ) ? EFalse :
       
   567                     KErrNone == property->GetValue( propertyId );
       
   568                                 
       
   569             CCHLOGSTRING2( "CCH:     property id: %d" , propertyId );
       
   570             break;
       
   571             }
       
   572         case EPropertyIMSubServicePluginId:
       
   573             {
       
   574             CCHLOGSTRING( "Subservice: EPropertyIMSubServicePluginId" );
       
   575             
       
   576             // Until further notice IM property is always valid
       
   577             valid = ETrue;
       
   578             break;
       
   579             }
       
   580         case EPropertyVMBXSubServicePluginId:
       
   581             {
       
   582             CCHLOGSTRING( "Subservice: EPropertyVMBXSubServicePluginId" );
       
   583             
       
   584             valid = KErrNone != iSettings->FindPropertyL( aServiceId, 
       
   585                 ESubPropertyVMBXSettingsId, *property ) ? EFalse :
       
   586                     KErrNone == property->GetValue( propertyId );
       
   587             
       
   588             CCHLOGSTRING2( "CCH:     property id: %d" , propertyId );
       
   589             break;
       
   590             }
       
   591         default:
       
   592             {
       
   593             // Let other properties go through
       
   594             valid = ETrue;
       
   595             break;
       
   596             }
       
   597         }
       
   598     
       
   599     CleanupStack::PopAndDestroy( property );
       
   600     
       
   601     CCHLOGSTRING2
       
   602         ( "CCCHSPSHandler::ValidSubservice valid: %d" , valid );
       
   603                     
       
   604     return valid;        
       
   605     }
       
   606         
       
   607 // ========================== OTHER EXPORTED FUNCTIONS =======================
       
   608 
       
   609 //  End of File