Пример #1
0
/** Initialise this interface.

This must be called before any call to OpenL(), to ensure that the 
RProperties it uses are correctly initialised.
*/
EXPORT_C void RLbsNetworkPositionUpdates::InitializeL()
	{
	// There is an assumption that TPositionSatelliteInfo is the biggest
	// class to be sent over this interface, so double-check
	__ASSERT_COMPILE(sizeof(TPositionSatelliteInfo) >= sizeof(TPositionInfo));
	__ASSERT_COMPILE(sizeof(TPositionSatelliteInfo) >= sizeof(TPositionCourseInfo));
	
	TSecurityPolicy readPolicy(ECapabilityLocation);
	TSecurityPolicy writePolicy(ECapabilityWriteDeviceData);
	
	// Network reference position property
	TInt err = RProperty::Define(KNetworkReferencePositionUpdateKey, 
								 RProperty::ELargeByteArray, 
								 readPolicy, 
								 writePolicy, 
								 sizeof(TLbsPositionUpdateData));
	if (err != KErrNone && err != KErrAlreadyExists)
		{
		User::Leave(err);
		}

	// Network final position property
	err = RProperty::Define(KNetworkFinalPositionUpdateKey, 
							 RProperty::ELargeByteArray, 
							 readPolicy, 
							 writePolicy, 
							 sizeof(TLbsPositionUpdateData));
	if (err != KErrNone && err != KErrAlreadyExists)
		{
		User::Leave(err);
		}

	// Set default values for the properties										 
	TLbsPositionUpdateData defaultData;
	defaultData.iError = KErrNotFound;
	defaultData.iTargetTime = 0;
	defaultData.iActualTime = 0;
	// indicate that the property is ok, but contains no data.
	defaultData.iValidData = EFalse;
	TLbsPositionUpdateDataPckgC pckg(defaultData);
	
	User::LeaveIfError(RProperty::Set(RProcess().SecureId(), 
									  KNetworkReferencePositionUpdateKey, 
									  pckg));
	
	User::LeaveIfError(RProperty::Set(RProcess().SecureId(), 
									  KNetworkFinalPositionUpdateKey, 
									  pckg));
	
	// Save the Uid of the process which called InitializeL()
	// in the cenrep file owned by LbsRoot.
	SetCategoryUidL(KNetworkPositionUpdateCategoryKey, 
				    RProcess().SecureId());
	}
Пример #2
0
/** 
Match an array of search strings against the contacts in the view.

The descriptor from the client contains a flag at the start to indicate if a
prefix or substring search has been requested.

@param aMessage.Ptr0() Size of contact data to read (to client).
@param aMessage.Int1() Size of descriptor (from client).
@param aMessage.Ptr2() Descriptor (from client).
*/
void CViewSubSessionBase::ContactMatchingCriteriaExternalizedSizeL(const RMessage2& aMessage)
	{
	TPckgBuf<TInt> size;
	aMessage.ReadL(1,size);
	const TInt bufferSize = size();

	// Restore buffer.
	CBufFlat* buffer = CBufFlat::NewL(bufferSize);
	CleanupStack::PushL(buffer);
	buffer->ExpandL(0,bufferSize);
	TPtr8 des(buffer->Ptr(0));
	aMessage.ReadL(2,des);

	// Internalize the data from the stream.
	RBufReadStream readStream(*buffer);
	CleanupClosePushL(readStream);

	TBool prefixSearch = readStream.ReadUint32L(); 
	const TInt numFindWords = readStream.ReadUint32L();
	CPtrC16Array* findDesArray = new(ELeave) CPtrC16Array(numFindWords);
	CleanupStack::PushL(findDesArray);

	TInt findWordLength=0;
	for (TInt i=0; i<numFindWords; ++i)
		{
		findWordLength = readStream.ReadUint32L();
		HBufC* findword = HBufC::NewLC(readStream,findWordLength);
		findDesArray->AppendL(*findword);
		}

	DeleteFindContacts();

	if (prefixSearch)
		iView->ContactsMatchingPrefixL(*findDesArray,iContacts);
	else
		iView->ContactsMatchingCriteriaL(*findDesArray,iContacts);

	findDesArray->Reset();
	
	CleanupStack::PopAndDestroy(numFindWords);
	CleanupStack::PopAndDestroy(3, buffer);

	// Compute contacts externalized size.
	const TInt contactsCount = iContacts.Count();
	TInt contactsExternalizedSize=0;
	contactsExternalizedSize+=sizeof(TInt32);
	for (TInt jj=0;jj<contactsCount;++jj)
		{
		contactsExternalizedSize+=(iContacts)[jj]->ExternalizedSize();
		}

	TPckgBuf<TInt> pckg(contactsExternalizedSize);
	aMessage.WriteL(0,pckg);
	}
Пример #3
0
// ---------------------------------------------------------------------------
// RContentManager::ServiceState
// ---------------------------------------------------------------------------
EXPORT_C TCmServiceState RContentManager::ServiceState
    ( const TCmService aService ) const
    {
    LOG(_L("[Cm Server]\t RContentManager::ServiceState\n"));
    
    TCmServiceState state;
    TPckg<TCmServiceState> pckg( state );
    SendReceive( ECmGetServiceState, TIpcArgs( aService, &pckg ) );
    
    return state;
    }
void CBTControllerServerSession::GetControllerType()
    {
    TControllerDataTypes::TRemoteType type;
    TPckg<TControllerDataTypes::TRemoteType> pckg( type );
    
    iController.GetControllerType(type);
    if(!iMessage.IsNull())
        {
        iMessage.Write(0,pckg);
        iMessage.Complete(KErrNone);
        }
    }
Пример #5
0
EXPORT_C TInt RLbsNetworkPositionUpdates::GetPositionInfo(TLbsNetSessionIdInt& aSessionId,
															TPositionInfoBase& aPosInfo, 
															TTime& aTargetTime, 
															TTime& aActualTime)
	{
	__ASSERT_DEBUG(iNetworkPositionProperty.Handle()!=NULL, User::Invariant());
	
	//Check that aPosInfo is either TPositionInfo, TPositionCourseInfo, TPositionSatelliteInfo or TPositionExtendedSatelliteInfo.
	const TUint32 classType = aPosInfo.PositionClassType();
	const TUint classSize = aPosInfo.PositionClassSize();
	
	if (!IsValidPositionInfoBaseType(classType, classSize))
		{
		return KErrNotSupported;
		}

	TLbsPositionUpdateData data;
	TLbsPositionUpdateDataPckg pckg(data);
	TInt err = iNetworkPositionProperty.Get(pckg);
	if(err!=KErrNone)
		{
		return err;
		}
	// is the data contained valid?
	if(data.iValidData==EFalse)
		{
		return KErrNotReady;
		}
	aTargetTime = data.iTargetTime;
	aActualTime = data.iActualTime;
	aSessionId  = data.iSessionId;
	
	// copy the postion types, this preserves the type and size of the
	// to type, so the copy is offset from the base addresses of the
	// structs. NB this relies on standard C++ class ram layout i.e. address of the
	// parent class property is always lower than the child class.
	TUint8* startCopyToAddress = reinterpret_cast<TUint8*>(&aPosInfo)+sizeof(TPositionClassTypeBase);
	const TUint8* const startCopyFromAddress = reinterpret_cast<TUint8*>(&data.iSatInfo)+sizeof(TPositionClassTypeBase);
	// NB in the future is could be very dodgy, 'cos it always assumes that the
	// strct we copy to has a TSatInfoClass in it and that this is always
	// the biggest possible derative of a TPosInfoBase class 
	const TInt numberOfBytesToCopy = classSize-sizeof(TPositionClassTypeBase);
	TUint8* endAddr = Mem::Copy(startCopyToAddress, startCopyFromAddress, numberOfBytesToCopy);
	// sanity check and return any error code
	if(endAddr != startCopyToAddress + numberOfBytesToCopy)
		{
		return KErrGeneral;
		}
	else
		{	
		return err;	
		}
	}
TInt CStreamControlCustomCommandParser::DoGetRandomSeekingSupported(TMMFMessage& aMessage)
    {
    TInt status;
    TBool supported;
    status = iImplementor.MscGetRandomSeekingSupported(supported);
    TPckgBuf<TBool> pckg(supported);
    TRAPD(err, aMessage.WriteDataToClientL(pckg));
    if(err)
        {
            status = err;
        }
    return status;
    }
Пример #7
0
// -----------------------------------------------------------------------------
// CWimCertHandler::GetCerticateCountL
// Fetches count of certicates in certain WIM card.
// -----------------------------------------------------------------------------
//
void CWimCertHandler::GetCerticateCountL(
    const RMessage2& aMessage,
    CWimMemMgmt* aWimMgmt ) const
    {
    _WIMTRACE(_L("WIM | WIMServer | CWimCertHandler::GetCerticateCountL | Begin"));
    WIMI_STAT callStatus = WIMI_Ok;
    TWimEntryType certEntryType = ( TWimEntryType )aMessage.Int1();

    __ASSERT_ALWAYS( certEntryType != EWimEntryTypeAll ||
        certEntryType != EWimEntryTypeCA ||
        certEntryType != EWimEntryTypePersonal, User::Leave( KErrArgument ) );

    WIMI_Ref_t* wimRef = NULL;
    TUint8 certCount = 0;

    __ASSERT_ALWAYS( aWimMgmt, User::Leave( KErrArgument ) );
    wimRef = MainWimRef( *aWimMgmt );

    if ( wimRef )
        {
        if ( EWimEntryTypeAll == certEntryType ||
            EWimEntryTypeCA == certEntryType )
            {
            callStatus = GetCertificateCountByWIM( wimRef,
                                                   certCount,
                                                   WIMI_CU_CA );
            }

        if ( callStatus == WIMI_Ok && ( EWimEntryTypeAll == certEntryType ||
                                     EWimEntryTypePersonal == certEntryType ) )
            {
            callStatus = GetCertificateCountByWIM( wimRef,
                                                   certCount,
                                                   WIMI_CU_Client );
            }
        }
    else
        {
        callStatus = WIMI_ERR_OutOfMemory;
        }

    if ( callStatus == WIMI_Ok )
        {
        _WIMTRACE2(_L("WIM | WIMServer | CWimCertHandler::GetCerticateCountL | count=%d"), certCount);
        TPckgBuf<TUint8> pckg( certCount );
        aMessage.WriteL( 0, pckg );
        }
    aMessage.Complete( CWimUtilityFuncs::MapWIMError( callStatus ) );
    }
Пример #8
0
/**
@capability ReadUserData
*/
HBufC* RContactRemoteView::AllFieldsLC(TInt aIndex,const TDesC& aSeparator) const
    {
    // 4 context switches
    TPckgBuf<TInt>pckg;
    TIpcArgs args(aIndex,&aSeparator,&pckg);
    User::LeaveIfError(SendReceive(ECntAllFieldsLength,args));
    TInt fieldLength = pckg();
    HBufC* buf=HBufC::NewLC(fieldLength);
    TPtr8 narrowBufPtr((TUint8*)buf->Ptr(),buf->Des().MaxLength()*2); // Note, must call MaxLength because the cell allocated may be larger than aLength.
    TIpcArgs args2(&narrowBufPtr);
    User::LeaveIfError(SendReceive(ECntAllFieldsText,args2));
    TPtr bufPtr(buf->Des());
    bufPtr.SetLength(narrowBufPtr.Length()/2);
    return buf;
    }
Пример #9
0
TInt CViewSubSessionBase::AtL(const RMessage2& aMessage) const
	{
	TInt reply = KErrNone;
	const TInt index=aMessage.Int0();
	__ASSERT_ALWAYS(index>=0,User::Leave(KErrUnderflow));
	if(!(index<iView->CountL()))
		{
		// Index is out of bounds.
		reply=KErrNotFound;
		return reply;
		}
	TPckgBuf<TContactItemId> pckg(iView->AtL(index));
	aMessage.WriteL(1,pckg);
	return reply;
	}
/** Get position info data from RProperty published from modules
	this is similar to GetPositionInfo but the caller should always pass in a 
	TPositionExtendedSatelliteInfo. The type of the position returned will be whatever 
	has been published by SetPositionInfo.

@param aBlob pointer to a TPositionInfoBase object.
@param aBlobSize size of blob.
@param aTargetTime The target time for the position data.
@param aActualTime The actually time for the position data.
@return Symbian Location service Error code
@released
@internalComponent
 */
EXPORT_C TInt RLbsPositionUpdates::GetAsMuchAsCanPositionInfo(TBool& aConflictControl, TAny* aBlob, TUint aBlobSize, TTime& aTargetTime, TTime& aActualTime) const
	{
	__ASSERT_DEBUG(iProperty.Handle()!=NULL, User::Invariant());		//Handle not open.
	
	if(sizeof(TPositionExtendedSatelliteInfo) != aBlobSize) 
		{
		return KErrNotSupported;
		}

	aConflictControl = EFalse;
	
	TLbsPositionUpdateData data;
	TLbsPositionUpdateDataPckg pckg(data);
	TInt err = const_cast<RLbsPositionUpdates*>(this)->iProperty.Get(pckg);
	if(err!=KErrNone)
		{
		return err;
		}
	// is the data contained valid?
	if(data.iValidData==EFalse)
		{
		return KErrNotReady; // nothing has been published yet
		}
		
	// Is it a special conflict control message
	aConflictControl = data.iConflictControl;
	
	aTargetTime = data.iTargetTime;
	aActualTime = data.iActualTime;
	
	TUint8* destAddr = reinterpret_cast<TUint8*>(aBlob);
	TUint8* srcAddr = reinterpret_cast<TUint8*>(&data.iSatInfo[0]);

	TUint8* endAddr2 = Mem::Copy(destAddr, srcAddr, aBlobSize);
	
	//If some error code is associated to this update, return that
	if(data.iError != KErrNone)
		{
		err = data.iError;
		}

	return err;	

	}
// -----------------------------------------------------------------------------
// CDrmUtilityInfoNoteWrapper::ShowNoteL
// -----------------------------------------------------------------------------
//
void DRM::CDrmUtilityInfoNoteWrapper::ShowNoteL( TAknGlobalNoteType aType ,
                                                 const TDesC& aNoteText,
                                                 TInt aResourceId,
                                                 const TDesC& aString,
                                                 TInt aValue )
    {
    RProcess myProcess;
    TUid myProcessUid( KNullUid );

    // Convert primary display resource ID to Cover Ui
    // do nothing if not found
    if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) &&
         EvaluateCoverResourceId( aResourceId ) )
        {
        RThread().Process( myProcess );
        myProcessUid = myProcess.Identity();

        TUtilitySDData utilityData;
        // First field is DrmUtility's Uid
        utilityData.iUtilityUid = KUidCoverUiCategoryDrmUtility;
        // ProcessId which uses DrmUtility
        utilityData.iHandlerProcessId = myProcessUid;
        if ( aNoteText.Compare( KNullDesC ) )
            {
            // If there is filename given, it's always in the PrimaryString
            utilityData.iStringParam.Append( aString );
            }
        if ( aValue > -1 )
            {
            // If there is filename given, it's always in the PrimaryString
            utilityData.iStringParam.Append( aValue );
            }

        TUtilitySDDataPckg pckg( utilityData );
        CAknSDData* sd( CAknSDData::NewL( KUidCoverUiCategoryDrmUtility,
                                          aResourceId,
                                          pckg ) );
        iNote->SetSecondaryDisplayData( sd ); // ownership to notifier client
        }

    iNote->ShowNoteL( iStatus , aType , aNoteText );
    SetActive();
    }
Пример #12
0
EXPORT_C TInt RLbsNetworkPositionUpdates::SetPositionInfo(const TLbsNetSessionIdInt& aSessionId,
														  const TInt& aError, 
															const TPositionInfoBase& aPositionInfo, 
															const TTime& aActualTime)
	{
	__ASSERT_DEBUG(iNetworkPositionProperty.Handle()!=NULL, User::Invariant());

	//Check that aPosInfo is either TPositionInfo, TPositionCourseInfo, or TPositionSatelliteInfo.
	const TUint32 classType = aPositionInfo.PositionClassType();
	const TUint classSize = aPositionInfo.PositionClassSize();
	
	if (!IsValidPositionInfoBaseType(classType, classSize))
		{
		return KErrNotSupported;
		}
	
	TLbsPositionUpdateData data;
	data.iError = aError;
	data.iTargetTime = 0;
	data.iActualTime = aActualTime;
	data.iSessionId = aSessionId;
	// indicate that the property is ok, and now contains no data.
	data.iValidData = ETrue;

	// Copy the full class type, size and data from aPositionInfo into the property.
	// This will set the type of the object in the property to the type being passed in.
	TUint8* startCopyToAddress = reinterpret_cast<TUint8*>(&data.iSatInfo);
	const TUint8* const startCopyFromAddress = reinterpret_cast<const TUint8*>(&aPositionInfo);
	const TInt numberOfBytesToCopy = aPositionInfo.PositionClassSize();
	TUint8* endAddr = Mem::Copy(startCopyToAddress, startCopyFromAddress, numberOfBytesToCopy);
	// sanity check and return any error code
	if(endAddr != (startCopyToAddress + numberOfBytesToCopy))
		{
		return KErrGeneral;
		}
	TLbsPositionUpdateDataPckgC pckg(data);
	TInt err = iNetworkPositionProperty.Set(pckg);
	return err;
	}
// --------------------------------------------------------------------------
// Handle clients' requests. Due the request implementations are simple
// the actions are done in ServiceL and not dispatched to separate functions.
// --------------------------------------------------------------------------
//
void CFlexTimerServerMonitorSession::ServiceL( const RMessage2& aMessage )
    {
    // This ain't the most elegant solution but here we go.
    //
    // Passing the server's reference as a parameter during session creation 
    // would be another solution.
    CFlexTimerServerMonitorServer* server = 
        static_cast<CFlexTimerServerMonitorServer*>( 
            const_cast<CServer2*>( Server() ) );

    // Dispatch and execute the client's request
    switch ( aMessage.Function() )
        {
        case EFlexTimerServerMonitorStartMonitoring:
            {
            aMessage.Complete( server->StartMonitoring() );
            break;
            }
        case EFlexTimerServerMonitorHasServerCrashed:
            {
            TBool hasCrashed;

            TInt ret = server->GetStatus( hasCrashed );

            TPckgBuf<TBool> pckg( hasCrashed );
            aMessage.WriteL( 0, pckg );
            aMessage.Complete( ret );
            break;
            }
        case EFlexTimerServerMonitorStopMonitoring:
            {
            aMessage.Complete( server->StopMonitoring() );
            break;
            }
        default:
            aMessage.Complete( KErrNotSupported );
        }
    }
void CCntFileManagerMsgHandler::ListDatabasesL(const RMessage2& aMessage)
	{
	// Non file-specific. Does not require manager instance.
	// Client request to list contact databases on a specific or all system
	// drives.
	// Return parameter for serialized CDesCArray.
	CBufFlat* listBuffer;
	// IPC args thus:
	// 0 (Return param)	- Address of our return buffer
	// 1 (Param)		- The drive number 0 - 25 or ECntAllDrives
	// 2 (Return param)	- The size of buffer we are returning or want to return
	TInt driveNumber = aMessage.Int1();
	// Call controller to retrieve list of databases.
	if(driveNumber == ECntAllDrives)
		{
		Server().Controller().ListDatabasesL(listBuffer);
		}
	else
		{
		Server().Controller().ListDatabasesL(listBuffer,(TDriveUnit*)&driveNumber);
		}
	// Controller will have filled the listBuffer with a serialized
	// CDesCArray.
	CleanupStack::PushL(listBuffer);
	// Size of the buffer we want to return to client.
	TInt size = listBuffer->Size(); 
	TPckg<TInt> pckg(size);
	// Write return buffer size to client.
	aMessage.WriteL(2,pckg);
	// Only write if client has provided large enough buffer.  Client can
	// call us again with a larger buffer if contents are too large.
	if(aMessage.GetDesMaxLength(0) >= size)
		{
		aMessage.WriteL(0,listBuffer->Ptr(0));
		}
	aMessage.Complete(KErrNone);
	CleanupStack::PopAndDestroy(listBuffer);	
	}
Пример #15
0
TInt RBTBaseband::Open(RSocketServ& aSocketServ, const TBTDevAddr& aBDAddr)
	{
	//open unsubscribed socket (currently use KSockBluetoothTypeRawBroadcast)
	TInt err = iSocket.Open(aSocketServ, 
							KBTAddrFamily, 
							KSockBluetoothTypeRawBroadcast, 
							KBTLinkManager);
	if (err)
		{
		return err;
		}

	//attempt to subscribe socket to supplied address
	TPckg<TBTDevAddr> pckg(aBDAddr);
	err = iSocket.SetOpt(EBBSubscribePhysicalLink, KSolBtLMProxy, pckg);
	if(err)
		//only leave open if there is an EXISTING connection
		{
		iSocket.Close();
		}

	return err;
	}
void CSysApConfirmationQuery::ShowQueryL( const TSysApConfirmationQueryIds aQueryId,  const TDesC& /*aValue*/, CCoeEnv* aLoaderEnv )
#endif // RD_MULTIPLE_DRIVE
    {
    TRACES( RDebug::Print( _L("CSysApConfirmationQuery::ShowQueryL( %d )"), aQueryId ) );
    HBufC* queryStringBuf = NULL;
    HBufC* deviceNameBuf = NULL;
    CAknQueryDialog::TTone tone = CAknQueryDialog::ENoTone;    
    
    if( !IsActive() )
        {
        iQueryId = aQueryId;
        TInt secondaryDisplayCmdId(SecondaryDisplay::ECmdNoNote);
        TInt keys(0);
        TInt anim(0);        

        switch ( iQueryId )
            {
            case ESysApRestartPhoneQuery:
                queryStringBuf = StringLoader::LoadLC( R_QTN_RESTART_QUERY, aLoaderEnv );
                keys = R_AVKON_SOFTKEYS_OK_EMPTY;
                anim = R_QGN_NOTE_WARNING_ANIM;
                secondaryDisplayCmdId = SecondaryDisplay::ECmdShowRestartPhoneQuery;
                break;
            case ESysApLeaveOfflineModeQuery:
                queryStringBuf = StringLoader::LoadLC( R_QTN_LEAVE_OFFLINE_MODE_QUERY, aLoaderEnv );
                keys = R_AVKON_SOFTKEYS_YES_NO;
                secondaryDisplayCmdId = SecondaryDisplay::ECmdShowLeaveOfflineModeQuery;
                break;
#ifndef RD_MULTIPLE_DRIVE
            case ESysApRemoveMmcNote:
                queryStringBuf = StringLoader::LoadLC( R_QTN_MEMC_INFO_EJECT, aLoaderEnv );
                keys = R_AVKON_SOFTKEYS_OK_EMPTY;
                anim = R_QGN_NOTE_INFO_ANIM;
                secondaryDisplayCmdId = SecondaryDisplay::ECmdShowRemoveMmcQuery;
                break;
            case ESysApEjectMmcQuery:
                queryStringBuf = StringLoader::LoadLC( R_QTN_MEMC_CONF_EJECT, aLoaderEnv );
                keys = R_AVKON_SOFTKEYS_YES_NO;
                secondaryDisplayCmdId = SecondaryDisplay::ECmdShowEjectMmcQuery;
                break;
#else // RD_MULTIPLE_DRIVE
            case ESysApRemoveMmcNote:
                queryStringBuf = aValue.AllocLC();
                keys = R_AVKON_SOFTKEYS_OK_EMPTY;
                anim = R_QGN_NOTE_INFO_ANIM;
                secondaryDisplayCmdId = SecondaryDisplay::ECmdShowRemoveMmcQuery;
                break;
            case ESysApEjectMmcQuery:
                queryStringBuf = aValue.AllocLC();
                keys = R_AVKON_SOFTKEYS_YES_NO;
                secondaryDisplayCmdId = SecondaryDisplay::ECmdShowEjectMmcQuery;
                break;
#endif // RD_MULTIPLE_DRIVE
            case ESysApBtSapDisconnectQuery:
                deviceNameBuf = iSysApAppUi.GetBtSapDeviceNameL();
                if ( deviceNameBuf )
                    {
                    CleanupStack::PushL(deviceNameBuf);
                    queryStringBuf = StringLoader::LoadL( R_QTN_BT_DISCONN_FROM, *deviceNameBuf, aLoaderEnv );
                    }
                else
                    {
                    queryStringBuf = StringLoader::LoadL( R_QTN_BT_DISCONN_FROM, KEmptyString, aLoaderEnv ); 
                    }
                CleanupStack::PushL(queryStringBuf);
                keys = R_AVKON_SOFTKEYS_YES_NO;
                secondaryDisplayCmdId = SecondaryDisplay::ECmdShowBtSapDisconnectQuery;
                break;
            case ESysApMemoryCardLockedNote:
                iPendingQuery = ESysApMemoryCardLockedNote;
                queryStringBuf = StringLoader::LoadLC( R_QTN_MEMC_LOCKED_NOT_SUPPORTED, aLoaderEnv );
                keys = R_AVKON_SOFTKEYS_OK_EMPTY;
                anim = R_QGN_NOTE_INFO_ANIM;
                secondaryDisplayCmdId = SecondaryDisplay::ECmdShowMemoryCardLockedQuery;
                break;
/*            case ESysApUseFmTxInOfflineQuery:
                 queryStringBuf 
                     = StringLoader::LoadLC( R_QTN_FMTX_SYSAP_NOTE_ACTIVATE_IN_OFFLINE,
                                             aLoaderEnv );
                 keys = R_AVKON_SOFTKEYS_YES_NO;
                 secondaryDisplayCmdId = SecondaryDisplay::ECmdShowFmTxKeepOnInOfflineQuery;
                 break;
*/            case ESysApBattChargingPowerSavingQuery:
                queryStringBuf = StringLoader::LoadLC( R_QTN_BATTERY_CHARGING_POWER_SAVING_QUERY, aLoaderEnv );
                keys = R_AVKON_SOFTKEYS_YES_NO;
                secondaryDisplayCmdId = SecondaryDisplay::ECmdShowChargingDeactivatePowerSavingQuery;
                tone = static_cast<CAknQueryDialog::TTone>( EAvkonSIDChargingBatteryTone );                
                break;
            
            case ESysApBattLowPowerSavingQuery:
                queryStringBuf = StringLoader::LoadLC( R_QTN_BATTERY_CONF_QUERY, aLoaderEnv );
                keys = R_AVKON_SOFTKEYS_YES_NO;
                secondaryDisplayCmdId = SecondaryDisplay::ECmdShowBattLowActivatePowerSavingQuery;
                break;
            
            default:
                break;
            }

        if ( iSysApAppUi.CoverDisplaySupported() && secondaryDisplayCmdId != SecondaryDisplay::ECmdNoNote )
            {
            TRACES( RDebug::Print( _L("CSysApConfirmationQuery::ShowQueryL - Notifying secondary display") ) );
            CAknSDData* sd = NULL;
            if ( secondaryDisplayCmdId == SecondaryDisplay::ECmdShowBtSapDisconnectQuery )
                {
                SecondaryDisplay::TDeviceName sdDeviceName;
                sdDeviceName.Append(deviceNameBuf->Left(SecondaryDisplay::KMaxDeviceNameLen));
                SecondaryDisplay::TBtSapDisconnectQueryPckg pckg(sdDeviceName);
                sd = CAknSDData::NewL(SecondaryDisplay::KCatSysAp, SecondaryDisplay::ECmdShowBtSapDisconnectQuery, pckg);
                }
            else
                {
                sd = CAknSDData::NewL(SecondaryDisplay::KCatSysAp, secondaryDisplayCmdId, KNullDesC8);
                }
            iQuery->SetSecondaryDisplayData(sd); // ownership to notifier client
            }

        if ( keys && queryStringBuf )
            {
            if ( anim )
                {
                iQuery->ShowConfirmationQueryL( iStatus, 
                                                queryStringBuf->Des(), 
                                                keys,
                                                anim,
                                                KNullDesC,
                                                0,
                                                0,
                                                tone );
                }
            else
                {
                iQuery->ShowConfirmationQueryL( iStatus, 
                                                queryStringBuf->Des(), 
                                                keys,
                                                0,
                                                KNullDesC,
                                                0,
                                                0,
                                                tone );
                }
            }

        SetActive();
        }    
     else
        {
        // If another query is wanted when ESysApMemoryCardLockedNote is active, override it (Continues in RunL which handles cancel).
        if ( iQueryId == ESysApMemoryCardLockedNote && aQueryId != ESysApMemoryCardLockedNote )
            {
            iPendingQuery = aQueryId;
            iQuery->CancelConfirmationQuery();
            }
        }

    if ( queryStringBuf )
        {
        CleanupStack::PopAndDestroy( queryStringBuf ); // queryStringbuf
        }

    if ( deviceNameBuf )
        {
        CleanupStack::PopAndDestroy( deviceNameBuf ); // deviceNameBuf
        }

    }       
TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowPreviewListQueryL(
    TInt aResourceId )
    {
    TInt index( 0 );
    CAknGlobalListQuery* listQuery( CAknGlobalListQuery::NewLC() );
    HBufC* buffer( HBufC::NewLC( DRM::KDRMNoteBufferMaxSize ) );
    TPtr bufPtr( buffer->Des() );

    bufPtr = iResourceReader->ReadResourceString( R_DRMUTILITY_ACTIVATE_PREVIEW );
    listQuery->SetHeadingL( bufPtr );

    CDesCArray* listArray( new( ELeave ) CDesCArrayFlat( 2 ) );
    CleanupStack::PushL( listArray );

    bufPtr = iResourceReader->ReadResourceString( R_DRMUTILITY_ACTIVATE );
    listArray->AppendL( bufPtr );

    switch( aResourceId )
        {
        case R_DRMUTILITY_PREV_AUDIO_GET_LIST_QUERY:

            bufPtr = iResourceReader->ReadResourceString(
                                            R_DRMUTILITY_GET_PREVIEW );


            break;

        case R_DRMUTILITY_PREV_VIDEO_GET_LIST_QUERY:

            bufPtr = iResourceReader->ReadResourceString(
                                            R_DRMUTILITY_GET_PREVIEW_VIDEO );

            break;

        case R_DRMUTILITY_PREV_AUDIO_PLAY_LIST_QUERY:

            bufPtr = iResourceReader->ReadResourceString(
                                            R_DRMUTILITY_PLAY_PREVIEW );

            break;

        case R_DRMUTILITY_PREV_VIDEO_PLAY_LIST_QUERY:

            bufPtr = iResourceReader->ReadResourceString(
                                            R_DRMUTILITY_PLAY_PREVIEW_VIDEO );

            break;

        default:

            return 0;

        }

    listArray->AppendL( bufPtr );

    if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) &&
        DRM::CDrmUtilityInfoNoteWrapper::EvaluateCoverResourceId( aResourceId ) )
        {
        RProcess myProcess;
        TUid myProcessUid( KNullUid );
        RThread().Process( myProcess );
        myProcessUid = myProcess.Identity();

        TUtilitySDData utilityData;
        // First field is DrmUtility's Uid
        utilityData.iUtilityUid = KUidCoverUiCategoryDrmUtility;
        // ProcessId which uses DrmUtility
        utilityData.iHandlerProcessId = myProcessUid;
        TUtilitySDDataPckg pckg( utilityData );
        CAknSDData* sd( CAknSDData::NewL( KUidCoverUiCategoryDrmUtility,
                                          aResourceId,
                                          pckg ) );

        // ownership to notifier client
        listQuery->SetSecondaryDisplayData( sd );
        }

    iStatus = KRequestPending;
    listQuery->ShowListQueryL( listArray, iStatus );
    SetActive();
    iWait.Start();

    CleanupStack::PopAndDestroy( 3, listQuery ); //listArray, buffer, listQuery

    if ( iStatus.Int() != EAknSoftkeyNo )
        {
        index = iStatus.Int() + 1;
        }

    return index;
    }
// -----------------------------------------------------------------------------
// CDrmUtilityGlobalNoteWrapper::DoShowNoteL
// -----------------------------------------------------------------------------
//
TInt DRM::CDrmUtilityGlobalNoteWrapper::DoShowNoteL(
    TInt aResourceId,
    const TDesC& aString,
    TInt aValue )
    {
    TPtr bufPtr( NULL, 0 );
    TInt animation( iButtonsId == R_AVKON_SOFTKEYS_YES_NO__YES ?
                                                    0 : R_QGN_NOTE_INFO_ANIM );

    CAknGlobalConfirmationQuery* globalNote(
                                        CAknGlobalConfirmationQuery::NewLC() );

    bufPtr.Set( const_cast <TUint16*>( iTextBuffer.Ptr() ),
                                       iTextBuffer.Length(),
                                       iTextBuffer.Length() );

    AknTextUtils::LanguageSpecificNumberConversion( bufPtr );


    if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) &&
        DRM::CDrmUtilityInfoNoteWrapper::EvaluateCoverResourceId( aResourceId ) )
        {
        RProcess myProcess;
        TUid myProcessUid( KNullUid );
        RThread().Process( myProcess );
        myProcessUid = myProcess.Identity();

        TUtilitySDData utilityData;
        // First field is DrmUtility's Uid
        utilityData.iUtilityUid = KUidCoverUiCategoryDrmUtility;
        // ProcessId which uses DrmUtility
        utilityData.iHandlerProcessId = myProcessUid;
        if ( aString.Compare( KNullDesC ) )
            {
            // If there is filename given, it's always in the PrimaryString
            utilityData.iStringParam.Append( aString );
            }
        if ( aValue >= 0 )
            {
            // If there is no other than numeric data, put it as SecondaryString
            utilityData.iNumParam.AppendNum( aValue );
            }

        TUtilitySDDataPckg pckg( utilityData );
        CAknSDData* sd( CAknSDData::NewL( KUidCoverUiCategoryDrmUtility,
                                          aResourceId,
                                          pckg ) );

        // ownership to notifier client
        globalNote->SetSecondaryDisplayData( sd );
        }

    iStatus = KRequestPending;
    globalNote->ShowConfirmationQueryL( iStatus,
                                        iTextBuffer,
                                        iButtonsId,
                                        animation );

    SetActive();
    iWait.Start();
    CleanupStack::PopAndDestroy( globalNote );
    if ( iStatus.Int() != EAknSoftkeyNo )
        {
        return iStatus.Int();
        }
    else
        {
        return 0;
        }
    }
Пример #19
0
void CViewSubSession::ExternalizedSortOrderSizeL(const RMessage2& aMessage) const
	{
	TPckgBuf<TInt> pckg(View().SortOrder().ExternalizedSize());
	aMessage.WriteL(0,pckg);
	}
Пример #20
0
void CViewSubSessionBase::FindL(const RMessage2& aMessage) const
	{
	TPckgBuf<TContactItemId> pckg(iView->FindL(aMessage.Int0()));
	aMessage.WriteL(1,pckg);
	}
Пример #21
0
void CViewSubSessionBase::GetSortPluginUidFromServerL(const RMessage2& aMessage)
	{
	TUid uid = iView->GetViewSortPluginImplUid();
	TPckgBuf<TInt> pckg(uid.iUid);
	aMessage.WriteL(0,pckg);
	}
Пример #22
0
void CCamcTestClient_9::RunLTrappedL()
    {
    if ( iOpenReady )  
        { 
        iOpenReady = EFalse;
        switch ( iAction )
            {
            case K_Tc9_PrepareWhenControllerReadyWhitoutSetting:
            case K_Tc9_PrepareWhenControllerReadyOnlyVideoBitRateSetting:
            case K_Tc9_PrepareWhenControllerReadyOnlyVideoFrameSizeSetting:
                {
                break;
                }
            case K_TC9_NewFileNameWhenInternalStop:
                {
                iCamc->SetMaxClipSizeL(TC9_FILE_SIZE_LIMIT) ; 
                break;
                }
            case K_TC9_NewFileNameWhenRecordSecondTimeMPEG4FileFormat:
                {
                iCamc->SetVideoFrameSizeL(TSize(352,288));
                iCamc->SetVideoFrameRateL(TReal32(15));
                iCamc->SetVideoBitRateL( TC9_VIDEO_BIT_RATE );
                iCamc->SetAudioBitRateL(TInt( TC9_AUDIO_BIT_RATE_AAC ));
                break;
                }
            default:
                {
                // Set default parameters. They can be overwritten depending on the test case. 
                iCamc->SetVideoFrameSizeL(TSize(176,144));
                iCamc->SetVideoFrameRateL(TReal32(15));
                iCamc->SetVideoBitRateL( TC9_VIDEO_BIT_RATE );
                iCamc->SetAudioBitRateL(TInt( TC9_AUDIO_BIT_RATE ));
                break;
                }

            }
        
        switch ( iAction )
            {
            case  K_Tc9_PrepareWhenControllerReadyWhitoutSetting:
                {
                break;
                }
            case K_Tc9_PrepareWhenControllerReadyOnlyVideoBitRateSetting:
                {
                iCamc->SetVideoBitRateL(TInt(50000));
                break;
                }
            case K_Tc9_PrepareWhenControllerReadyOnlyVideoFrameSizeSetting:
                {
                iCamc->SetVideoFrameSizeL(TSize(176,144));
                break;
                }
            case K_Tc9_SetMaxClipSizeLWhenControllerReadySize0:
                {
                iCamc->SetMaxClipSizeL( 0 );
                break;
                }
            case K_Tc9_SetMaxClipSizeLWhenControllerReadyKMMFNoMaxClipSize:
                {
                iCamc->SetMaxClipSizeL( KMMFNoMaxClipSize );
                break;
                }
            case K_Tc9_OpenFileInAFolderNonExistent:
                {               
                AddDriveLetterToPath(_L("non-existent-folder\\recordQCIF.3gp"), iFileName);
                TMMFFileParams params;
                params.iPath = iFileName;
                TPckgC<TMMFFileParams> pckg(params);
                    
                TUid controllerUid = {0x101F8503};	// controller implementation interface uid
                TInt ret = iCamc->CustomCommandSync( TMMFMessageDestination( controllerUid, KMMFObjectHandleController ), ECamCControllerCCNewFilename, pckg, KNullDesC8);
                if (ret != 0)
                    {
                    User::Leave(K_Tc9_ValueNotExpected);
                    }
                iAction = K_Tc9_none;
                break;
                }
            default:
                {
                break;
                }
            }
        iCamc->Prepare();
            
        }
    else if ( iPrepareReady ) 
        {
        TBool record = EFalse;
        switch ( iAction )
            {
            case K_Tc9_SetMaxClipSizeLWhenControllerReadySize0:
            case K_Tc9_SetMaxClipSizeLWhenControllerReadyKMMFNoMaxClipSize:
                {
                iPrepareReady = EFalse;
                iCamc->Record();
                record = EFalse;
                break;
                }
            case K_TC9_NewFileNameWhenPreparedNotRecording:
                {
                if (!iNewFileName)
                    {
                    AddDriveLetterToPath(_L("NewFileName.3gp"),iFileName);
                    
                    TMMFFileParams params;
                    params.iPath = iFileName;
                    TPckgC<TMMFFileParams> pckg(params);
                    
                    TUid controllerUid = {0x101F8503};	// controller implementation interface uid
                    TInt ret = iCamc->CustomCommandSync( TMMFMessageDestination( controllerUid, KMMFObjectHandleController ), ECamCControllerCCNewFilename, pckg, KNullDesC8);
                    if (ret != 0)
                        {
                        User::Leave(K_Tc9_ValueNotExpected);
                        }

                    iCamc->Prepare();
                    iAction = K_Tc9_none;
                    }
                break;
                }
            case K_TC9_NewFileNameWhenInternalStop :
                {
                iPrepareReady = EFalse;
                iCamc->Record(); // No timer need, will eventually stop because of filesize limit.
                break;
                }
            
            default:
                {
                record = ETrue;
                break;
                }
            }
        if ( record )
            {
            iPrepareReady = EFalse;
            iCamc->Record();
            CTimer::After( iTimeout );
            }
        }
    
    else if ( iRecordingReady )
        {
        TBool close = EFalse;
        iRecordingReady = EFalse;

        TMMFFileParams params;
        switch ( iAction )
            {
            case K_Tc9_RecordTimeAvailWhenRecordingReady:
                {
                // Compare if default size limit is correctly returned by 
                // a RecordTimeAvailableL      
                TTimeIntervalMicroSeconds timeRemaining = iCamc->RecordTimeAvailable();
                TInt64 timeRemainingInSec = timeRemaining.Int64()/1E6; //Max time is 3600s = 60min
                
                PRINT((_L("CCamCTest_9::RecordTimeAvailable5: timeRemainingInSec: %d "), I64INT(timeRemainingInSec  )));
                
                
                
                // Duration value depends on available disk drive space.
                // Get the free space of the disk drive:

                RFs fsSession;
                fsSession.Connect();
                TVolumeInfo volumeInfo;
                TInt err = fsSession.Volume(volumeInfo,EDriveC);
                fsSession.Close();
                if (err)
                    {
                    User::Leave( KErrGeneral) ;
                    }

                // Possible duration = available disk space/videobitrate
                TInt64 calculatedDuration = volumeInfo.iFree / TInt64((TC9_VIDEO_BIT_RATE+TC9_AUDIO_BIT_RATE)/8);
                
                // If there is more space than the max length of the video -> 
                // set the calculatedDuration to max length
                if ( calculatedDuration > KMaxVideoLength) 
                    {
                    calculatedDuration = KMaxVideoLength;
                    }
                
                RDebug::Print(_L("CCamcTest_9::RecordTimeAvailable5 timeRemaining is %d "), I64INT(timeRemainingInSec ));
                RDebug::Print(_L("CCamcTest_9::RecordTimeAvailable5 calculatedDuration is %d "), I64INT(calculatedDuration ) );
                // Allows 5% error margin:
                if ( ( timeRemainingInSec > calculatedDuration*1.05 ) ||
                    ( timeRemainingInSec < calculatedDuration*0.95 ) )
                    {
                    RDebug::Print(_L("CCamcTest_9::RecordTimeAvailable5 is leaving, because timeRemaining != Calculated ") );          
                    User::Leave( K_Tc9_ValueNotWithinRange ) ; 
                    }
                close = ETrue;
                break;
                }
                
            case K_TC9_NewFileNameWhenRecordSecondTime : 
                {
                if (!iRecord2ndTime)
                    {
                    iRecord2ndTime =ETrue;
                    AddDriveLetterToPath(_L("NewFileName.3gp"), iFileName );
                    
                    params.iPath = iFileName;
                    TPckgC<TMMFFileParams> pckg(params);
                    
                    TUid controllerUid = {0x101F8503};	// controller implementation interface uid
                    TInt ret = iCamc->CustomCommandSync( TMMFMessageDestination( controllerUid, KMMFObjectHandleController ), ECamCControllerCCNewFilename, pckg, KNullDesC8);
                    if (ret != 0)
                        {
                        User::Leave(K_Tc9_ValueNotExpected);
                        }
                    iCamc->Prepare();
                    iAction = K_Tc9_none;
                    }
                break;          
                }

            case K_TC9_NewFileNameWhenRecordSecondTimeDiffFileFormat : 
                {
                if (!iRecord2ndTime)
                    {
                    iRecord2ndTime =ETrue;
                    AddDriveLetterToPath(_L("NewFileName.3g2"), iFileName );
                    
                    params.iPath = iFileName;
                    TPckgC<TMMFFileParams> pckg(params);
                    
                    TUid controllerUid = {0x101F8503};	// controller implementation interface uid
                    TInt ret = iCamc->CustomCommandSync( TMMFMessageDestination( controllerUid, KMMFObjectHandleController ), ECamCControllerCCNewFilename, pckg, KNullDesC8);
                    if (ret != 0)
                        {
                        User::Leave(K_Tc9_ValueNotExpected);
                        }
                    iCamc->Prepare();
                    iAction = K_Tc9_none;
                    }
                break;          
                }

            case K_TC9_NewFileNameWhenRecordSecondTimeMPEG4FileFormat : 
                {
                if (!iRecord2ndTime)
                    {
                    iRecord2ndTime =ETrue;
                    AddDriveLetterToPath(_L("NewFileName.mp4"), iFileName );
                    
                    params.iPath = iFileName;
                    TPckgC<TMMFFileParams> pckg(params);
                    
                    TUid controllerUid = {0x101F8503};	// controller implementation interface uid
                    TInt ret = iCamc->CustomCommandSync( TMMFMessageDestination( controllerUid, KMMFObjectHandleController ), ECamCControllerCCNewFilename, pckg, KNullDesC8);
                    if (ret != 0)
                        {
                        User::Leave(K_Tc9_ValueNotExpected);
                        }
                    iCamc->Prepare();
                    iAction = K_Tc9_none;
                    }
                break;          
                }

            case K_TC9_NewFileNameWhenInternalStop : 
                {             
                if (!iRecord2ndTime)
                    {
                    iRecord2ndTime =ETrue;
                    AddDriveLetterToPath(_L("NewFileName.3gp"), iFileName );

                    params.iPath = iFileName;
                    TPckgC<TMMFFileParams> pckg(params);
                    
                    TUid controllerUid = {0x101F8503};	// controller implementation interface uid
                    TInt ret = iCamc->CustomCommandSync( TMMFMessageDestination( controllerUid, KMMFObjectHandleController ), ECamCControllerCCNewFilename, pckg, KNullDesC8);
                    if (ret != 0)
                        {
                        User::Leave(K_Tc9_ValueNotExpected);
                        }

                    iCamc->Prepare();
                    }
                else
                    {
                    close = ETrue;
                    }
                break;

                }               
            default:
                {
                close = ETrue;
                break;
                }
            }
        if (close)
            {
            iCamc->Close();
            iClosed = ETrue;
            CTimer::After( 1000 );
            }
        }

    else 
        {
          RunLContinuedL();
        }
        
    if ( iClosed )
        {
        iCamc->Stop();
        CActiveScheduler::Stop();
        }
    }
Пример #23
0
void CViewSubSessionBase::GetIncludedTypesL(const RMessage2& aMessage)
	{
	TPckgBuf<TContactViewPreferences> pckg(iView->ContactViewPreferences());
	aMessage.WriteL(0,pckg);	
	}
Пример #24
0
void CCamcTestClient_9::RunLContinuedL()
// This function exist to skip a MS VC6 bug/feature
// Without this, VC6 would complains about stack abuse. 
    {
        if ( iPaused ) //resume
        {
        switch ( iAction )
            {
            case K_TC9_NewFileNameWhenPaused : 
                {
                    
                AddDriveLetterToPath(_L("NewFileName.3gp"), iFileName );
                    
                iAction=K_Tc9_none;     
                
                TMMFFileParams params;
                params.iPath = iFileName;
                TPckgC<TMMFFileParams> pckg(params);
                
                TUid controllerUid = {0x101F8503};	// controller implementation interface uid
                TInt err = iCamc->CustomCommandSync( TMMFMessageDestination( controllerUid, KMMFObjectHandleController ), ECamCControllerCCNewFilename, pckg, KNullDesC8);
                if (err)
                    {
                    User::Leave(err);
                    }
                break;
                }
            default:   
                iPaused = EFalse;
                iCamc->Record();
            }
        }
    
    else //timer
        {
        switch ( iAction )
            {
            case K_TC9_NewFileNameWhenRecording : 
                {
                AddDriveLetterToPath(_L("NewFileName.3gp"), iFileName );
                
                TMMFFileParams params;
                params.iPath = iFileName;
                TPckgC<TMMFFileParams> pckg(params);
                
                TUid controllerUid = {0x101F8503};	// controller implementation interface uid
                TInt err = iCamc->CustomCommandSync( TMMFMessageDestination( controllerUid, KMMFObjectHandleController ), ECamCControllerCCNewFilename, pckg, KNullDesC8);
                if (err)
                    {
                    User::Leave(err);
                    }
                break;
                }            
            case K_TC9_NewFileNameWhenPaused:
                {
                iCamc->PauseL();
                CTimer::After(2 * TInt32 ( 1E6 ) ); // Pause for 2 seconds.
                iPaused=ETrue;
                break;
                }
            default:
                iCamc->Stop();        // Simulates that iRecording has been completed through the 
                // MvruoRecordComplete callback
                iRecordingReady=ETrue;				
                CTimer::After( 1000 );
            }       
        }
    
    
    }
/** Get position info data from RProperty published from modules

@param aBlob pointer to a TPositionInfoBase object.
@param aBlobSize size of blob.
@param aTargetTime The target time for the position data.
@param aActualTime The actually time for the position data.
@param aAttributes Extra bit field that carries extra information for this update.
                   The values to use are defined in TPositionInfoAttributes.

@see TPositionInfoAttributes
@see TPositionInfoBase

@return Symbian Location service Error code

@released
@internalComponent
*/
EXPORT_C TInt RLbsPositionUpdates::GetPositionInfo(TBool& aConflictControl, TAny* aBlob, 
												   TUint aBlobSize, TTime& aTargetTime, 
												   TTime& aActualTime, TUint& aAttributes,
												   TUint& aGpsMode) const
	{
	__ASSERT_DEBUG(iProperty.Handle()!=NULL, User::Invariant());		//Handle not open.
	
	aConflictControl = EFalse;
	
	TLbsPositionUpdateData data;
	TLbsPositionUpdateDataPckg pckg(data);
	TInt err = const_cast<RLbsPositionUpdates*>(this)->iProperty.Get(pckg);
	if(err!=KErrNone)
		{
		return err;
		}
	// is the data contained valid?
	if(data.iValidData==EFalse)
		{
		return KErrNotReady; // nothing has been published yet
		}
		
	// Is it a special conflict control message
	aConflictControl = data.iConflictControl;
	
	// was there an error from the agps manager
	err = data.iError;
	if(err < KErrNone)
		{
		return data.iError;
		}
	aTargetTime = data.iTargetTime;
	aActualTime = data.iActualTime;
	aAttributes = data.iAttributes;
	aGpsMode = data.iGpsMode;
	
	if(sizeof(TPositionExtendedSatelliteInfo) != aBlobSize)
	    {	
	    if(sizeof(TPositionSatelliteInfo) != aBlobSize) 
	        {
		    if (sizeof(TPositionCourseInfo) != aBlobSize)
		        {
			    if (sizeof(TPositionInfo) != aBlobSize)
			        {
				    return KErrNotSupported;
			        }
		        }
	        }
	    }
	// skip header (i.e leave type same as passed by getter) 
	// and copy as much data as has been requested  
	TUint8* destAddr = reinterpret_cast<TUint8*>(aBlob)+sizeof(TPositionClassTypeBase);
	TUint8* srcAddr = reinterpret_cast<TUint8*>(&data.iSatInfo[0]) + sizeof(TPositionClassTypeBase);

	if (aBlobSize > data.iBytesWritten)
		{
		return KErrArgument;
		}
	
	TUint8* endAddr2 = Mem::Copy(destAddr, srcAddr, aBlobSize-sizeof(TPositionClassTypeBase));
	
	//If some error code is associated to this update, return that
	if(data.iError != KErrNone)
		{
		err = data.iError;
		}

	return err;	
	}
// ----------------------------------------------------------------------------
// CUSBUIQueriesNotifier::GetParamsL
// ----------------------------------------------------------------------------
//
void CUSBUIQueriesNotifier::StartDialogL(const TDesC8& aBuffer,
        TInt aReplySlot, const RMessagePtr2& aMessage)
    {
    FLOG(_L("[USBUINOTIF]\t  CUSBUIQueriesNotifier::StartDialogL"));
    if ( iReplySlot != 0 || iNeedToCompleteMessage)
        {
        User::Leave( KErrInUse );
        }
        
    InitializeTextResolver();

    iMessage = aMessage;
    iNeedToCompleteMessage = ETrue;
    iReplySlot = aReplySlot;

    // Get parameters 
    //
    TUSBQueriesNotiferParams params; //stores parameters from aBuffer
    TPckgC<TUSBQueriesNotiferParams> pckg( params );
    pckg.Set( aBuffer );
    // Save the type of the query for later use (dialog selection)
    //
    iQueryType = pckg().iQuery;
         
    if (iUSBQueryDlg)
        {
        delete iUSBQueryDlg;
        iUSBQueryDlg = NULL;
        }
    iUSBQueryDlg = CHbDeviceMessageBoxSymbian::NewL(
                       CHbDeviceMessageBoxSymbian::EWarning, this);
    iUSBQueryDlg->SetTimeout(0);
    HBufC* stringHolder = NULL;
    switch (iQueryType)
            {
            case EUSBStorageMediaFailure:
                {
                _LIT(KMassStorageFail, "txt_usb_info_unable_to_show_a_memory_to_other_devi");
                stringHolder = HbTextResolverSymbian::LoadLC( KMassStorageFail );
                 break;
                }
            case EUSBDiskFull:
                {
                _LIT(KDiskFull, "txt_usb_info_disk_full_remove_some_files_and_try");
                stringHolder = HbTextResolverSymbian::LoadLC( KDiskFull );
		         break;
                }
            case EUSBNotEnoughRam:
                {
                _LIT(KNotEnoughMemory, "txt_usb_info_memory_full_close_some_applications");
                 stringHolder = HbTextResolverSymbian::LoadLC( KNotEnoughMemory );
                 break;
                }
            default:
                {
                FTRACE( FPrint( _L( "[USBUINOTIF]\t CUSBUIQueriesNotifier::ERROR! Unknown query type: %d" ),iQueryType ) );
                }
            }
   
    if (stringHolder)
        {
        iUSBQueryDlg->SetTextL(*stringHolder);
        }
        
    iUSBQueryDlg->ShowL();
    FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::StartDialogL() ShowL returned"));     
    
    CleanupStack::PopAndDestroy( stringHolder );
    
    
    FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::StartDialogL completed"));
    }
Пример #27
0
void CViewSubSessionBase::CountL(const RMessage2& aMessage) const
	{
	TPckgBuf<TInt> pckg(iView->CountL());
	aMessage.WriteL(0,pckg);
	}
Пример #28
0
void CGavdp::SendResponse( TInternalAvdtpAirIndication aIndication,
						  TInt aResult,
						  const TAny* aResponseData/*=NULL*/,
						  TInt aResponseDataLen/*=0*/)
	{
	TInt err = KErrNone;
	
	switch (aIndication.iIndication)
		{
		case EAvdtpSetConfiguration:
		case EAvdtpReconfigure:
			{
			TAvdtpInternalConfigurationResponse rsp;
			rsp.iSEID = aIndication.iSEID;
			rsp.iTransactionLabel = aIndication.iTransactionLabel;
			rsp.iResult = aResult;
			rsp.iIsReconfigure = aIndication.iIndication==EAvdtpReconfigure;
			
			if (aResult!=KErrNone)
				{
				__ASSERT_DEBUG(aResponseData, Panic(EGavdpResponseDataExpected));
				rsp.iCategory = *static_cast<const TAvdtpServiceCategory*>(aResponseData);
				}
	
			TPckg<TAvdtpInternalConfigurationResponse> pckg(rsp);
			
			err = AvdtpRequester().SetOpt(ESendConfigurationResponse, KSolBtAVDTPSignalling, pckg);
			
			break;
			}
		case EAvdtpSecurityControl:
			{
			// optional to send data in response
			TAvdtpInternalSecurityControlResponse rsp;
			rsp.iSEID = aIndication.iSEID;
			rsp.iTransactionLabel = aIndication.iTransactionLabel;
			rsp.iResult = aResult;

			if (aResult==KErrNone)
				{
				rsp.iSecurityControlInfo.Copy(static_cast<const TUint8*>(aResponseData), aResponseDataLen);
				}
	
			TPckg<TAvdtpInternalSecurityControlResponse> pckg(rsp);			
			err = AvdtpRequester().SetOpt(ESendSecurityControlResponse, KSolBtAVDTPSignalling, pckg);
			
			break;
			}
		case EAvdtpStart:
			{
			TAvdtpInternalStartResponse rsp;
			rsp.iSEID = aIndication.iSEID;
			rsp.iTransactionLabel = aIndication.iTransactionLabel;
			rsp.iResult = aResult;

			TPckg<TAvdtpInternalStartResponse> pckg(rsp);
			err = AvdtpRequester().SetOpt(ESendStartResponse, KSolBtAVDTPSignalling, pckg);		
			
			break;
			}
		case EAvdtpSuspend:
			{
			TAvdtpInternalSuspendResponse rsp;
			rsp.iSEID = aIndication.iSEID;
			rsp.iTransactionLabel = aIndication.iTransactionLabel;
			rsp.iResult = aResult;

			TPckg<TAvdtpInternalSuspendResponse> pckg(rsp);
			err = AvdtpRequester().SetOpt(ESendSuspendResponse, KSolBtAVDTPSignalling, pckg);
			
			break;
			}
		}	

	if (err!=KErrNone)
		{
		iServiceUser.GAVDP_Error(err, KNullDesC8);
		}
	}