コード例 #1
0
// ---------------------------------------------------------------------------
// Find service IDs with same properties
// ---------------------------------------------------------------------------
//
void CSPSettingsEngine::FindServiceIdsFromPropertiesL( const RPropertyArray& aPropertyArray, 
                                                       RIdArray& aServiceIds )
    {
    XSPSLOGSTRING( "CSPSettingsEngine::FindServiceIdsFromPropertiesL() - IN" );
    
    RArray<TInt> entryIds;
    CleanupClosePushL( entryIds );
    
    RIpAppPropArray array;
    TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
    CleanupStack::PushL( cleanup );
    
    // todo custom cleanup stack
    ConvertSpArrayToCenRepArrayL( aPropertyArray, array );  
    
    TInt err = iCenRepUtils->FindEntryIdsFromPropertiesL( array, entryIds );
    if( err == KErrNone )
        {
        TInt count = entryIds.Count();
        for( TInt i = 0; i < count; i++ )
            {
            TServiceId id = (TServiceId)entryIds[i];
            if( id != KSPDefaultVoIPServiceId )
                {
                User::LeaveIfError( aServiceIds.Append( id ) );
                }
            }
        }
        
    CleanupStack::PopAndDestroy( &array );
    CleanupStack::PopAndDestroy( &entryIds );
    
    XSPSLOGSTRING( "CSPSettingsEngine::FindServiceIdsFromPropertiesL() - OUT" );
    }
コード例 #2
0
// ---------------------------------------------------------------------------
// Update existing service provider settings entry
// ---------------------------------------------------------------------------
//
TInt CSPSettingsEngine::UpdateEntryL( const CSPEntry& aEntry )
    {
    XSPSLOGSTRING( "CSPSettingsEngine::UpdateEntry() - IN" );

    TServiceId serviceId( aEntry.GetServiceId() );

    // Leave if there is no service ID 
    if ( KSPNoId == serviceId || aEntry.GetServiceName().Length() == 0 )
        {
        User::Leave( KErrArgument );
        }

    // construct RIpAppPropArray
    RIpAppPropArray array;
    TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
    CleanupStack::PushL( cleanup );
    
    ConvertSpEntryToCenRepArrayL( aEntry, array );

    TInt err = iCenRepUtils->UpdateEntryL( (TInt) serviceId, array );
    
    CleanupStack::PopAndDestroy( &array );
    
    XSPSLOGSTRING( "CSPSettingsEngine::UpdateEntry() - OUT" );
    
    return err;
    }
コード例 #3
0
// ---------------------------------------------------------------------------
// Stores new service provider settings entry
// ---------------------------------------------------------------------------
//
void CSPSettingsEngine::AddEntryL( CSPEntry& aEntry )
    {
    XSPSLOGSTRING( "CSPSettingsEngine::AddEntryL() - IN" );
    
    // check the service name is not empty
    if( aEntry.GetServiceName().Length() == 0 )
        {
        User::LeaveIfError( KErrArgument );
        }

    // construct RIpAppPropArray
    RIpAppPropArray array;
    TCleanupItem cleanup( CSPSettingsEngine::CleanupPointerArray, &array );
    CleanupStack::PushL( cleanup );
    
    ConvertSpEntryToCenRepArrayL( aEntry, array );

    // Create new unique service ID
    TInt newId = 0;
    iCenRepUtils->AddEntryL( newId, array );
    aEntry.SetServiceId( newId );
    
    CleanupStack::PopAndDestroy( &array );
    
    XSPSLOGSTRING( "CSPSettingsEngine::AddEntryL() - OUT" );
    }
コード例 #4
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CSpsBackupHelperPerformer::ConstructL()
    {
    XSPSLOGSTRING( "CSpsBackupHelperPerformer::ConstructL IN" );
    iServiceProviderSettings = CSPSettings::NewL();
    
    XSPSLOGSTRING( "CSpsBackupHelperPerformer::ConstructL OUT" );
    }
コード例 #5
0
// ---------------------------------------------------------------------------
// Search service names by given service IDs
// ---------------------------------------------------------------------------
//
void CSPSettingsEngine::FindServiceNamesL( RIdArray& aServiceIds,
    CDesCArray& aServiceNames )
    {
    XSPSLOGSTRING( "CSPSettingsEngine::FindServiceNamesL() - IN" );
    
    CCenRepDatabaseProperty* property = CCenRepDatabaseProperty::NewLC();
    TInt count = aServiceIds.Count();
    for( TInt i = 0; i < count; i++ )
        {
        TInt id = ( TInt )aServiceIds[i];
        
        TInt err = iCenRepUtils->FindPropertyL( id, EServiceName, *property );
        if( err == KErrNone )
            {
            aServiceNames.AppendL( property->GetDesValue() );
            }
        else
            {
            aServiceIds.Remove( i ); // Remove non-existent ID
            count--;
            i--; // Do not increment index
            }
        }

    CleanupStack::PopAndDestroy( property );
    
    XSPSLOGSTRING( "CSPSettingsEngine::FindServiceNamesL() - OUT" );
    }
コード例 #6
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CSpsBackupHelperPerformer::ReadSettingsL()
    {
    XSPSLOGSTRING( "CSpsBackupHelperPerformer::ReadSettingsL IN" );
    RIdArray ids;
    CleanupClosePushL( ids );
    iServiceProviderSettings->FindServiceIdsL( ids );
    
    // Make sure that id's are in correct order!
    for( TInt i = 0; i < ids.Count(); i++ )
        {
        TRAP_IGNORE( 
            CSPEntry* entry = CSPEntry::NewLC();
            User::LeaveIfError( 
                iServiceProviderSettings->FindEntryL( ids[i], *entry ) );
            
            // Make sure that all properties are loaded
            entry->GetAllProperties(); 
            iEntries.AppendL( entry );
            CleanupStack::Pop( entry );
            )

        }
    
    XSPSLOGSTRING2( 
        "CSpsBackupHelperPerformer::ReadSettingsL Service count=%i", 
        iEntries.Count() );
    
    CleanupStack::PopAndDestroy( &ids );
    XSPSLOGSTRING( "CSpsBackupHelperPerformer::ReadSettingsL OUT" );
    }
コード例 #7
0
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
CSPSettingsEngine::~CSPSettingsEngine()
    {
    XSPSLOGSTRING( "CSPSettingsEngine::~CSPSettingsEngine() - IN" );
    
    delete iCenRepUtils;

    XSPSLOGSTRING( "CSPSettingsEngine::~CSPSettingsEngine() - OUT" );
    }
コード例 #8
0
// ---------------------------------------------------------------------------
// Destructor
// ---------------------------------------------------------------------------
//
EXPORT_C CSPSettingsVoIPUtils::~CSPSettingsVoIPUtils()
    {
    XSPSLOGSTRING( 
        "CSPSettingsVoIPUtils::~CSPSettingsVoIPUtils() - IN" );
    delete iSettingsEngine;
    XSPSLOGSTRING( 
        "CSPSettingsVoIPUtils::~CSPSettingsVoIPUtils() - OUT" );
    }
コード例 #9
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CSpsBackupHelperPerformer::ResetToFactorySettingsL()
    {
    XSPSLOGSTRING( "CSpsBackupHelperPerformer::ResetToFactorySettingsL IN" );
    // Ok if leave ( No service provider settings )
    CRepository* cenrep = CRepository::NewLC( KCRUidSPSettings );
    User::LeaveIfError( cenrep->Reset() );
    CleanupStack::PopAndDestroy( cenrep );
    XSPSLOGSTRING( "CSpsBackupHelperPerformer::ResetToFactorySettingsL OUT" );
    }
コード例 #10
0
// ---------------------------------------------------------------------------
// Rollback changes in repository.
// ---------------------------------------------------------------------------
//
void CSPSettingsEngine::RollbackTransaction()
    {
    XSPSLOGSTRING( 
        "CSPSettingsEngine::RollbackTransaction() - IN" );

    iCenRepUtils->RollbackTransaction();
    
    XSPSLOGSTRING( "CSPSettingsEngine::RollbackTransaction() - OUT" );

    }
コード例 #11
0
// ---------------------------------------------------------------------------
// Commits changes in repository.
// ---------------------------------------------------------------------------
//
TInt CSPSettingsEngine::CommitTransaction()
    {
    XSPSLOGSTRING( 
        "CSPSettingsEngine::CommitTransaction() - IN" );

    iCenRepUtils->CommitTransaction();
    
    XSPSLOGSTRING( "CSPSettingsEngine::CommitTransaction() - OUT" );

    return KErrNone;
    }
コード例 #12
0
// ---------------------------------------------------------------------------
// Begins transaction in repository.
// ---------------------------------------------------------------------------
//
TInt CSPSettingsEngine::BeginTransactionLC()
    {
    XSPSLOGSTRING( "CSPSettingsEngine::BeginTransaction() - IN" );

    iCenRepUtils->BeginTransactionL();
    
    XSPSLOGSTRING( "CSPSettingsEngine::BeginTransaction() - OUT" );
    
    return KErrNone;
    
    }
コード例 #13
0
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
//
void CSPSettingsEngine::ConstructL()
    {
    XSPSLOGSTRING( "CSPSettingsEngine::ConstructL() - IN" );
    
    iCenRepUtils = CCenRepDatabaseUtil::NewL( KCRUidSPSettings, 
                                            KSPStartKey,
                                            KSPColIncrement,         
                                            KSPColMask, 
                                            KServiceIdCounter,
                                            KSPColCount );

    XSPSLOGSTRING( "CSPSettingsEngine::ConstructL() - OUT" );
    }
コード例 #14
0
// ---------------------------------------------------------------------------
// IsVoIPSupported - API method
// Returns ETrue if following items are ON:
//      Common Voip (Feature Manager)
//      Dynamic VoIP (Telephony settings)
// ---------------------------------------------------------------------------
//
EXPORT_C TBool CSPSettingsVoIPUtils::IsVoIPSupported( ) const
    {
    XSPSLOGSTRING( "CSPSettingsVoIPUtils::IsVoIPSupported( ) - IN" );

    TBool voipSupport( EFalse );
    TRAPD( err, voipSupport = IsVoIPSupportedL() );
    
    if ( err != KErrNone )
        {
        voipSupport = EFalse;
        }

    XSPSLOGSTRING( "CSPSettingsVoIPUtils::IsVoIPSupported( ) - OUT" );
    return voipSupport;
    }
コード例 #15
0
// ---------------------------------------------------------------------------
// Get Preferred Service - Actual implementation
// ---------------------------------------------------------------------------
//
void CSPSettingsVoIPUtils::DoGetPreferredServiceL( 
    TUint& aServiceId ) const
    {
    XSPSLOGSTRING( 
        "CSPSettingsVoIPUtils::DoGetPreferredServiceL() - IN" );
    
    if ( !IsVoIPSupportedL() )
        {
        // Voip not supported
        User::Leave( KErrNotSupported );
        }
    
    // Get the preferred service id
    CRepository* repository = CRepository::NewLC( KCRUidRichCallSettings );
    TInt value(0);
    User::LeaveIfError( repository->Get( KRCSPSPreferredService, value ) );
    CleanupStack::PopAndDestroy( repository );
    
    
    XSPSLOGSTRING2( 
        "CSPSettingsVoIPUtils::DoGetPreferredServiceL() service:%d",value );
    if ( 0 == value )
        {
        // Preferred service not setted.
        User::Leave( KErrNotFound );
        }

    aServiceId = value;
    }
コード例 #16
0
// ---------------------------------------------------------------------------
// Returns count of stored service provider settings entries
// ---------------------------------------------------------------------------
//
TInt CSPSettingsEngine::SettingsCountL()
    {
    XSPSLOGSTRING( "CSPSettingsEngine::SettingsCount() - IN" );

    TInt result( 0 );

    TInt err = iCenRepUtils->EntryCountL( result );
    
    if( err == KErrNone )
        {
        if( result >= KSPPredefinedCount )
            {
            result--;
            }
        err = result;
        }
    else
        {
        err = 0;
        }
    
    XSPSLOGSTRING2( "CSPSettingsEngine::SettingsCount(%d) - OUT", result );

    return err;
    }
コード例 #17
0
// ---------------------------------------------------------------------------
// Deletes service properties
// ---------------------------------------------------------------------------
//
TInt CSPSettingsEngine::DeleteServicePropertiesL( TServiceId aServiceId,
                                                  const RPropertyNameArray& aNameArray  )
    {
    XSPSLOGSTRING2( 
        "CSPSettingsEngine::FindSubServicePropertyL( %d ) - IN", aServiceId );

    RArray<TUint32> nameArray;
    CleanupClosePushL( nameArray );
    TInt count = aNameArray.Count();
    
    for( TInt i = 0; i < count; i++ )
        {
        TUint32 name = (TUint32)( aNameArray[i] );
        User::LeaveIfError( nameArray.Append( name ) );
        }
        
    TInt id = (TInt)aServiceId;
    TInt err = iCenRepUtils->DeletePropertiesL( id, nameArray );
    
    CleanupStack::PopAndDestroy( &nameArray );
    
    XSPSLOGSTRING( "CSPSettingsEngine::FindSubServicePropertyL() - OUT" );
    
    return err;
    }
コード例 #18
0
// ---------------------------------------------------------------------------
// Get id of the preferred service
// ---------------------------------------------------------------------------
//
EXPORT_C TInt CSPSettingsVoIPUtils::GetPreferredService( TUint& aServiceId )
    const
    {
    XSPSLOGSTRING( 
        "CSPSettingsVoIPUtils::GetPreferredService() - IN" );

    TRAPD( error, DoGetPreferredServiceL( aServiceId ) );
    return error;
    }
コード例 #19
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CSpsBackupHelperPerformer::SetNextFreeServiceIdL( TInt aServiceId )
    {
    XSPSLOGSTRING2( "CSpsBackupHelperPerformer::SetNextFreeServiceIdL IN, %i", aServiceId );
    CRepository* cenrep = CRepository::NewLC( KCRUidSPSettings );
    
    User::LeaveIfError( cenrep->Set( KServiceIdCounter, aServiceId ) );
    
    CleanupStack::PopAndDestroy( cenrep );
    XSPSLOGSTRING( "CSpsBackupHelperPerformer::SetNextFreeServiceIdL OUT" );
    }
コード例 #20
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
TInt CSpsBackupHelperPerformer::NextFreeServiceIdL()
    {
    XSPSLOGSTRING( "CSpsBackupHelperPerformer::NextFreeServiceIdL IN" );
    TInt ret(0);
    CRepository* cenrep = CRepository::NewLC( KCRUidSPSettings );
    
    User::LeaveIfError( cenrep->Get( KServiceIdCounter, ret ) );
    
    CleanupStack::PopAndDestroy( cenrep );
    XSPSLOGSTRING2( "CSpsBackupHelperPerformer::NextFreeServiceIdL OUT, %i", ret );
    return ret;
    }
コード例 #21
0
// ---------------------------------------------------------------------------
// VoIPProfilesExistL - API method
// Returns ETrue if VoIP sub service plugin ID have been set for some service.
// ---------------------------------------------------------------------------
//
EXPORT_C TBool CSPSettingsVoIPUtils::VoIPProfilesExistL() const
    {
    XSPSLOGSTRING( 
        "CSPSettingsVoIPUtils::VoIPProfilesExistL() - IN" );

    TBool profileExists( EFalse );

    // Get all service IDs
    RArray<TServiceId> services;
    CleanupClosePushL( services );
    iSettingsEngine->FindServiceIdsL( services );
    const TInt count( services.Count() );

    // Check if some service has VoIP sub service plug-in ID
    TInt err( 0 );
    CSPProperty* property = CSPProperty::NewLC();
    for( TInt i = 0; i < count && !profileExists; ++i )
        {
        TServiceId id = services[ i ];
        if( id == KSPDefaultVoIPServiceId )
            {
            continue;
            }
            
        err = iSettingsEngine->FindPropertyL( id,
                                              EPropertyVoIPSubServicePluginId,
                                              *property );

        profileExists = ( KErrNone == err ? ETrue : EFalse );
        }

    CleanupStack::PopAndDestroy( property );
    CleanupStack::PopAndDestroy( &services );


    XSPSLOGSTRING( 
        "CSPSettingsVoIPUtils::VoIPProfilesExistL() - OUT" );
    return profileExists;
    }
コード例 #22
0
// ---------------------------------------------------------------------------
// IsPreferredTelephonyVoIP - API method
// Returns ETrue if following items are ON:
//      Common Voip (Feature Manager)
//      Dynamic VoIP (Telephony settings)
//      Preferred telephony (Rich call settings)
//  + there is at least one SIP-VoIP profile stored
// ---------------------------------------------------------------------------
//
EXPORT_C TBool CSPSettingsVoIPUtils::IsPreferredTelephonyVoIP() const
    {
    XSPSLOGSTRING( 
        "CSPSettingsVoIPUtils::IsPreferredTelephonyVoIP() - IN" );

    // Check that VoIP is supported
    TBool voipSupported( IsVoIPSupported() );
    
    XSPSLOGSTRING2( 
        "CSPSettingsVoIPUtils::VoipSupported: %d",voipSupported );

    // Check the preferred telephony
    TBool voipPreferred( EFalse );
    TRAP_IGNORE( voipPreferred = IsPreferredTelephonyVoIPL() );
    
    XSPSLOGSTRING2( 
        "CSPSettingsVoIPUtils::VoipPreferred: %d", voipPreferred );

    XSPSLOGSTRING( 
        "CSPSettingsVoIPUtils::IsPreferredTelephonyVoIP() - OUT" );
    return voipPreferred && voipSupported;
    }
コード例 #23
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CSpsBackupHelperPerformer::FinalizeRestoreL()
    {
    XSPSLOGSTRING( "CSpsBackupHelperPerformer::FinalizeRestoreL IN" );
    
    // Determine how many settings exists after factory settings
    TUint nextFreeServiceId = NextFreeServiceIdL();
    
    // Restore old settings
    // Make sure that id's are in correct order!
    for( TInt i = 0; i < iEntries.Count(); i++ )
        {
        // Start inputting restored settings from next free serviceid
        if( iEntries[i]->GetServiceId() == nextFreeServiceId )
            {
            // Service id to be inserver is same as next free serviceid
            nextFreeServiceId = iEntries[i]->GetServiceId();
            iServiceProviderSettings->AddEntryL( *iEntries[i] );
            nextFreeServiceId++; // Entry added
            }
        else if( iEntries[i]->GetServiceId() > nextFreeServiceId )
            {
            // Change inserted service id when service id is larger
            // than current service count.
            // This is done since backed up settings can be non linear
            SetNextFreeServiceIdL( iEntries[i]->GetServiceId() );
            nextFreeServiceId = iEntries[i]->GetServiceId();
            iServiceProviderSettings->AddEntryL( *iEntries[i] );
            nextFreeServiceId++; // Entry added
            }
        
        }
    
    XSPSLOGSTRING2( 
        "CSpsBackupHelperPerformer::FinalizeRestoreL Next free serviceid=%i", 
        nextFreeServiceId );
    
    XSPSLOGSTRING( "CSpsBackupHelperPerformer::FinalizeRestoreL OUT" );
    }
コード例 #24
0
// ---------------------------------------------------------------------------
// Search stored service IDs of service provider settings entries
// ---------------------------------------------------------------------------
//
TInt CSPSettingsEngine::FindServiceIdsL( RIdArray& aServiceIds )
    {
    XSPSLOGSTRING( "CSPSettingsEngine::FindServiceIdsL() - IN" );

    RArray<TInt> cenrepArray;
    CleanupClosePushL( cenrepArray );
    
    TInt err = iCenRepUtils->FindEntryIdsL( cenrepArray );
    
    for( TInt i = 0; i < cenrepArray.Count(); i++ )
        {
        TServiceId id = (TServiceId)cenrepArray[i];
        if( id != KSPDefaultVoIPServiceId )
            {
            User::LeaveIfError( aServiceIds.Append( id ));
            }
        }

    CleanupStack::PopAndDestroy( &cenrepArray );
    
    XSPSLOGSTRING( "CSPSettingsEngine::FindServiceIdsL() - OUT" );
    
    return err;
    }
コード例 #25
0
// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
TInt CSPSettingsEngine::FindSubServicePropertiesL( TServiceId aServiceId, 
    TSPItemType aPropertyType,
    RPropertyArray& aPropertyArray )
    {
    XSPSLOGSTRING2( 
        "CSPSettingsEngine::FindSubServicePropertiesL( %d ) - IN", aServiceId );

    RPropertyNameArray nameArray;
    CleanupClosePushL( nameArray );
    
    PropertyNameArrayFromItemTypeL( aPropertyType, nameArray );
    TInt count = nameArray.Count();
    TInt id = (TInt) aServiceId;
    
    CCenRepDatabaseProperty* property = CCenRepDatabaseProperty::NewLC();
    
    for( TInt i = 0; i < count; i++ )
        {
        TUint32 name = nameArray[i];
        TInt err = iCenRepUtils->FindPropertyL( id, name, *property );
        if( err == KErrNone )
            {
            CSPProperty* spProperty = CSPProperty::NewLC();
            User::LeaveIfError( spProperty->SetName( (TServicePropertyName)(property->GetName())) );
            User::LeaveIfError( spProperty->SetValue( property->GetDesValue() ));
            
            User::LeaveIfError( aPropertyArray.Append( spProperty ));
            CleanupStack::Pop( spProperty );
            }
        }
        
    CleanupStack::PopAndDestroy( property );
    CleanupStack::PopAndDestroy( &nameArray );
    
    XSPSLOGSTRING( "CSPSettingsEngine::FindSubServicePropertiesL() - OUT" );
    
    return KErrNone;
    }
コード例 #26
0
// ---------------------------------------------------------------------------
// Check feature is supported or not
// ---------------------------------------------------------------------------
//
TBool CSPSettingsEngine::IsFeatureSupportedL( TSPServiceFeature aFeature,
                                              TBool aWriteAllowed )
    {
    XSPSLOGSTRING( "CSPSettingsEngine::IsFeatureSupportedL() - IN" );

    TBool ret = EFalse;
    
    // First check P&S key, if P&S key is defined, use the value from P&S key.
    // if not defined, then walk through all the sevices and check there is any service match
    TInt mask = 0;
    TInt value = 0;
    TInt psFlag = 0;
    TInt retProperty = 0;
    
    switch( aFeature )
        {
        case ESupportInternetCallFeature:
            {
            retProperty = RProperty::Get( KUidSystemCategory, KSPSupportInternetCallKey, psFlag );
            if( retProperty == KErrNone && psFlag != KSPInitFeatureValue )
                {
                ret = psFlag;
                }
            else
                {
                mask = ESupportsInternetCall | ESupportsAlphanumericAddressing | EIsVisibleInCallMenu;
                value = mask;
                ret = CheckFeatureL( mask, value );
                if ( aWriteAllowed )
                    {                   
                    User::LeaveIfError( RProperty::Set( KUidSystemCategory, 
                        KSPSupportInternetCallKey, ret ) );
                    }
                }
            
            break;
            }
        case ESupportCallOutFeature:
            {
            retProperty = RProperty::Get( KUidSystemCategory, KSPSupportCallOutKey, psFlag );
            if( retProperty == KErrNone && psFlag != KSPInitFeatureValue )
                {
                ret = psFlag;
                }
            else
                {
                mask = ESupportsInternetCall | ESupportsMSISDNAddressing | EIsVisibleInCallMenu;
                value = mask;
                ret = CheckFeatureL( mask, value );
                if ( aWriteAllowed )
                    {                   
                    User::LeaveIfError( RProperty::Set( 
                        KUidSystemCategory, 
                        KSPSupportCallOutKey, ret ) );
                    }
                }
            break;
            }
        
        case ESupportVoIPSSFeature:
            {
            retProperty = RProperty::Get( KUidSystemCategory, KSPSupportVoIPSSKey, psFlag );
            if( retProperty == KErrNone && psFlag != KSPInitFeatureValue )
                {
                ret = psFlag;
                }
            else
                {
                mask = ESupportVoIPSS;
                value = mask;
                ret = CheckFeatureL( mask, value );
                if ( aWriteAllowed )
                    {                   
                    User::LeaveIfError( RProperty::Set( 
                        KUidSystemCategory, 
                        KSPSupportVoIPSSKey, ret ) );
                    }
                }
            break;
            }
        
        case ESupportVoIPFeature:
            {
            TBool bFeatureMgr = EFalse;
            TBool bDynVoIP = EFalse;
            TBool bSubVoIP = EFalse;
            
            //check FeatureManager
            FeatureManager::InitializeLibL();
            bFeatureMgr = FeatureManager::FeatureSupported( KFeatureIdCommonVoip );
            FeatureManager::UnInitializeLib();
            
            //check dynamic voip flag
            CRepository* repository = CRepository::NewLC( KCRUidTelephonySettings );
            TInt value = 0;
            TInt err = repository->Get( KDynamicVoIP, value );
            if( value != 0 )
                {
                bDynVoIP = ETrue;
                }
            
            CleanupStack::PopAndDestroy( repository );
            
            //check subservice voip
            RIdArray serviceIds;
            CleanupClosePushL( serviceIds );
            FindServiceIdsL( serviceIds );
            CSPProperty* property = CSPProperty::NewLC();
            
            for( TInt i = 0; i < serviceIds.Count(); i++ )
                {
                TServiceId serviceId = serviceIds[i];
                TInt retProperty = FindPropertyL( serviceId, EPropertyVoIPSubServicePluginId, *property );
                if( retProperty == KErrNone )
                    {
                    bSubVoIP = ETrue;
                    break;
                    }
                }
            CleanupStack::PopAndDestroy( property );
            CleanupStack::PopAndDestroy( &serviceIds );
            
            ret = bFeatureMgr && bDynVoIP && bSubVoIP;
            
            break;
            }
        default:
            {
            User::Leave( KErrNotSupported );        
            }
        }
    
    XSPSLOGSTRING( "CSPSettingsEngine::IsFeatureSupportedL() - OUT" );

    return ret;
    }
コード例 #27
0
// ---------------------------------------------------------------------------
// Constructor
// ---------------------------------------------------------------------------
//
void CSPSettingsVoIPUtils::ConstructL()
    {
    XSPSLOGSTRING( "CSPSettingsVoIPUtils::ConstructL() - IN" );
    iSettingsEngine = CSPSettingsEngine::NewL();
    XSPSLOGSTRING( "CSPSettingsVoIPUtils::ConstructL() - OUT" );
    }