sl@0: // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: sl@0: sl@0: // INCLUDE FILES sl@0: #include sl@0: #include sl@0: #include "featmgrclient.h" sl@0: #include "featmgrconfiguration.h" sl@0: #include "featmgrdebug.h" sl@0: #include "featmgrclientserver.h" sl@0: sl@0: // CONSTANTS sl@0: const TInt KRetry( 2 ); sl@0: sl@0: // ============================= LOCAL FUNCTIONS =============================== sl@0: sl@0: // ============================ MEMBER FUNCTIONS =============================== sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::RFeatMgrClient sl@0: // C++ default constructor can NOT contain any code, that sl@0: // might leave. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: RFeatMgrClient::RFeatMgrClient() sl@0: : RSessionBase(), iFeaturePckg( NULL, 0, 0 ) sl@0: { sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::Connect sl@0: // Connects to server sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::Connect() sl@0: { sl@0: FUNC_LOG sl@0: sl@0: // Try this twice sl@0: TInt retry( KRetry ); sl@0: TInt err( KErrNone ); sl@0: sl@0: while ( retry > 0 ) sl@0: { sl@0: // Try to create a FeatMgr Server session sl@0: err = CreateSession( KServerProcessName, sl@0: ServerVersion(), sl@0: KDefaultAsyncSlots ); sl@0: sl@0: LOG_IF_ERROR1( err, "RFeatMgrClient::Connect - CreateSession returned: %d", err ); sl@0: sl@0: if ( err != KErrNotFound && err != KErrServerTerminated ) sl@0: { sl@0: // KErrNone or unrecoverable error sl@0: retry = 0; sl@0: } sl@0: else sl@0: { sl@0: // Return code was KErrNotFound or KErrServerTerminated. sl@0: // Try to start a new FeatMgr Server sl@0: err = StartServer(); sl@0: sl@0: LOG_IF_ERROR1( err, "RFeatMgrClient::Connect - StartServer returned: %d", err ); sl@0: sl@0: if ( err != KErrNone && err != KErrAlreadyExists ) sl@0: { sl@0: // Unrecoverable error sl@0: retry = 0; sl@0: } sl@0: } sl@0: sl@0: retry--; sl@0: } sl@0: sl@0: return err; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::StartServer sl@0: // Starts server. sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::StartServer() sl@0: { sl@0: FUNC_LOG sl@0: TIMESTAMP( "StartServer start: " ) sl@0: sl@0: RProcess server; sl@0: const TUidType serverUid( KNullUid, KServerUid2, KNullUid ); sl@0: TInt err = server.Create( KServerExeName, // FeatMgrServer.exe sl@0: KNullDesC, // A descriptor containing data passed as sl@0: // an argument to the thread function of sl@0: // the new process's main thread, when it sl@0: // is first scheduled. sl@0: serverUid, // FeatMgr server UID sl@0: EOwnerProcess ); // Ownership of this process handle sl@0: sl@0: // Return error code if we couldn't create a process sl@0: if ( err == KErrNone ) sl@0: { sl@0: // Rendezvous is used to detect server start sl@0: TRequestStatus stat; sl@0: server.Rendezvous( stat ); sl@0: sl@0: if ( stat != KRequestPending ) sl@0: { sl@0: server.Kill( KErrNone ); // Abort startup sl@0: } sl@0: else sl@0: { sl@0: server.Resume(); // Logon OK - start the server sl@0: } sl@0: sl@0: INFO_LOG( "RFeatMgrClient::StartServer - Waiting server startup" ); sl@0: sl@0: User::WaitForRequest( stat ); // Wait for start or death sl@0: sl@0: INFO_LOG( "RFeatMgrClient::StartServer - Server startup wait finished" ); sl@0: sl@0: // We can't use the 'exit reason' if the server paniced as this sl@0: // is the panic 'reason' and may be '0' which cannot be distinguished sl@0: // from KErrNone sl@0: err = (server.ExitType() == EExitPanic)? KErrGeneral : stat.Int(); sl@0: sl@0: // We can close the handle now sl@0: server.Close(); sl@0: } sl@0: sl@0: TIMESTAMP( "StartServer end: " ) sl@0: sl@0: return err; sl@0: } sl@0: sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::ServerVersion sl@0: // Return version of server sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TVersion RFeatMgrClient::ServerVersion() const sl@0: { sl@0: return TVersion( KServerVersionMajor, KServerVersionMinor, KServerVersionBuild ); sl@0: } sl@0: sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::FeatureSupported() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::FeatureSupported( TFeatureEntry& aFeature ) const sl@0: { sl@0: TPckg pckg( aFeature ); sl@0: TPckgBuf pckgRet; sl@0: sl@0: TInt retval = SendReceive(EFeatMgrFeatureSupported, TIpcArgs( &pckg, &pckgRet )); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::FeatureSupported - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG2( "RFeatMgrClient::FeatureSupported - uid %d, supported %d", sl@0: aFeature.FeatureUid().iUid, pckgRet() ); sl@0: return pckgRet(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::FeaturesSupported() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::FeaturesSupported( RFeatureArray& aFeatures ) sl@0: { sl@0: TPckgBuf pckg; sl@0: sl@0: TInt retval( KErrNone ); sl@0: sl@0: TRAP( retval, SendRcvFeatureArrayL( aFeatures, pckg() ) ); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::FeaturesSupported - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::FeaturesSupported - return %d", pckg() ); sl@0: return pckg(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::EnableFeature() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::EnableFeature( TUid aFeature ) const sl@0: { sl@0: TPckgBuf pckg; sl@0: sl@0: TInt retval = SendReceive(EFeatMgrEnableFeature, TIpcArgs(aFeature.iUid, &pckg)); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::EnableFeature - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::EnableFeature - return %d", pckg() ); sl@0: return pckg(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::DisableFeature() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::DisableFeature( TUid aFeature ) const sl@0: { sl@0: TPckgBuf pckg; sl@0: sl@0: TInt retval = SendReceive(EFeatMgrDisableFeature, TIpcArgs(aFeature.iUid, &pckg)); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::DisableFeature - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::DisableFeature - return %d", pckg() ); sl@0: return pckg(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::SetFeature() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::SetFeature( TUid aFeature, TBool aEnable, TInt aData ) const sl@0: { sl@0: TPckgBuf pckg; sl@0: sl@0: TInt retval = SendReceive(EFeatMgrSetFeatureAndData, TIpcArgs( sl@0: aFeature.iUid, aEnable, aData, &pckg)); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::SetFeature - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::SetFeature - return %d", pckg() ); sl@0: return pckg(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::SetFeature() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::SetFeature( TUid aFeature, TInt aData ) const sl@0: { sl@0: TPckgBuf pckg; sl@0: sl@0: TInt retval = SendReceive(EFeatMgrSetFeatureData, TIpcArgs( sl@0: aFeature.iUid, aData, &pckg)); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::SetFeature - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::SetFeature - return %d", pckg() ); sl@0: return pckg(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::AddFeature() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::AddFeature( TFeatureEntry aFeature ) const sl@0: { sl@0: TPckg pckg( aFeature ); sl@0: TPckgBuf pckgRet; sl@0: sl@0: TInt retval = SendReceive(EFeatMgrAddFeature, TIpcArgs(&pckg, &pckgRet)); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::AddFeature - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::AddFeature - return %d", pckgRet() ); sl@0: return pckgRet(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::DeleteFeature() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::DeleteFeature( TUid aFeature ) const sl@0: { sl@0: TPckgBuf pckg; sl@0: sl@0: TInt retval = SendReceive(EFeatMgrDeleteFeature, TIpcArgs(aFeature.iUid, &pckg)); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::DeleteFeature - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::DeleteFeature - return %d", pckg() ); sl@0: return pckg(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::ListSupportedFeaturesL() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: void RFeatMgrClient::ListSupportedFeaturesL( RFeatureUidArray& aSupportedFeatures ) sl@0: { sl@0: // Reset as array might contain old data. sl@0: aSupportedFeatures.Reset(); sl@0: TInt retry( 5 ); sl@0: TInt err( KErrNone ); sl@0: TInt count; sl@0: TPckg sizePckg( count ); sl@0: sl@0: while ( retry > 0 ) sl@0: { sl@0: User::LeaveIfError( SendReceive( EFeatMgrNumberOfSupportedFeatures, sl@0: TIpcArgs( &sizePckg ) ) ); sl@0: sl@0: HBufC8* buf = HBufC8::NewLC( count * sizeof( TInt ) ); sl@0: TPtr8 ptr = buf->Des(); sl@0: sl@0: err = SendReceive( EFeatMgrListSupportedFeatures, TIpcArgs( count, &ptr ) ); sl@0: LOG_IF_ERROR1( err, "RFeatMgrClient::ListSupportedFeaturesL - SendReceive error %d", err ); sl@0: INFO_LOG1( "RFeatMgrClient::ListSupportedFeaturesL - count %d", count ); sl@0: sl@0: if ( err == KErrNone ) sl@0: { sl@0: aSupportedFeatures.ReserveL( count ); sl@0: sl@0: for ( TInt i = 0; i < count; i++ ) sl@0: { sl@0: TPtrC8 featurePtr = ptr.Mid( i * sizeof( TUid ), sizeof( TUid ) ); sl@0: TUid featureId = TUid::Uid( 0 ); sl@0: TPckg feature( featureId ); sl@0: feature.Copy( featurePtr ); sl@0: aSupportedFeatures.AppendL( featureId ); sl@0: } sl@0: sl@0: retry = 0; sl@0: } sl@0: else if ( err == KErrServerBusy ) sl@0: { sl@0: retry--; sl@0: } sl@0: else sl@0: { sl@0: User::Leave( err ); sl@0: } sl@0: CleanupStack::PopAndDestroy( buf ); sl@0: } sl@0: sl@0: User::LeaveIfError( err ); sl@0: } sl@0: sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::ReRequestNotification(TUid&, TRequestStatus&) sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: void RFeatMgrClient::ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus ) sl@0: { sl@0: TPckgBuf pckg; sl@0: iFeaturePckg.Set( (TUint8*) &aFeatUid.iUid, sizeof(TUid), sizeof(TUid) ); sl@0: TIpcArgs args( &iFeaturePckg ); sl@0: SendReceive( EFeatMgrReqNotify, args, aStatus ); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::RequestNotification(RFeatureUidArray&, TUid&, TRequestStatus&) sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::RequestNotification( RFeatureUidArray& aFeatures, sl@0: TUid& aFeatUid, TRequestStatus& aStatus ) sl@0: { sl@0: TPckgBuf pckg; sl@0: sl@0: TInt retval( KErrNone ); sl@0: sl@0: TRAP( retval, SendUidArrayL( aFeatures, pckg() ) ); sl@0: sl@0: if ( retval == KErrNone ) sl@0: { sl@0: iFeaturePckg.Set( (TUint8*) &aFeatUid.iUid, sizeof(TUid), sizeof(TUid) ); sl@0: TIpcArgs args( &iFeaturePckg ); sl@0: SendReceive( EFeatMgrReqNotify, args, aStatus ); sl@0: } sl@0: else sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::RequestNotification - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::RequestNotification - return %d", pckg() ); sl@0: return pckg(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::RequestNotifyCancel(TUid) sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::RequestNotifyCancel( TUid aFeature ) const sl@0: { sl@0: TPckgBuf pckg; sl@0: sl@0: TInt retval = SendReceive(EFeatMgrReqNotifyCancel, TIpcArgs(aFeature.iUid, &pckg)); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::RequestNotifyCancel - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::RequestNotifyCancel - return %d", pckg() ); sl@0: return pckg(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::RequestNotifyCancelAll() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::RequestNotifyCancelAll() const sl@0: { sl@0: TPckgBuf pckg; sl@0: sl@0: TInt retval = SendReceive(EFeatMgrReqNotifyCancelAll, TIpcArgs(&pckg)); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::RequestNotifyCancelAll - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::RequestNotifyCancelAll - return %d", pckg() ); sl@0: return pckg(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::SendUidArrayL() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: void RFeatMgrClient::SendUidArrayL( RFeatureUidArray& aFeatures, TInt &retval) sl@0: { sl@0: FUNC_LOG sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::SendUidArrayL - Send %d features", aFeatures.Count() ); sl@0: sl@0: TInt size = aFeatures.Count() * sizeof(TUid); sl@0: CBufBase* buffer = CBufFlat::NewL( size ); sl@0: CleanupStack::PushL( buffer ); sl@0: buffer->ResizeL( size ); sl@0: sl@0: RBufWriteStream stream( *buffer ); sl@0: CleanupClosePushL( stream ); sl@0: sl@0: TInt count = aFeatures.Count(); sl@0: // Write each field in array to stream sl@0: for(TInt i = 0; i < count; i++) sl@0: { sl@0: stream.WriteUint32L( aFeatures[i].iUid ); sl@0: } sl@0: sl@0: stream.CommitL(); sl@0: sl@0: // Write transfer buffer to server sl@0: TPtr8 pBuffer(buffer->Ptr(0)); sl@0: TPckgBuf pckg; sl@0: TIpcArgs args( count, &pBuffer, &pckg ); sl@0: TInt sendErr = SendReceive( EFeatMgrReqNotifyUids, args ); sl@0: sl@0: retval = pckg(); sl@0: sl@0: CleanupStack::PopAndDestroy( &stream ); sl@0: CleanupStack::PopAndDestroy( buffer ); sl@0: User::LeaveIfError( sendErr ); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::SendRcvFeatureArrayL() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: void RFeatMgrClient::SendRcvFeatureArrayL( RFeatureArray& aFeatures, TInt &retval) sl@0: { sl@0: FUNC_LOG sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::SendRcvFeatureArrayL - Send %d features", aFeatures.Count() ); sl@0: sl@0: TInt size = aFeatures.Count() * sizeof(TFeatureEntry); sl@0: CBufBase* buffer = CBufFlat::NewL( size ); sl@0: CleanupStack::PushL( buffer ); sl@0: buffer->ResizeL( size ); sl@0: sl@0: RBufWriteStream stream( *buffer ); sl@0: CleanupClosePushL( stream ); sl@0: sl@0: TInt count = aFeatures.Count(); sl@0: // Write each field in array to stream sl@0: for(TInt i = 0; i < count; i++) sl@0: { sl@0: TFeatureEntry entry( aFeatures[i].FeatureUid(), aFeatures[i].FeatureFlags(), sl@0: aFeatures[i].FeatureData() ); sl@0: stream.WriteUint32L( aFeatures[i].FeatureUid().iUid ); sl@0: stream.WriteUint32L( aFeatures[i].FeatureFlags().iFlags ); sl@0: stream.WriteUint32L( aFeatures[i].FeatureData() ); sl@0: stream.WriteUint32L( 0 ); // reserved sl@0: } sl@0: sl@0: stream.CommitL(); sl@0: sl@0: // Write transfer buffer to server sl@0: TPtr8 pBuffer(buffer->Ptr(0)); sl@0: TPckgBuf pckg; sl@0: TIpcArgs args( count, &pBuffer, &pckg ); sl@0: TInt sendErr = SendReceive( EFeatMgrFeaturesSupported, args ); sl@0: sl@0: if ( sendErr == KErrNone ) sl@0: { sl@0: TInt responseCount = pckg(); sl@0: // Read modified feature entries back to array sl@0: RBufReadStream readStream( *buffer ); sl@0: CleanupClosePushL( readStream ); sl@0: aFeatures.Reset(); sl@0: aFeatures.ReserveL( responseCount ); sl@0: sl@0: for ( TInt i = 0; i < responseCount; i++ ) sl@0: { sl@0: TUid uid = TUid::Uid( readStream.ReadUint32L() ); sl@0: TBitFlags32 flags = readStream.ReadUint32L(); sl@0: TUint32 data = readStream.ReadUint32L(); sl@0: readStream.ReadUint32L(); // reserved sl@0: TFeatureEntry entry( uid, flags, data ); sl@0: aFeatures.AppendL( entry ); sl@0: } sl@0: sl@0: CleanupStack::PopAndDestroy( &readStream ); sl@0: } sl@0: sl@0: retval = KErrNone; // Currently no error response exist. sl@0: sl@0: CleanupStack::PopAndDestroy( &stream ); sl@0: CleanupStack::PopAndDestroy( buffer ); sl@0: User::LeaveIfError( sendErr ); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::SWIStart() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::SWIStart() const sl@0: { sl@0: TPckgBuf pckg; sl@0: sl@0: TInt retval = SendReceive(EFeatMgrSWIStart, TIpcArgs(&pckg)); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::SWIStart - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::SWIStart - return %d", pckg() ); sl@0: return pckg(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::SWIEnd() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::SWIEnd() const sl@0: { sl@0: TPckgBuf pckg; sl@0: sl@0: TInt retval = SendReceive(EFeatMgrSWIEnd, TIpcArgs(&pckg)); sl@0: sl@0: if ( retval != KErrNone ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::SWIEnd - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::SWIEnd - return %d", pckg() ); sl@0: return pckg(); sl@0: } sl@0: sl@0: // ========================== OTHER EXPORTED FUNCTIONS ========================= sl@0: sl@0: // DEBUG only API functions sl@0: sl@0: #ifdef EXTENDED_FEATURE_MANAGER_TEST sl@0: sl@0: #pragma BullseyeCoverage off sl@0: sl@0: /** sl@0: */ sl@0: void RFeatMgrClient::ResourceMark() sl@0: { sl@0: (void)SendReceive(EFeatMgrResourceMark); sl@0: } sl@0: sl@0: /** sl@0: */ sl@0: void RFeatMgrClient::ResourceCheck() sl@0: { sl@0: (void)SendReceive(EFeatMgrResourceCheck); sl@0: } sl@0: sl@0: /** sl@0: */ sl@0: TInt RFeatMgrClient::ResourceCount() sl@0: { sl@0: return SendReceive(EFeatMgrResourceCount); sl@0: } sl@0: sl@0: /** sl@0: */ sl@0: void RFeatMgrClient::SetHeapFailure(TInt aAllocFailType, TInt aRate) sl@0: { sl@0: (void)SendReceive(EFeatMgrSetHeapFailure, TIpcArgs(aAllocFailType, aRate)); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::NumberOfNotifyFeatures() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::NumberOfNotifyFeatures( void ) const sl@0: { sl@0: TInt count; sl@0: TPckg sizePckg( count ); sl@0: sl@0: TInt retval = SendReceive( EFeatMgrNumberOfNotifyFeatures, TIpcArgs( &sizePckg ) ); sl@0: if ( KErrNone != retval ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::NumberOfNotifyFeatures - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::NumberOfNotifyFeatures - return %d", sizePckg() ); sl@0: return sizePckg(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // RFeatMgrClient::CountAllocCells() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: TInt RFeatMgrClient::CountAllocCells( void ) const sl@0: { sl@0: TInt count; sl@0: TPckg sizePckg( count ); sl@0: sl@0: TInt retval = SendReceive( EFeatMgrCountAllocCells, TIpcArgs( &sizePckg ) ); sl@0: if ( KErrNone != retval ) sl@0: { sl@0: ERROR_LOG1( "RFeatMgrClient::CountAllocCells - SendReceive error %d", retval ); sl@0: return retval; sl@0: } sl@0: sl@0: INFO_LOG1( "RFeatMgrClient::CountAllocCells - return %d", sizePckg() ); sl@0: return sizePckg(); sl@0: } sl@0: sl@0: #pragma BullseyeCoverage on sl@0: sl@0: #endif sl@0: sl@0: // End of File