void CMTPGetDevicePropDesc::RunL()
    {
    OstTraceFunctionEntry0( CMTPGETDEVICEPROPDESC_RUNL_ENTRY );
    if (iPropCode == EMTPDevicePropCodeBatteryLevel)
        {
        ServiceBatteryLevelL();
        }
    else
        {
        __DEBUG_ONLY(Panic(EMTPDevDpUnknownDeviceProperty));
        }
    OstTraceFunctionExit0( CMTPGETDEVICEPROPDESC_RUNL_EXIT );
    }
// -----------------------------------------------------------------------------
// ItemL
// -----------------------------------------------------------------------------
CGlxMediaListsTestCollectionPlugin::CItem* CGlxMediaListsTestCollectionPlugin::ItemL(const CMPXCollectionPath& aPath, TInt aIndex) const
	{
	CItem* item = NULL;
	TIdentityRelation<CItem> match(&MatchById);

	if (aPath.Levels() == 3)
		{
		// Find item
		CItem* mediaToCompare = new (ELeave) CItem();
		CleanupStack::PushL(mediaToCompare);

		mediaToCompare->iId = TGlxMediaId(aPath.IdOfIndex(aIndex));
		TInt index = _iItemDBHackContent.Find(mediaToCompare, match);

		CleanupStack::PopAndDestroy(mediaToCompare);

		if (index != KErrNotFound)
			{
			item = _iItemDBHackContent[index];
			__ASSERT_DEBUG(item != NULL, Panic(EGlxPanicLogicError));
			}
		}
	else if (aPath.Levels() == 2)
		{
		// Find item
		CItem* mediaToCompare = new (ELeave) CItem();
		CleanupStack::PushL(mediaToCompare);

		mediaToCompare->iId = TGlxMediaId(aPath.IdOfIndex(aIndex));
		TInt index = _iItemDBHackAlbums.Find(mediaToCompare, match);

		CleanupStack::PopAndDestroy(mediaToCompare);

		if (index != KErrNotFound)
			{
			item = _iItemDBHackAlbums[index];
			__ASSERT_DEBUG(item != NULL, Panic(EGlxPanicLogicError));
			}
		}
	else if (aPath.Levels() == 1)
		{
		item = iSelf;
		}
	else
		{
		__DEBUG_ONLY(Panic(EGlxPanicDebugUnexpectedError));
		User::Leave(KErrNotSupported);
		}

	return item;
	}
// ----------------------------------------------------------------------------
// Navigates to the given path
// ----------------------------------------------------------------------------
//
void CGlxMediaListsTestCollectionPlugin::OpenL(const CMPXCollectionPath& aPath,
                   const TArray<TMPXAttribute>& /*aAttrs*/,
                   CMPXFilter* /*aFilter*/)
    {
    RArray<TInt> supportedIds;
    CleanupClosePushL(supportedIds);
    supportedIds.AppendL(KMPXMediaIdContainer);
    supportedIds.AppendL(KMPXMediaIdGeneral);
    iOpenEntries = CMPXMedia::NewL(supportedIds.Array());

    CMPXMediaArray* array = CMPXMediaArray::NewL();
    CleanupStack::PushL(array);

 	if ( aPath.Levels() == 1 ) 
 		{
 		TInt count = _iItemDBHackAlbums.Count();
 		for ( TInt i = 0; i < count; i++ )
 			{
 			AppendL(_iItemDBHackAlbums[i]->iId, *_iItemDBHackAlbums[i]->iTitle, *array, EMPXGroup, EMPXAlbum);
 			}
 		}
 	else if ( aPath.Levels() == 2 ) 
 		{
 		TInt count = _iItemDBHackContent.Count();
 		for ( TInt i = 0; i < count; i++ )
 			{
 			AppendL(_iItemDBHackContent[i]->iId, *_iItemDBHackContent[i]->iTitle, *array, EMPXItem, EMPXImage);
 			}

		StartEvents();
 		}
 	else 
 		{
 		__DEBUG_ONLY(Panic(EGlxPanicDebugUnexpectedError));
 		}
    
    iOpenEntries->SetCObjectValueL(KMPXMediaArrayContents, array);
    iOpenEntries->SetTObjectValueL(KMPXMediaArrayCount, array->Count());

    CleanupStack::PopAndDestroy(array);    

	//iObs->HandleOpen(*iOpenEntries, KErrNone);
	
    AsyncNotifyL(iOpenEntries, KErrNone, CGlxAsyncNotifier::EOpen);
        
    CleanupStack::PopAndDestroy(&supportedIds);        
    }
예제 #4
0
void CMTPUsbEpControl::ReceiveDataCompleteL(TInt aError, MMTPType& aSink)
    {
    OstTraceFunctionEntry0( CMTPUSBEPCONTROL_RECEIVEDATACOMPLETEL_ENTRY );
    OstTrace1( TRACE_NORMAL, CMTPUSBEPCONTROL_RECEIVEDATACOMPLETEL, 
            "CMTPUsbEpControl state on entry = %d", iState );
    
    switch (iState)
        {
    case EControlRequestSetupPending:
        SetState(EControlRequestSetupComplete);
        Connection().ReceiveControlRequestSetupCompleteL(aError, aSink);
        break;          
        
    case EControlRequestDataReceive:
        SetState(EControlRequestStatusSend);
        Connection().ReceiveControlRequestDataCompleteL(aError, aSink);
        break;  
    
    case EIdle:
    	// State will be EIdle if CancelReceive is called
    	break;
    	
    case EControlRequestSetupComplete:
    case EControlRequestDataSend:
    case EControlRequestStatusSend:
    default:
        __DEBUG_ONLY(Panic(EMTPUsbBadState));
        break;          
        }
    if(aError != KErrNone)
	    {
	    // Reset the internal state to idle.
	    SetState(EIdle);
	    }
    OstTrace1( TRACE_NORMAL, DUP1_CMTPUSBEPCONTROL_RECEIVEDATACOMPLETEL, 
            "CMTPUsbEpControl state on exit = %d", iState );
    OstTraceFunctionExit0( CMTPUSBEPCONTROL_RECEIVEDATACOMPLETEL_EXIT );
    }
예제 #5
0
void CMTPDeviceDataProvider::NotifyEnumerationCompleteL(TUint32 aStorageId, TInt /*aError*/)
	{
    OstTraceFunctionEntry0( CMTPDEVICEDATAPROVIDER_NOTIFYENUMERATIONCOMPLETEL_ENTRY );
    __ASSERT_DEBUG((aStorageId == iPendingEnumerations[KMTPDeviceDpActiveEnumeration]), User::Invariant());
    if (iPendingEnumerations.Count() > 0)
        {
        iPendingEnumerations.Remove(KMTPDeviceDpActiveEnumeration);
        }
	switch(iEnumeratingState)
		{
	case EEnumeratingDeviceDataStore:
	case EEnumeratingFolders:
	    iEnumeratingState = EEnumerationComplete;
	    Framework().ObjectEnumerationCompleteL(aStorageId);
		//iEnumerator->StartL(iPendingEnumerations[KMTPDeviceDpActiveEnumeration]);
		break;
	case EEnumerationComplete:
	default:
		__DEBUG_ONLY(User::Invariant());
		break;
		}
	OstTraceFunctionExit0( CMTPDEVICEDATAPROVIDER_NOTIFYENUMERATIONCOMPLETEL_EXIT );
	}
예제 #6
0
TInt RHybridHeap::DebugFunction(TInt aFunc, TAny* a1, TAny* a2)
{
    TInt r = KErrNone;
    switch(aFunc)
        {
        
        case RAllocator::ECount:
            struct HeapInfo info;
            Lock();
            GetInfo(&info, NULL);
            *(unsigned*)a1 = info.iFreeN;
            r = info.iAllocN;
            Unlock();
            break;
            
        case RAllocator::EMarkStart:
            __DEBUG_ONLY(DoMarkStart());
            break;
            
        case RAllocator::EMarkEnd:
            __DEBUG_ONLY( r = DoMarkEnd((TInt)a1) );
            break;
            
        case RAllocator::ECheck:
            r = DoCheckHeap((SCheckInfo*)a1);
            break;
            
        case RAllocator::ESetFail:
            __DEBUG_ONLY(DoSetAllocFail((TAllocFail)(TInt)a1, (TInt)a2));
            break;

        case RHybridHeap::EGetFail:
            __DEBUG_ONLY(r = iFailType);
            break;

        case RHybridHeap::ESetBurstFail:
#if _DEBUG
            {
            SRAllocatorBurstFail* fail = (SRAllocatorBurstFail*) a2;
            DoSetAllocFail((TAllocFail)(TInt)a1, fail->iRate, fail->iBurst);
            }
#endif
            break;
            
        case RHybridHeap::ECheckFailure:
            // iRand will be incremented for each EFailNext, EBurstFailNext,
            // EDeterministic and EBurstDeterministic failure.
            r = iRand;
            break;
            
        case RAllocator::ECopyDebugInfo:
            {
            TInt nestingLevel = ((SDebugCell*)a1)[-1].nestingLevel;
            ((SDebugCell*)a2)[-1].nestingLevel = nestingLevel;
            break;
            }

		case RHybridHeap::EGetSize:
			{
			r = iChunkSize - sizeof(RHybridHeap);
			break;
			}

		case RHybridHeap::EGetMaxLength:
			{
			r = iMaxLength;
			break;
			}

		case RHybridHeap::EGetBase:
			{
			*(TAny**)a1 = iBase;
			break;
			}

		case RHybridHeap::EAlignInteger:
			{
			r = _ALIGN_UP((TInt)a1, iAlign);
			break;
			}

		case RHybridHeap::EAlignAddr:
			{
            *(TAny**)a2 = (TAny*)_ALIGN_UP((TLinAddr)a1, iAlign);
			break;
			}

        case RHybridHeap::EWalk:
            struct HeapInfo hinfo;
            SWalkInfo winfo;
            Lock();
            winfo.iFunction = (TWalkFunc)a1;
            winfo.iParam    = a2;
			winfo.iHeap     = (RHybridHeap*)this; 	
            GetInfo(&hinfo, &winfo);
            Unlock();
            break;

#ifndef __KERNEL_MODE__
			
        case RHybridHeap::EHybridHeap:
            {
			if ( !a1 )
				return KErrGeneral;
			STestCommand* cmd = (STestCommand*)a1;
			switch ( cmd->iCommand )
				{
				case EGetConfig:
					cmd->iConfig.iSlabBits = iSlabConfigBits;
					cmd->iConfig.iDelayedSlabThreshold = iPageThreshold;
					cmd->iConfig.iPagePower = iPageThreshold;
					break;
					
				case ESetConfig:
					//
					// New configuration data for slab and page allocator.
					// Reset heap to get data into use
					//
#if USE_HYBRID_HEAP
					iSlabConfigBits  = cmd->iConfig.iSlabBits & 0x3fff;
					iSlabInitThreshold = cmd->iConfig.iDelayedSlabThreshold;
					iPageThreshold = (cmd->iConfig.iPagePower & 0x1f);
					Reset();
#endif
					break;
					
				case EHeapMetaData:
					cmd->iData = this;
					break;
					
				case ETestData:
					iTestData = cmd->iData;
					break;

				default:
					return KErrNotSupported;
					
				}

            break;
			}
#endif  // __KERNEL_MODE            
            
        default:
            return KErrNotSupported;
            
        }
    return r;
}
void CPlayerWatcherBase::ReceiveCommandL(const TDesC8& /*aMessageInformation*/, SymbianAvctp::TTransactionLabel /*aTransLabel*/, const TBTDevAddr& /*aAddr*/)
	{
	LOG_FUNC;
	__DEBUG_ONLY(AVRCP_PANIC(ELowerInterfaceUsedOnInternalHandler));
	}
void CPlayerWatcherBase::MaxPacketSize(TInt /*aMtu*/)
	{
	LOG_FUNC;
	__DEBUG_ONLY(AVRCP_PANIC(ELowerInterfaceUsedOnInternalHandler));
	}
void CPlayerWatcherBase::MessageSent(CAvrcpCommand& /*aCommand*/, TInt /*aSendResult*/)
	{
	LOG_FUNC;
	__DEBUG_ONLY(AVRCP_PANIC(ELowerInterfaceUsedOnInternalHandler));
	}
예제 #10
0
/**
Second phase constructor.
@leave One of the system wide error code, if a processing failure occurs.
*/
void CMTPMetaData::ConstructL()
    {
    const TUint KCount(iElements.Count());
    for (TUint i(0); (i < KCount); i++)
        {
        const TElementMetaData& KElement(iElements[i]);
        switch (KElement.iType)
            {
        case EDesC:
            __ASSERT_DEBUG((iElementsDesC.Count() == KElement.iOffset), Panic(EPanicBadLayout));
            iElementsDesC.AppendL(KNullDesC().AllocLC());
            CleanupStack::Pop();
            break;
            
        case EDesCArray:
        	{
            __ASSERT_DEBUG((iElementsDesCArray.Count() == KElement.iOffset), Panic(EPanicBadLayout));
            CDesCArrayFlat* desarray = new(ELeave) CDesCArrayFlat(KGranularity);
            CleanupStack::PushL(desarray);
            iElementsDesCArray.AppendL(desarray);
            CleanupStack::Pop(desarray);
			iElementsDesCArrayType.AppendL(EDesCArrayFlat);
            break;
        	}
            
        case EInt:
            __ASSERT_DEBUG((iElementsInt.Count() == KElement.iOffset), Panic(EPanicBadLayout));
            iElementsInt.AppendL(0);
            break;
            
        case EIntArray:
        	{
            __ASSERT_DEBUG((iElementsIntArray.Count() == KElement.iOffset), Panic(EPanicBadLayout));
            RArray<TInt>* intarray = new(ELeave) RArray<TInt>;
            CleanupStack::PushL(intarray);
            iElementsIntArray.AppendL(intarray);
            CleanupStack::Pop(intarray);
            break;
        	}
            
        case EUint:
            __ASSERT_DEBUG((iElementsUint.Count() == KElement.iOffset), Panic(EPanicBadLayout));
            iElementsUint.AppendL(0);
            break;
            
        case EUintArray:
        	{
            __ASSERT_DEBUG((iElementsUintArray.Count() == KElement.iOffset), Panic(EPanicBadLayout));
            RArray<TUint>* uintarray = new(ELeave) RArray<TUint>;
            CleanupStack::PushL(uintarray);
            iElementsUintArray.AppendL(uintarray);
            CleanupStack::Pop(uintarray);
            break;
        	}
            
        default:
            __DEBUG_ONLY(Panic(EPanicTypeUnknown));
            break;
            }
        }
    }