Exemple #1
0
/**
    Setup dir structure for testing and verifying functional results
    @param	datastr			data structure to setup directory
    @param  iOperation   	Operation to be performed 
    @param  SrcDrive		Source drive
    @param	Targetdrive		Target drive input
    @panic					if data structure definition is incorrect
*/
void SetupDirFiles(const TDesC& aPath, const TDirSetupFiles& aDirFiles)
	{
	TFileName path = aPath;
	if (path.Length() == 0)
		{
		test.Printf(_L("ERROR<SetupDirFiles()>: Zero length src path!\n"));
		test(EFalse);
		}
	
	MakeDir(path);
	
	RArray<TInt> addBlockDataArray;
	RArray<TInt> deductBlockDataArray;
	
	ParsingDirDataBlock(aDirFiles.iAddingBlock, addBlockDataArray);
	ParsingDirDataBlock(aDirFiles.iDeductBlock, deductBlockDataArray);
	
	if (addBlockDataArray.Count() == 0)
	// empty dir setup
		{
		return;
		}
	for (TInt i = 0; i < deductBlockDataArray.Count(); ++i)
		{
		TInt idxToDelete = addBlockDataArray.FindInOrder(deductBlockDataArray[i]);
		if (idxToDelete >= 0)
			{
			addBlockDataArray.Remove(idxToDelete);
			}
		else if (idxToDelete == KErrNotFound)
			{
			continue;
			}
		else
			{
			test.Printf(_L("ERROR<<SetupDir>>: wrong dir data setup! err=%d\n"), idxToDelete);
			test(EFalse);
			}
		}
	if (addBlockDataArray.Count() > 0)
		{
		for (TInt i = 0; i < addBlockDataArray.Count(); ++i)
			{
			TInt idx = addBlockDataArray[i];
			path = aPath;
			path += gDirPatterns[idx];
			if (path[path.Length() - 1] == '\\')
				{
				MakeDir(path);
				}
			else
				{
				MakeFile(path, _L8("blahblah"));
				}
			}
		}
	
	addBlockDataArray.Reset();
	deductBlockDataArray.Reset();
	}
Exemple #2
0
// Get phonebook list
EXPORT_C TInt CContactSyncChecker::PhonebookListL(RArray<TUid>& aPhonebookList)
	{
	CContactSyncData* temp = CContactSyncData::NewL();
	CleanupStack::PushL(temp);
	CContactSyncData& settings = temp->DataL();
	RPointerArray<CContactSyncPhonebookData>& perPhbkData = settings.PerPhonebookData();
	const TInt phbkCount = perPhbkData.Count();
	TInt ret = KErrNone;
	if (phbkCount == 0)
		{
		// too early - the phonebook list has not been set
		ret = KErrNotReady;
		}
		else
		{
		// copy/create phonebook list
		aPhonebookList.Reset();
		for (TInt k = 0; k < phbkCount; ++k)
			{
			if (aPhonebookList.Append(perPhbkData[k]->PhonebookUid()) != KErrNone)
				{
				// error
				aPhonebookList.Reset();
				ret = KErrNoMemory;
				break;
				}
			}
			
		}
	CleanupStack::PopAndDestroy(temp);		
	return ret;
	}
// ---------------------------------------------------------------------------
// Sets available IAPs of this type as available in CommsDat cache
// ---------------------------------------------------------------------------
//
void TConnMonBearerWLAN::FlagAvailableIaps() const
    {
    LOGENTRFN("TConnMonBearerWLAN::FlagAvailableIaps()")

    RArray<TUint> availableIdArray;
    RArray<TUint> activeIdArray;

    iConnMonIAP->GetActiveConnectionsIds( EBearerIdWLAN, activeIdArray );

    if ( activeIdArray.Count() == 0 )
        {
        iConnMonIAP->AppendAvailableWLANIaps( availableIdArray );
        }
    else
        {
        LOGIT1("Found %d active WLAN IAPs", activeIdArray.Count())

        // Policy based roaming. If current WLAN connection RSS (received
        // signal strength) is not strong enough, don't give any WLAN IAPs in
        // available state.
        if ( iConnMonIAP->WlanRssGoodEnough() )
            {
            // KErrDisconnected will be returned if request for used SSID from WLAN engine fails.
            TInt err = iConnMonIAP->AppendAvailableWLANIapsBySsid( availableIdArray );
            if ( err != KErrNone )
                {
                availableIdArray.Reset();
                if ( err == KErrDisconnected )
                    {
                    activeIdArray.Reset(); // No longer connected.
                    iConnMonIAP->AppendAvailableWLANIaps( availableIdArray );
                    }
                }
            }
        else
            {
            // Current WLAN RSS is too weak, don't report any WLAN IAPs available.
            availableIdArray.Reset();
            activeIdArray.Reset();
            }
        }

    for ( TInt i = 0; i < availableIdArray.Count(); i++ )
        {
        iCommsDatCache->SetAvailableIapWithId( availableIdArray[i] );
        }
    for ( TInt i = 0; i < activeIdArray.Count(); i++ )
        {
        // This will only add EasyWLAN IAP ID as available in those cases when
        // the connection was started with it. This is done so there can't be a
        // situation when a connection is up but ConnMon reports that
        // connections IAP as unavailable. (EasyWLAN IAP has empty SSID field in
        // CommsDat, so AppendAvailableWLANIapsBySsid-method will not find it).
        iCommsDatCache->SetAvailableIapWithId( activeIdArray[i] );
        }

    availableIdArray.Close();
    activeIdArray.Close();
    LOGEXITFN("TConnMonBearerWLAN::FlagAvailableIaps()")
    }
EXPORT_C void PlayerApplicationSettingsResourceInit::DefineAttributesL(MPlayerApplicationSettingsObserver& aSettings,
																CResourceFile& aResourceFile)
	{
	// Read the settings from the resource file
	RResourceReader reader;
	reader.OpenLC(&aResourceFile, KAVRCPResourceId);
	
	// Check the version of this resource file
	TUint16 formatVersion = reader.ReadUint16L();
	if (formatVersion != KAVRCPFormatVersion)
		{
		reader.Close();
		User::Leave(KErrCorrupt);
		}
	
	// Find out how many settings this resource file contains
	TInt settingsCount = reader.ReadUint16L();
	if (settingsCount < 0)
		{
		reader.Close();
		User::Leave(KErrCorrupt);
		}

	// read the settings from aResource
	RArray<TUint> values;
	RArray<TPtrC8> valueTexts;
	CleanupClosePushL(values);
 	CleanupClosePushL(valueTexts);

	// Read each AVRCP attribute setting in turn
	for (int i = 0; i < settingsCount; i++)
		{
		values.Reset();
		valueTexts.Reset();
		
		// Read attribute, description text, initial value and defined values
		TUint attributeID(reader.ReadUint8L());
		TUint initialValue(reader.ReadUint8L());
		TPtrC8 attributeText(reader.ReadTPtrC8L());
		TInt valuesCount(reader.ReadUint16L());

		for (int j = 0; j < valuesCount; j++)
			{
			TUint thisValue = reader.ReadUint8L();
			TPtrC8 thisDescription = reader.ReadTPtrC8L();
			
			values.AppendL(thisValue);
			valueTexts.AppendL(thisDescription);
			}
		
		// Now define this attribute, then continue to next attribute
		aSettings.DefineAttributeL(attributeID, attributeText, values, valueTexts, initialValue);
		}
	// cleaning up values and valueTexts
	 CleanupStack::PopAndDestroy(3); // values, valueTexts, reader
	}
TInt CTestHistoryLog::AddMoreThanFiveJobsL( CStifItemParser& /*aItem*/ )
	{
	for (TInt i = 0; i < KMaxMsgSize; i++)
		{
		RArray<TInt> tasks;
		tasks.Append(KTaskId1);
		tasks.Append(KTaskId2);
	
		CSyncMLHistoryJob * entry = CSyncMLHistoryJob::NewL(i, tasks );
		CleanupStack::PushL(entry);
	
		tasks.Reset();
		tasks.Close();

		iHistoryArray->AppendEntryL(entry);

	if (iOwnerShip)
		{
		CleanupStack::Pop(entry);
		}
	else
		{
		CleanupStack::PopAndDestroy(entry);
		}
		}
	TL(iHistoryArray->Count() == KMaxMsgSize);
	
	return KErrNone;
	}
TInt CTestHistoryLog::AddNewJobEntryL( CStifItemParser& /*aItem*/ )
	{
	TInt arrayCount = iHistoryArray->Count() + 1;
	TInt profileId(1);	
	RArray<TInt> tasks;
	tasks.Append(KTaskId1);
	tasks.Append(KTaskId2);
	
	CSyncMLHistoryJob * entry = CSyncMLHistoryJob::NewL(profileId, tasks );
	CleanupStack::PushL(entry);
	
	tasks.Reset();
	tasks.Close();

	iHistoryArray->AppendEntryL(entry);
	
	TL(iHistoryArray->Count() == arrayCount);
	
	if (iOwnerShip)
		{
		CleanupStack::Pop(entry);
		}
	else
		{
		CleanupStack::PopAndDestroy(entry);		
		}	
	return KErrNone;
	}
// ---------------------------------------------------------
// Store input language to Repository
// ---------------------------------------------------------
//
void CGSPenInputModel::SetInputLanguageL()
    {
    RArray<TInt> languageCodeArray;
    iPtiEngine->GetAvailableLanguagesL(languageCodeArray);
 
    const TInt count = languageCodeArray.Count();
 
    if (iLanguageIndex <= count)
        {
        iInputLanguage = languageCodeArray[iLanguageIndex];
        iAknfepRepository->Set(KAknFepInputTxtLang, iInputLanguage);    
        }

    languageCodeArray.Reset();
    languageCodeArray.Close();    

    // Remember which chinese language variant was used 
    // for the chinese find method setting
    TUint key = ChineseFindMethodCRKey();
    if(key != iLastChineseFindMethodItem)
        {
        iAknRepository->Set(KAknAdaptiveSearchLastChinese, (int)key);
        iLastChineseFindMethodItem = key;
        }
    }
/**
  Function : ExecuteActionL
  Description : Entry point for the this test action in the test framework
  @internalTechnology
  @param : none
  @return : void
  @pre none 
  @post none
*/
void CMtfTestActionCountImapAccountsInArray::ExecuteActionL()
{
	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionCountImapAccountsInArray);
	TInt numberToMatch = ObtainValueParameterL<TInt>(TestCase(), ActionParameters().Parameter(0));
	
	CEmailAccounts *account = CEmailAccounts::NewLC();	
	RArray<TImapAccount> arrayImapAccounts;
	account->GetImapAccountsL(arrayImapAccounts);
	TInt count = arrayImapAccounts.Count();
	
	CleanupStack::PopAndDestroy(account);
	arrayImapAccounts.Reset();
	
	if (count != numberToMatch)
	{
		// failed
		TestCase().ERR_PRINTF3(_L("Number of IMAP accounts do not match ! expected = %d actual = %d"), 
								  numberToMatch, count );
		TestCase().SetTestStepResult(EFail);
	}
	TestCase().INFO_PRINTF2(_L("Number of IMAP accounts matched value = %d !"), numberToMatch );	
	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionCountImapAccountsInArray);
	TestCase().ActionCompletedL(*this);
	
}
/*
HELPER:
Initializes the TLSProvider
*/
TVerdict CTlsProvTestActive::InitProviderL(CTLSProvider*& aPtrProvider,CTLSSession*& /*aPtrSession*/,
									  CTlsCryptoAttributes*& aTlsCryptoAttributes,
									  TBool aIsTls, TBool aIsExport,CTlsProvStep* aStep)
	{
	RArray<TTLSCipherSuite> UserCipherSuiteList;
	if(!aPtrProvider)
		aPtrProvider = CTLSProvider::ConnectL();

	//Obtain the list of ciphersuites
	iStatus = KRequestPending;
	aPtrProvider->CipherSuitesL(UserCipherSuiteList,iStatus);	
	SetActive();
	CActiveScheduler::Start();

	TInt SelectedCiphers = UserCipherSuiteList.Count();
	if(SelectedCiphers != KSupportedCipherCount) 
		{
		return EFail;			
		}

	
	aTlsCryptoAttributes = aPtrProvider->Attributes();
	if(aIsTls)
		ConfigureTLS(aIsExport,aStep);
	else
		ConfigureSSL(aIsExport,aStep);

	HBufC8* SrvCertificate;
	ReadTestDataL(aTlsCryptoAttributes, SrvCertificate,aStep);
	delete SrvCertificate;
	aTlsCryptoAttributes->iPublicKeyParams->iKeyType = ERsa;
	UserCipherSuiteList.Reset();
	return EPass;
	
	}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//
void PosLmLandmarkHandler::RemoveNonExistingCategoriesL(
    CPosLmLocalDbAccess& aDbAccess,
    RArray<TPosLmItemId>& aCategoryIdArray)
    {
    RArray<TPosLmItemId> categoriesInDatabase;
    CleanupClosePushL(categoriesInDatabase);

    PosLmCategoryHandler::GetAllCategoryIdsL(aDbAccess,
        CPosLmCategoryManager::ECategorySortOrderNone, categoriesInDatabase);

    if (categoriesInDatabase.Count() == 0)
        {
        aCategoryIdArray.Reset();
        }

    for (TInt i = 0; i < aCategoryIdArray.Count();)
        {
        if (categoriesInDatabase.Find(aCategoryIdArray[i]) == KErrNotFound)
            {
            aCategoryIdArray.Remove(i);
            }
        else
            {
            i++;
            }
        }

    CleanupStack::PopAndDestroy(&categoriesInDatabase);
    }
void UT_CIceValidList::UT_CICEValidList_HasPairForComponentsL()
    {
    RArray<TUint> components;
    CleanupClosePushL( components );
    
    components.AppendL( 5 );
    EUNIT_ASSERT( 
        EFalse == iValidList->HasPairForComponents( components ) );
    
    UT_CICEValidList_AddValidPairLL();
    EUNIT_ASSERT( 
        EFalse == iValidList->HasPairForComponents( components ) );
    components.AppendL( KComponentIdRtp );
    EUNIT_ASSERT( 
        EFalse == iValidList->HasPairForComponents( components ) );
    components.Remove( 0 );
    EUNIT_ASSERT( 
        ETrue == iValidList->HasPairForComponents( components ) );
    
    components.Reset();
    EUNIT_ASSERT_PANIC( 
        iValidList->HasPairForComponents( components ), "USER", 0 );
    
    CleanupStack::PopAndDestroy( &components );
    }
/**
doTestStepL()
Reads the expected count from the ini file.
Obtains the count of the POP accounts created and compares against the expected number.

@return
Returns the test step result.
*/
TVerdict CT_MsgVerifyPopAccountsCount::doTestStepL()
	{
	INFO_PRINTF1(_L("Test Step: Verify Pop Accounts Count"));
	TInt expectedCount = -1;
	if(!GetIntFromConfig(ConfigSection(), KExpectedCount, expectedCount) && expectedCount < 0)
		{
		ERR_PRINTF1(_L("ExpectedCount is not Specified or < 0"));
		SetTestStepResult(EFail);
		}
	else
		{
		CEmailAccounts *account = CEmailAccounts::NewLC();	
		RArray<TPopAccount> arrayPopAccounts;
		account->GetPopAccountsL(arrayPopAccounts);
		TInt count = arrayPopAccounts.Count();
		
		CleanupStack::PopAndDestroy(account);
		arrayPopAccounts.Reset();
		
		if (count != expectedCount)
			{
			ERR_PRINTF3(_L("Number of POP accounts do not match ! expected = %d actual = %d"), 
									  expectedCount, count);
			SetTestStepResult(EFail);
			}
		else
			{
			INFO_PRINTF2(_L("Number of POP accounts matched value = %d !"), expectedCount);	
			}			
		}
	return TestStepResult();
	}
// ---------------------------------------------------------------------------
// Find all ids of entries in cenrep.
// ---------------------------------------------------------------------------
//
EXPORT_C TInt CCenRepDatabaseUtil::FindEntryIdsL( RArray<TInt>& aEntryIds )
    {
    //CENREPDATABASELOG( "CCenRepDatabaseUtil::FindEntryIdsL - IN" );
    
    aEntryIds.Reset();
    
    RKeyArray keys;
    CleanupClosePushL( keys );

    // Find all entry rows from ID column. Deleted rows are not returned.
    TInt err = iRepository->FindNeqL( iStartKey, iColMask, KNoEntryId, keys );

    TInt count = keys.Count();

    if ( KErrNone == err && count > 0 )
        {
        for( TInt i = 0; i < count; i++ )
            {
            TUint32 key = keys[i];
            TInt entryId = 0;
            User::LeaveIfError( iRepository->Get( key, entryId ) );
            User::LeaveIfError( aEntryIds.Append( entryId ) );
            }
        }

    CleanupStack::PopAndDestroy( &keys );
    
    //CENREPDATABASELOG( "CCenRepDatabaseUtil::FindEntryIdsL - OUT" );
    
    return err;
    }
// -----------------------------------------------------------------------------
// RVoIPAudioSession::PopulateArrayL
// -----------------------------------------------------------------------------
//
void RVoIPAudioSession::PopulateArrayL(
        TVoIPAudioClientServerRequest aRequest, RArray<TUint32>& aDecoders,
        TInt aCount)
    {
    HBufC8* buf = HBufC8::NewLC(aCount * sizeof(TUint32));
    TPtr8 ptr = buf->Des();
    TIpcArgs args;
    args.Set(0, &ptr);
    TInt err = SendClientRequest(aRequest, args);

    if (err == KErrNone)
        {
        RDesReadStream stream(ptr);
        CleanupClosePushL(stream);
        aDecoders.Reset();

        for (TInt i = 0; i < aCount; i++)
            {
            aDecoders.Append(stream.ReadUint32L());
            }

        CleanupStack::PopAndDestroy(&stream);
        }

    CleanupStack::PopAndDestroy(buf);
    }
void CIkeV2PkiService::CIkeV2PkiServiceApplUidArrayCleanup(TAny* any)
    {
    RArray<TUid>* applUidList = reinterpret_cast<RArray<TUid>*>(any);
    applUidList->Reset();
    applUidList->Close();
    delete applUidList;    
    }
// ==========================================================================
// FUNCTION: MessageIdsL
// ==========================================================================
EXPORT_C void CMsgStoreMailBox::MessageIdsL( TMsgStoreId aFolderId, RArray<TMsgStoreId>& aMessageIdList )
    {
	iContext.VerifyTypeL( aFolderId, EMsgStoreFolderBits );
	
	aMessageIdList.Reset();
	iContext.iSession.ChildrenIdsL( aFolderId, EMsgStoreMessageBits, aMessageIdList );
    }
Exemple #17
0
static void TestOtherFunctionalityUtcL()
{
    TheAlarmTest.Test().Next(_L("Test other functionality"));

    TheAlarmTest.TestClearStoreL();

    time.HomeTime();
    time += TTimeIntervalMinutes(1);
    id = AddUtcAlarm(time);
    time -= TTimeIntervalSeconds(30);
    id = AddUtcAlarm(time);

    ret = TheAlarmTest.Session().SetAlarmStatusByCategory(KASCliCategoryClock, EAlarmStatusEnabled);
    TheAlarmTest(ret == KErrNone, __LINE__);

    ret = TheAlarmTest.Session().GetAlarmCountForCategory(KASCliCategoryClock);
    TheAlarmTest(ret == 2, __LINE__);

    RArray<TAlarmCategory> categories;
    TheAlarmTest.Session().GetAvailableCategoryListL(categories);
    TheAlarmTest(categories.Count() == 1, __LINE__);
    categories.Reset();

    RArray<TAlarmId> ids;
    TheAlarmTest.Session().GetAlarmIdListForCategoryL(KASCliCategoryClock, ids);
    TheAlarmTest(ids.Count() == 2, __LINE__);
    ids.Reset();

    ret = TheAlarmTest.Session().AlarmCountByState(EAlarmStateQueued);
    TheAlarmTest(ret == 2, __LINE__);

    TheAlarmTest.Session().GetAlarmIdListL(ids);
    TheAlarmTest(ids.Count() == 2, __LINE__);
    ids.Reset();

    TAlarmId nextDueId;
    ret = TheAlarmTest.Session().GetNextDueAlarmId(nextDueId);
    TheAlarmTest(ret == KErrNone && nextDueId == id, __LINE__);

    ret = TheAlarmTest.Session().NumberOfAlarmsActiveInQueue();
    TheAlarmTest(ret == 2, __LINE__);

    ret = TheAlarmTest.Session().AlarmDeleteAllByCategory(KASCliCategoryClock, EFalse);
    TheAlarmTest(ret == KErrNone, __LINE__);
}
/**
Copies the specified array contents.
@param aFrom The source array.
@param aTo The target array.
@leave One of the system wide error code, if a processing failure occurs.
*/
void CMTPMetaData::CopyL(const RArray<TUint>& aFrom, RArray<TUint>& aTo)
    {
    aTo.Reset();
    const TUint KCount(aFrom.Count());
    for (TUint i(0); (i < KCount); i++)
        {
        aTo.AppendL(aFrom[i]);
        }
    }
// ---------------------------------------------------------
// CPosLmTextCriteria::GetPositionFieldsToSearchL
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
EXPORT_C void CPosLmTextCriteria::GetPositionFieldsToSearchL(
    RArray<TUint>& aFieldArray) const
    {
    aFieldArray.Reset();
    for (TInt i = 0; i < iPositionFieldArray.Count(); i++)
        {
        User::LeaveIfError(aFieldArray.Append(iPositionFieldArray[i]));
        }
    }
// ---------------------------------------------------------
// Get Popup Query languages from ptiengine    
// ---------------------------------------------------------
//
void CGSPenInputModel::GetPopupQuerylanguagesFromPtiL(CDesCArray* aLanguageNames)    
    {
    RArray<TInt> languageCodeArray;

    iPtiEngine->GetAvailableLanguagesL(languageCodeArray);

    // Item format should be "<icon_index>\t<item_text>"
    _LIT( KIconIndexSelected, "0\t" );
    _LIT( KIconIndexNotSelected, "\t" );// No icon
    
    MPtiLanguage* lang = NULL;
    TBuf<KISOCodeLength>  isoCodeName;
    
    for (TInt index = 0; index < languageCodeArray.Count(); index ++)
        {
        lang = iPtiEngine->GetLanguage(languageCodeArray[index]);
        if (!lang)
            {
            User::Leave(KErrCorrupt);
            }
            
        // Buffer should contain both tabulator string and localized name:
        HBufC* langStrBuf = HBufC::NewL(lang->LocalizedName().Length() + 7);
        CleanupStack::PushL(langStrBuf);
        
        TPtr langStrPtr = langStrBuf->Des();
        // If language is current language - use selected icon in lbx:
        if(lang->LanguageCode() == InputLanguage())
            {
            langStrPtr.Append(KIconIndexSelected);
            iLanguageIndex = index;
            }
        else
            {
            langStrPtr.Append(KIconIndexNotSelected);    
            }
            
        langStrPtr.Append(lang->LocalizedName());
        
        //AdjustLanguageName(lang->LanguageCode(), langStrPtr); 
        
        /*if (AknPenInputUtils::GetISOLanguageCode(TLanguage(lang->LanguageCode()), 
                                                 isoCodeName))
            {
            langStrPtr.Append(KLeftBracket);
            langStrPtr.Append(isoCodeName);
            langStrPtr.Append(KRightBracket);
            }*/
        aLanguageNames->AppendL(langStrPtr);
        
        CleanupStack::PopAndDestroy(langStrBuf);
        }

    languageCodeArray.Reset();
    languageCodeArray.Close();     
    }
/**
Retrieves the list of supported surface formats from the renderer.

@param aArray Supported video formats. The renderer will populate the array with supported formats.
@leave KErrNoMemory Out of memory
*/
EXPORT_C void CVideoRenderer::GetSupportedFormatsL(RArray<TUncompressedVideoFormat>& aArray)
	{
	aArray.Reset(); // first clear the old data
	
	TInt count = iSupportedFormat.Count();
	for (TInt i = 0; i < count; ++i)
		{
		aArray.AppendL(iSupportedFormat[i]);
		}
	}
// -----------------------------------------------------------------------------
// CAdvancedAudioRecordController::MacGetSupportedSourceNumChannelsL
// -----------------------------------------------------------------------------
//
EXPORT_C void CAdvancedAudioRecordController::MacGetSupportedSourceNumChannelsL(
	RArray<TUint>& aSupportedChannels )
    {
    if ( !iDataSource )
    	{
        User::Leave(KErrNotReady);
		}
    aSupportedChannels.Reset();
    iAudioInput->CapabilitiesChannelsL(aSupportedChannels);
	}
// -----------------------------------------------------------------------------
// CAdvancedAudioRecordController::MacGetSupportedSinkDataTypesL
// -----------------------------------------------------------------------------
//
EXPORT_C void CAdvancedAudioRecordController::MacGetSupportedSinkDataTypesL(
	RArray<TFourCC>& aSupportedDataTypes )
    {
    if ( !iDataSink )
    	{
        User::Leave(KErrNotReady);
		}
    aSupportedDataTypes.Reset();
    User::LeaveIfError(aSupportedDataTypes.Append(iDataType));
    }
// -----------------------------------------------------------------------------
// CAdvancedAudioRecordController::MacGetSupportedSinkNumChannelsL
// -----------------------------------------------------------------------------
//
EXPORT_C void CAdvancedAudioRecordController::MacGetSupportedSinkNumChannelsL(
	RArray<TUint>& aSupportedChannels )
    {
    if ( !iDataSink )
    	{
        User::Leave(KErrNotReady);
		}
    aSupportedChannels.Reset();
    User::LeaveIfError(aSupportedChannels.Append(iChannels));
    }
// -----------------------------------------------------------------------------
// CAdvancedAudioRecordController::MacGetSupportedSinkSampleRatesL
// -----------------------------------------------------------------------------
//
EXPORT_C void CAdvancedAudioRecordController::MacGetSupportedSinkSampleRatesL(
	RArray<TUint>& aSupportedRates )
    {
    if ( !iDataSink )
    	{
        User::Leave(KErrNotReady);
		}
    aSupportedRates.Reset();
    User::LeaveIfError(aSupportedRates.Append(iSampleRate));
    }
// -----------------------------------------------------------------------------
// CAdvancedAudioRecordController::MacGetSupportedSourceDataTypesL
// -----------------------------------------------------------------------------
//
EXPORT_C void CAdvancedAudioRecordController::MacGetSupportedSourceDataTypesL(
	RArray<TFourCC>& aSupportedDataTypes )
    {
    if ( !iDataSource )
    	{
        User::Leave(KErrNotReady);
		}
    aSupportedDataTypes.Reset();
    iAudioInput->CapabilitiesDataTypesL(aSupportedDataTypes);
	}
/** Gets all days in the month on which this rule is repeated.

@param aDays On return this array contains all days in the month that are to be set. 
This function will do nothing if this is not a monthly or yearly repeat rule. 
@publishedAll
@released 
@capability None
*/
EXPORT_C void TCalRRule::GetByDayL(RArray<TDayOfMonth>& aDays) const
	{
	if (iType == EMonthly)
		{
		aDays.Reset();
		if (GetNthBit(KMonthlyByWeek))
			{
			// if i == 35, then weekNum = 5 below which is too high
			for (TUint i = 0; i < 35; ++i)
				{
				if (GetNthBit(i))
					{
					// This is the reverse of the algorithm in TCalRRule::SetByDay(const RArray<TDayOfMonth>& aDays)
					TDay day = static_cast<TDay>(i % 7);
					TInt weekNum = i / 7;
					if (weekNum == 0)
						{
						weekNum = -1;
						}
					TDayOfMonth dayOfMonth(day, weekNum);
					aDays.AppendL(dayOfMonth);
					}
				}
			}
		}
	else if (iType == EYearly)
		{
		aDays.Reset();
		if (GetNthBit(KYearlyByWeek))
			{
			TUint8* bufferPtr = (TUint8*)&iBuffer; // convert the iBuffer store to three TUint8s
			TDay theDay = TDay(bufferPtr[0]-1); // -1 because EMonday is stored as +1
			TInt8 theWeek = TInt8(bufferPtr[1]);
			
			if (theDay >= EMonday && theDay <= ESunday)
				{
				TDayOfMonth dayOfMonth(theDay, theWeek);
				aDays.AppendL(dayOfMonth);
				}
			}
		}
	}
// get the supported codecs
void CMMFRawFormatRead::GetSupportedDataTypesL(TMediaId aMediaId, RArray<TFourCC>& aDataTypes)
	{
	if (aMediaId.iMediaType != KUidMediaTypeAudio)
		User::Leave(KErrNotSupported);
	aDataTypes.Reset();
	User::LeaveIfError(aDataTypes.Append(KMMFFourCCCodePCM16));
	User::LeaveIfError(aDataTypes.Append(KMMFFourCCCodePCM16B));
	User::LeaveIfError(aDataTypes.Append(KMMFFourCCCodePCMU16));
	User::LeaveIfError(aDataTypes.Append(KMMFFourCCCodeIMAD));
	User::LeaveIfError(aDataTypes.Append(KMMFFourCCCodeIMAS));
	}
// ---------------------------------------------------------------------------
// JavaRegUidArrayConverter::GetTUids
// ---------------------------------------------------------------------------
//
TInt JavaRegUidArrayConverter::
GetTUids(const TDesC& aValue, RArray<TUid>& aUids)
{
    TRAPD(err, JavaRegUidArrayConverter::GetTUidsL(aValue, aUids));
    if (err != KErrNone)
    {
        LOG1(EJavaStorage, EInfo, "Conversion error, error code %d",  err);
        aUids.Reset();
    }
    return err;
}
TInt CSbcEncoderTestDevice::GetSupportedAllocationMethods ( RArray<TSbcAllocationMethod>& aAllocationMethods )
	{
	TInt retVal = KErrNone;
	aAllocationMethods.Reset();
	retVal = aAllocationMethods.Append(ESbcAllocationSNR);
	if (retVal == KErrNone)
		{
		retVal = aAllocationMethods.Append(ESbcAllocationLoudness);
		}
	return retVal;
	}