//---------------------------------------------------------------- // CLbsLocMonitorConversionHandler::CancelLocationInfoConversionL // (other items were commented in a header). //---------------------------------------------------------------- void CLbsLocMonitorConversionHandler::CancelLocationInfoConversionL( const RMessage2& aMessage) { LBSLOG(ELogP1,"CLbsLocMonitorConversionHandler::CancelLocationInfoConversionL()"); // Iterate through the queue to find the corresponding message // on which cancelled is called. // If the cancel is called on the request under process, that // corresponding message should be cancelled else that message // should be removed from the queue. for(TInt i=0;i<iValidationRequestQueue.Count();i++) { if(CompareMessage(iValidationRequestQueue[i],aMessage)) { // If the current request has been sent to validation or conversion, // we need to cancel it if(i == KCurrentRequestIndex) { // Cancel should be called on plugin based on current request. switch(iState) { case EStateValidation: iLocInfoConverterPlugIn->CancelValidateClient(); break; case EStateConversion: iLocInfoConverterPlugIn->CancelConvertLocationInfo(); break; default: break; } CompleteRequest(iValidationRequestQueue[i],KErrCancel); Cancel(); RequestCompleteL(); } else { RMessage2 message = iValidationRequestQueue[i]; iValidationRequestQueue.Remove(i); message.Complete(KErrCancel); } aMessage.Complete(KErrNone); return; } } }
// -------------------------------------------------------------------------- // CTacticonSession::ServiceL // From CSession2, passes the request forward to DispatchMessageL. // -------------------------------------------------------------------------- // void CTacticonSession::ServiceL( const RMessage2& aMessage ) { TRACE( "CTacticonSession::ServiceL - Begin" ); TRAPD( err,DispatchMessageL( aMessage ) ); aMessage.Complete( err ); TRACE( "CTacticonSession::ServiceL - End" ); }
// ---------------------------------------------------------------------------------------- // CDCMOSession::ServiceL // ---------------------------------------------------------------------------------------- void CDCMOSession::ServiceL(const RMessage2& aMessage) { RDEBUG("CDCMOSession::ServiceL"); TRAPD(err,DispatchMessageL(aMessage)); if(err) RDEBUG_2("CDCMOSession::ServiceL - err %d", err ); aMessage.Complete(err); }
void CApaAppServiceBase::CancelNotifyServerExit(const RMessage2& aMessage) const { if (!iNotifyExitMsg.IsNull()) { iNotifyExitMsg.Complete(KErrCancel); } aMessage.Complete(KErrNone); }
void CCntPropertiesMsgHandler::FileUniqueIdL(const RMessage2& aMessage) { // Maps to RCntModel::FileUidL(). CheckForManagerL(); aMessage.WriteL(0, iManager->GetPersistenceLayer().ContactProperties().UniqueIdL()); aMessage.Complete(KErrNone); }
// ============================================================================ // CCwrtRegistryServerSession::ServiceError() // Handles leaves from ServiceL() // // ============================================================================ // void CCwrtRegistryServerSession::ServiceError( const RMessage2& aMessage, TInt& aError ) { const TInt function = aMessage.Function(); // supply the correct error return message params for each opcode switch ( function ) { case EOpCodeRegisterWidget: aMessage.Complete( EFalse ); break; case EOpCodeDeRegisterWidget: aMessage.Complete( EFalse ); break; case EOpCodeGetWebAttribute: aMessage.Complete( aError ); break; case EOpCodeSetWebAttribute: aMessage.Complete( EFalse ); break; case EOpCodeNativeIdToAppId: aMessage.Complete( 0 ); break; case EOpCodeWidgetRegistryDisconnect: aMessage.Complete( aError ); break; default: aMessage.Complete( aError ); break; } }
void CCntFileManagerMsgHandler::GetDefaultDatabaseNameL(const RMessage2& aMessage) { // Non file-specific. Does not require manager instance. TBuf<KCntMaxFilePath> path; // Call controller to retrieve default database name. Server().Controller().DefaultDatabaseL(path); aMessage.WriteL(0,path); aMessage.Complete(KErrNone); }
// --------------------------------------------------------------------------- // CCmMdhSession::CompleteIfBusy // Completes message with busy error code if server is busy // --------------------------------------------------------------------------- TBool CCmMdhSession::CompleteIfBusy(const RMessage2& aMessage) { if (iServer.ServerState()) // operation already in progress { aMessage.Complete(KErrInUse); return ETrue; } return EFalse; }
void CLbsLocMonitorSession::HandleDatabaseWipeoutL(const RMessage2& aMessage) { LBSLOG(ELogP1,"CLbsLocMonitorSession::HandleDatabaseWipeout()"); const CLbsLocMonitorServer* server = static_cast<const CLbsLocMonitorServer*>(Server()); TInt err = server->ReadRequestHandler().DeleteDatabaseL(); aMessage.Complete(err); }
void CCntItemMsgHandler::SetSortPrefsL(const RMessage2& aMessage) { CheckForManagerL(); iPackager.SetBufferFromMessageL(aMessage); CArrayFix<CContactDatabase::TSortPref>* prefs = iPackager.UnpackCArrayFixLC(); iManager->GetPersistenceLayer().ContactProperties().SetSortPrefsL(prefs); CleanupStack::Pop(prefs); aMessage.Complete(KErrNone); }
void CCntFileManagerMsgHandler::FetchGroupIdListsL(const RMessage2& aMessage) { CheckForManagerL(); CContactIdArray& arrayPtr = iManager->GetPersistenceLayer().ContactProperties().GroupIdListL(); TPtr8 cntIDBuff = iPackager.PackL(arrayPtr); TInt length = cntIDBuff.Length(); // Write data if client buffer is large enough otherwise return the // required buffer size. if(aMessage.GetDesMaxLength(0) >= length) { aMessage.WriteL(0, cntIDBuff); aMessage.Complete(KErrNone); } else { aMessage.Complete(length); } }
/** * Completes client message * * @internalComponent * * @param aMessageMessage to be completed. * @param aErrorCode error code used to complete the message. * @post message is completed. */ void CConfigSession::CompleteClientMessage( const RMessage2& aMessage, const TInt aErrorCode) { if (!aMessage.IsNull()) { aMessage.Complete(aErrorCode); } }
void CCntPropertiesMsgHandler::MachineIdL(const RMessage2& aMessage) { // Maps to RCntModel::MachineId(). CheckForManagerL(); TPckg<TInt64> pckg(iManager->GetPersistenceLayer().ContactProperties().MachineIdL()); aMessage.WriteL(0,pckg); aMessage.Complete(KErrNone); }
void CCntFileManagerMsgHandler::DeleteDatabaseL(const RMessage2& aMessage) { // Non file-specific. Does not require manager instance. // Full name and path. Path length is validated on client-side. TBuf<KCntMaxFilePath> path; aMessage.ReadL(0,path); Server().Controller().DeleteDatabaseL(path); aMessage.Complete(KErrNone); }
void CSuplProxyPosSubSession::HandleClose(const RMessage2& aMessage) { LBSLOG(ELogP1, "CSuplProxyPosSubSession::HandleClose() Begin\n"); TInt err = iPosProtocol.NotifySubSessionClose(iRequestId); aMessage.Complete(err); LBSLOG(ELogP1, "CSuplProxyPosSubSession::HandleClose() End\n"); }
// --------------------------------------------------------------------------- // CPresenceCacheSession::HandlePrepReadPresenceInfoSyncL() // --------------------------------------------------------------------------- // void CPresenceCacheSession::HandlePrepReadPresenceInfoSyncL( const RMessage2& aMessage ) { TRACE( _L("CPresenceCacheSession::HandlePrepReadPresenceInfoSyncL - begin")); TInt sizeOfReturnPacket(NULL); // unpacking identity const TInt pckSize = aMessage.GetDesLengthL(1); HBufC8* idPack = HBufC8::NewLC( pckSize ); TPtr8 paramPckPtr = idPack->Des(); aMessage.ReadL( 1, paramPckPtr ); CXIMPIdentityImp* identity = CXIMPIdentityImp::NewLC(); TXIMPObjectPacker< CXIMPIdentityImp >::UnPackL(*identity, *idPack); TPtrC serviceName = GetServiceName(identity->Identity()); // now processing TInt serviceCount = iServer.iPresenceCache.Count(); MPresenceBuddyInfo* buddyPresenceInfo(NULL); CPresenceCacheBuddyStore* buddyStore(NULL); TRACE_1( _L("_______serviceCount[%d]"), serviceCount); for(TInt i=0; i<serviceCount; i++) { if (serviceName == (iServer.iPresenceCache[i])->ServiceName()) { buddyStore = (iServer.iPresenceCache[i])->FindAndGet(*identity); if(buddyStore) buddyPresenceInfo = buddyStore->PresenceBuddyInfo(); break; } } CleanupStack::PopAndDestroy(identity); CleanupStack::PopAndDestroy(idPack); TInt err = KErrNotFound; TRACE_1( _L("_______buddyPresenceInfo[%d]"), buddyPresenceInfo); if(buddyPresenceInfo) // if found { const CPresenceInfoImp* presInfo = TXIMPGetImpClassOrPanic< const CPresenceInfoImp >::From(*(buddyPresenceInfo->PresenceInfo())); if(iDataPack) delete iDataPack; iDataPack=NULL; iDataPack = PackPresenceInfoLC(*presInfo); CleanupStack::Pop(iDataPack); sizeOfReturnPacket = (iDataPack->Des()).Size(); err = KErrNone; } TPckgBuf<TInt> p(sizeOfReturnPacket); aMessage.WriteL(2,p); aMessage.Complete(err); TRACE( _L("CPresenceCacheSession::HandlePrepReadPresenceInfoSyncL - end")); }
/** * Handle broadccast message request * @param storage - observer tasks storage * @param msg - request message that will be provided to observers */ void AfBroadcastTask::ExecuteL(MAfTaskStorage& storage, const RMessage2& msg) { const RPointerArray<CAfTask> &tasks(storage.StorageData()); for (TInt iter(tasks.Count() - 1); iter >= 0 ; --iter ) { (tasks[iter])->BroadcastReceivedL(msg); } msg.Complete(KErrNone); }
/** Submit a notification timeout request. @param aMessage The message from the client. */ void CSuplProxyPrivacySession::NotifyVerificationTimeout(const RMessage2& aMessage) { LBSLOG(ELogP1, "CSuplProxyPrivacySession::NotifyVerificationTimeout() Begin\n"); // NOTE: requestInfo does not complete the message in this case CSuplProxyPrivacyRequestInfo* requestInfo = NULL; TRAPD(err, requestInfo = CSuplProxyPrivacyRequestInfo::NewL(aMessage)); if (err != KErrNone) { // Error creating request info object, complete with the error and return aMessage.Complete(err); return; } TLbsExternalRequestInfo2 extRequestInfo; TPckg<TLbsExternalRequestInfo2> extRequestInfoPkg(extRequestInfo); aMessage.Read(0,extRequestInfoPkg); requestInfo->SetRequestInfo(extRequestInfo); requestInfo->SetRequestId(aMessage.Int1()); TLbsNetPosRequestPrivacy netPosRequestPrivacy; TPckg<TLbsNetPosRequestPrivacy> netPosRequestPrivacyPkg(netPosRequestPrivacy); aMessage.Read(2,netPosRequestPrivacyPkg); requestInfo->SetRequestPrivacy(netPosRequestPrivacy); requestInfo->SetIsResponseRequired(EFalse); if (!IsRequestInfoValid(*requestInfo)) { aMessage.Panic(KPosPrivacyPanicCategory, EPosPrivSrvPanicInvalidArguments); delete requestInfo; return; } // temporary. Since NRH state machine can't deal with receiving a second privacy request while waiting for a location request, complete the first session so we start a new one. iPrivacyProtocol.EndPrivacySession(aMessage.Int1(), KErrNone); iPrivacyProtocol.NotifyVerificationTimeout(requestInfo); aMessage.Complete(KErrNone); LBSLOG(ELogP1, "CSuplProxyPrivacySession::NotifyVerificationTimeout() End\n"); }
/** Handles the connect request from the client. We trap Leaves, to ensure that existing sessions aren't affected by failure to create a new one. @param aMessage The Connect message sent by the client requesting the connection. aMessage.Ptr0() is the required Version. */ EXPORT_C void CServer2::DoConnect(const RMessage2& aMessage) { ASSERT(aMessage.Function() == RMessage2::EConnect); ASSERT(aMessage.Session() == NULL); ASSERT(!aMessage.IsNull()); CSession2* newSession = NULL; TRAPD(err, DoConnectL(aMessage, newSession)); if (err != KErrNone) { // Connect failed delete newSession; aMessage.Complete(err); } else { ASSERT(newSession != NULL); CServer2* sessionServer = const_cast<CServer2*>(newSession->Server()); ASSERT(sessionServer != NULL); // The return value of Server() will be 'this', unless it was // changed by a call to SetServer(). if (sessionServer == this) { // no SetServer() call, so just complete the Connect message aMessage.Complete(err); } else { // Transfer the new Csession to the specified slave Cserver newSession->iLink.Deque(); sessionServer->iSessionQ.AddLast(*newSession); // Ask the kernel to transfer the DSession to the slave DServer. // Note: this Exec call also completes the Connect message. TInt msgHandle = aMessage.iHandle; const_cast<TInt&>(aMessage.iHandle) = 0; ASSERT(msgHandle); Exec::TransferSession(msgHandle, sessionServer->Server().Handle()); } } ASSERT(aMessage.IsNull()); }
void CConnectionSession::CompleteMessage(const RMessage2& aMessage, TInt aResult) { __ASSERT_DEBUG(!aMessage.IsNull(), User::Panic(KSpecAssert_ESockSSockscnctn, 6)); if(!aMessage.IsNull()) { LOG(ESockLog::Printf(KESockSessDetailTag, _L8("CConnectionSession(%08x):\tCompleteMessage(%08x) with %d"), this, aMessage.Handle(), aResult) ); aMessage.Complete(aResult); } __ASSERT_DEBUG(aMessage.IsNull(), User::Panic(KSpecAssert_ESockSSockscnctn, 7)); }
// --------------------------------------------------------- // CDownloadMgrSession::CounterFromHandle // --------------------------------------------------------- // void CDownloadMgrSession::ServiceL( const RMessage2& aMessage ) { CLOG_ENTERFN( "CDownloadMgrSession::ServiceL" ) TRAPD( err, DispatchMessageL( aMessage ) ); if( iComplete || ( KErrNone != err ) ) { // Only the syncron requests has to be completed here! aMessage.Complete( err ); } }
// ----------------------------------------------------------------------------- // ProcessServerShutdown // ----------------------------------------------------------------------------- // void CHotSpotSession::ProcessServerShutdown( const RMessage2& aMessage ) { DEBUG("CHotSpotSession::ProcessServerShutdown"); TInt shutdown; shutdown = ( TInt )aMessage.Int0(); if ( KHssShutdown == shutdown ) { DEBUG("CHotSpotSession::ProcessServerShutdown shutdown "); aMessage.Complete( KErrNone ); RProcess server; // Sets the handle-number to the KCurrentProcessHandle server.Kill( KErrNone ); } else { DEBUG("CHotSpotSession::ProcessServerShutdown else "); aMessage.Complete( KErrNone ); } }
// ----------------------------------------------------------------------------- // CPhSrvSubSessionEmergencyNum::CmdSubSessionDialEmergencyCallCancelL // // Cancel emergency call // // ----------------------------------------------------------------------------- // void CPhSrvSubSessionEmergencyNum::CmdSubSessionDialEmergencyCallCancelL( const RMessage2& aMessage ) { _DPRINT( 4, "PhSrv.CPhSrvSubSessionEmergencyNum.EMCancel" ); // debug print // Submit a new request to the call manager MPhSrvEmergencyNegotiatorCall& callNegotiator = PhoneSession().PhoneServer().EmergencyCallNegotiatorL(); callNegotiator.EmergencyDialCancel(); aMessage.Complete( KErrNone ); }
void CSuplProxyPrivacySession::PrivacyRequest(const RMessage2& aMessage, TInt aRequestId) { LBSLOG(ELogP1, "CSuplProxyPrivacySession::PrivacyRequest() Begin\n"); CSuplProxyPrivacyRequestInfo* requestInfo = NULL; TRAPD(err, requestInfo = CSuplProxyPrivacyRequestInfo::NewL(aMessage)); if (err != KErrNone) { // Error creating request info object, complete with the error and return aMessage.Complete(err); return; } requestInfo->SetRequestId(aRequestId); TLbsExternalRequestInfo2 extRequestInfo; TPckg<TLbsExternalRequestInfo2> extRequestInfoPkg(extRequestInfo); aMessage.Read(1,extRequestInfoPkg); requestInfo->SetRequestInfo(extRequestInfo); TLbsNetPosRequestPrivacy netPosRequestPrivacy; TPckg<TLbsNetPosRequestPrivacy> netPosRequestPrivacyPkg(netPosRequestPrivacy); aMessage.Read(2,netPosRequestPrivacyPkg); requestInfo->SetRequestPrivacy(netPosRequestPrivacy); requestInfo->SetIsResponseRequired(ETrue); requestInfo->SetIsSessionCompleteAutomatic(EFalse); requestInfo->SetConvertResponseCode(EFalse); if (!IsRequestInfoValid(*requestInfo)) { aMessage.Complete(netPosRequestPrivacy.RequestAction()); delete requestInfo; return; } iPrivacyProtocol.PrivacyLocationRequest(requestInfo); // The message should be completed later in this case LBSLOG(ELogP1, "CSuplProxyPrivacySession::PrivacyRequest() End\n"); }
void CCntFileManagerMsgHandler::DefinitionsOfExistingViewsL(const RMessage2& aMessage) { TFileName fileName; ReadL(aMessage,KSlot0,fileName); if (fileName.Length() == 0) { Server().Controller().DefaultDatabaseL(fileName); } RPointerArray<CContactDefaultViewDefinition> viewDefs; CleanupResetAndDestroyPushL(viewDefs); CCntDbManager* manager = Server().Controller().DbManagerL(fileName); if (manager) { manager->ViewManagerL().GetDefinitionsOfExistingViewsL(viewDefs); } // Compute the size of the buffer that is needed. CBufFlat* buffer = CBufFlat::NewL(32); CleanupStack::PushL(buffer); RBufWriteStream writeStream(*buffer); CleanupClosePushL(writeStream); const TInt32 count = viewDefs.Count(); writeStream << count; for (TInt i = 0; i < count; i++) { writeStream << *viewDefs[i]; } // Check that the client-side write buffer is large enough. TInt length = buffer->Size(); if(aMessage.GetDesMaxLength(1) >= length) { aMessage.WriteL(1, buffer->Ptr(0)); aMessage.Complete(KErrNone); } else { aMessage.Complete(length); } CleanupStack::PopAndDestroy(3, &viewDefs); // writeStream, buffer, viewDefs }
void CSuplProxyPosSubSession::HandleCancelGetPosition(const RMessage2& aMessage) { LBSLOG(ELogP1, "CSuplProxyPosSubSession::HandleCancelGetPosition() Begin\n"); TInt err = iPosProtocol.CancelNetworkGetPosition(aMessage, iRequestId); aMessage.Complete(err); LBSLOG(ELogP1, "CSuplProxyPosSubSession::HandleCancelGetPosition() End\n"); }
void CCntItemMsgHandler::GetSpeedDialContactIdAndPhoneNumberL(const RMessage2& aMessage) { CheckForManagerL(); const TInt speedDialIndex = aMessage.Int0(); TSpeedDialPhoneNumber phoneNumber; TContactItemId contactId; iManager->GetSpeedDialContactIdAndPhoneNumberL(speedDialIndex, phoneNumber, contactId); aMessage.WriteL(KSlot1, phoneNumber); aMessage.Complete(contactId); }
// ----------------------------------------------------------------------------- // TMSCallSession::ServiceL // Service request handler. // ----------------------------------------------------------------------------- // void TMSCallSession::ServiceL(const RMessage2& aMessage) { TRACE_PRN_FN_ENT; TRAPD(status, HandleMessageL(aMessage)); if (status != TMS_RESULT_SUCCESS) { aMessage.Complete(status); } TRACE_PRN_FN_EXT; }
void CMsmmSession::ServiceL(const RMessage2& aMessage) { OstTraceFunctionEntry0( CMSMMSESSION_SERVICEL_ENTRY ); TInt ret(KErrNone); #ifdef _DEBUG TInt* heapObj= NULL; #endif // _DEBUG switch (aMessage.Function()) { case EHostMsmmServerAddFunction: AddUsbMsInterfaceL(aMessage); break; case EHostMsmmServerRemoveDevice: RemoveUsbMsDeviceL(aMessage); break; // Supporting for server side OOM testing case EHostMsmmServerDbgFailNext: ret = KErrNone; #ifdef _DEBUG if (aMessage.Int0() == 0 ) { __UHEAP_RESET; } else { __UHEAP_FAILNEXT(aMessage.Int0()); } #endif // _DEBUG break; case EHostMsmmServerDbgAlloc: ret = KErrNone; #ifdef _DEBUG TRAP(ret, heapObj = new (ELeave) TInt); delete heapObj; #endif // _DEBUG break; case EHostMsmmServerEjectUsbDrives: iServer.DismountUsbDrivesL(iDevicePkg()); break; default: // Unsupported function number - panic the client PanicClient(aMessage, EBadRequest); } // Complete the request aMessage.Complete(ret); OstTraceFunctionExit0( CMSMMSESSION_SERVICEL_EXIT ); }
void CVwsSession::DeactivateActiveViewIfOwnerMatchL(const RMessage2& aMessage,TVwsCompleteRequest aCompleteRequest) { if(iServer.ActiveViewSession() == this) { return DeactivateActiveViewL(aMessage, aCompleteRequest); } else if(aCompleteRequest==ECompleteRequest) { aMessage.Complete(KErrNone); } }