Ejemplo n.º 1
0
void CClkAlmModel::ProcessResponderL(TInt aResult)
{
  if(aResult!=KErrCancel&&aResult!=KErrNone)
    NotifyL(aResult);
  else
    NotifyL(KErrNone);
}
Ejemplo n.º 2
0
void CUsbNotifier::ConstructL(void)
{
  User::LeaveIfError(iSysAgnt.Connect());
  iSysAgnt.SetEventBufferEnabled(ETrue);
  iEvent.SetUid(KUidUsbStatus);
  CActiveScheduler::Add(this);
  NotifyL();
}
TUint CBBSessionImpl::DoPutL(const TTupleName& aTupleName, const TDesC& aSubName, 
		const TComponentName& aComponentName,
		const MBBData* aData, const TTime& aLeaseExpires,
		TBool aReplace, TBool aIsReply, TBool aKeepExisting)
{
	CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("DoPutL"));

	refcounted_ptr<CRefCountedData> p(CRefCountedData::NewL(aData->CloneL(KEvent)));

	TRequestStatus s;
	TInt err=KErrNone;
	{
		TPtr8 bufp(iGetPutBuf->Des());
		RDesWriteStream ws(bufp);
		aData->Type().ExternalizeL(ws);
		CC_TRAPIGNORE(err, KErrOverflow, aData->ExternalizeL(ws));
		if (err==KErrNone) ws.CommitL();
	}
	while (err==KErrOverflow) {
		iGetPutBuf=iGetPutBuf->ReAllocL( iGetPutBuf->Des().MaxLength() *2);
		TPtr8 bufp(iGetPutBuf->Des());
		RDesWriteStream ws(bufp);
		aData->Type().ExternalizeL(ws);
		CC_TRAPIGNORE(err, KErrOverflow, aData->ExternalizeL(ws));
		if (err==KErrNone) ws.CommitL();
	}
	TUint id=0;
	iClientSession.Put(aTupleName, aSubName, aComponentName, *iGetPutBuf, EBBPriorityNormal, 
		aReplace, id, s, aLeaseExpires, ETrue, EFalse, aIsReply, aKeepExisting);

	User::WaitForRequest(s);
	if (! aIsReply ) {
		CC_TRAP(err, NotifyL(id, aTupleName, aSubName, aComponentName, p.get(), EByTuple));
	} else {
		CC_TRAP(err, NotifyL(id, aTupleName, aSubName, aComponentName, p.get(), EByComponent));
	}

	User::LeaveIfError(s.Int());
	User::LeaveIfError(err);
	
	return id;
}
void CBBSessionImpl::CheckedRunL()
{
	CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("CheckedRunL"));

	if (iStatus.Int() < KErrNone) {
		CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("err"));
		if (iStatus.Int()==KClientBufferTooSmall) {
			CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("toosmall"));
			iNotifyBuf->Des().Zero();
			iNotifyBuf=iNotifyBuf->ReAllocL(iNotifyBuf->Des().MaxLength()*2);
			iNotifyBufP.Set(iNotifyBuf->Des());
			iStatus=KRequestPending;
			SetActive();
			iClientSession.WaitForNotify(iFull, iNotifyBufP, iStatus);
			return;
		} else if(iStatus.Int()==KErrServerTerminated) {
			CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("terminated"));
			ReconnectL();
			return;
		} else {
			CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("other"));
			User::Leave(iStatus.Int());
		}
	}
	if (iStatus.Int() == EDeleteNotification) {
		CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("deleted"));
		NotifyDeletedL(iFull.iTupleName, iFull.iSubName);
	} else if (iNotifyBuf->Des().Length()>0) {
		{
			CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("read"));
			RDesReadStream rs(*iNotifyBuf);
			TTypeName tn;
			TInt err;
			MBBData* datap=0;
			CC_TRAP(err, tn=TTypeName::IdFromStreamL(rs));
			if (err!=KErrNone) {
				CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("err1"));
				TBBLongString* s=new (ELeave) TBBLongString(KEvent);
				datap=s;
				s->Value().Append(_L("error reading datatype: "));
				s->Value().AppendNum(err);
			}
			if (err==KErrNone) {
				CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("create"));
				CC_TRAP(err, datap=iFactory->CreateBBDataL(tn, KEvent, iFactory));
				if (err!=KErrNone) {
					CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("err2"));
					TBBLongString* s=new (ELeave) TBBLongString(KEvent);
					datap=s;
					s->Value().Append(_L("error creating data: "));
					s->Value().AppendNum(err);
					s->Value().Append(_L(", type: "));
					tn.IntoStringL(s->Value());
				}
			}
			refcounted_ptr<CRefCountedData> data(CRefCountedData::NewL(datap));
			if (err==KErrNone) {
				CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("internalize"));
				CC_TRAP(err, data->Get()->InternalizeL(rs));
				if (err!=KErrNone) {
					CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("err"));
					TBBLongString* s=new (ELeave) TBBLongString(KEvent);
					data.reset(CRefCountedData::NewL(s));
					s->Value().Append(_L("error internalizing data: "));
					s->Value().AppendNum(err);
					s->Value().Append(_L(", type: "));
					tn.IntoStringL(s->Value());
				}
			}
			{
			TNotifyType nt=EByTuple;
			if (iFull.iTupleType==ETuplePermanentSubscriptionEvent || 
				iFull.iTupleType==ETupleReply) {
					nt=EByComponent;
			}
			{
				CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("notify"));
				NotifyL(iFull.iId, iFull.iTupleName, iFull.iSubName, 
					iFull.iComponentName, data.get(), nt);
			}
			}
		}
	}

	{
		CALLSTACKITEM_N(_CL("CBBSessionImpl"), _CL("next"));
		iNotifyBuf->Des().Zero();
		iNotifyBufP.Set(iNotifyBuf->Des());
		iStatus=KRequestPending;
		SetActive();
		iClientSession.WaitForNotify(iFull, iNotifyBufP, iStatus);
	}
}
Ejemplo n.º 5
0
// -----------------------------------------------------------------------------
// CFMSInterruptAob::Start()
// -----------------------------------------------------------------------------
void CFMSInterruptAob::StartL(TFmsIpcCommands aType)
	{	
	FLOG(_L("CFMSInterruptAob::Start- begin"));
	iInterruptType = aType;
	if(iInterruptType == EDLUserInterrupt && iServer->ChargerTobeMonitered())
		{
		FLOG(_L("CFMSInterruptAob::Start--EUserInterrupt"));
		if(!IsActive())
			{
			//RProperty pw;
			iProperty.Attach(KPSUidHWRMPowerState,KHWRMChargingStatus);
			iStatus=KRequestPending;
			iProperty.Subscribe(iStatus);	
			SetActive();	
			}
		}
	else if(iInterruptType == EDLNetworkInterrupt && iServer->NetworkTobeMonitered())
		{	  
		FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt"));	
		if(!IsActive())
			{		  
			iStatus=KRequestPending;			  
			TBool phonenotoffline = CheckGlobalRFStateL();
			if ( ( iBearer == EBearerIdGPRS || iBearer == EBearerIdWCDMA )
					&& phonenotoffline )
				{
				FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt iBearer is %d"),iBearer);	
				NotifyL();
				return;			  
				}
			else if ( iBearer == EBearerIdWLAN )
				{
				//feature supported check
				iWlanAvailable = EFalse;	  
				iConnMon.GetBoolAttribute( EBearerIdWLAN, 
						0, 
						KBearerAvailability, 
						iWlanAvailable, 
						iStatus );
				SetActive();
				}
			else
				{
				FLOG(_L("CFMSInterruptAob::Start--ENetworkInterrupt--other then GPRS/ WLan bearer "));	  
				//Stop the server	  
				//Dont delete the file if interrupt is network + offline( to differentiate from hard reboot
				iServer->DeleteFile(EFalse);
				StopServer();
				}	  
			}
		}
	else if(iInterruptType == EDLMemoryInterrupt && iServer->MemoryTobeMonitered())
		{
		FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt on drive %d"),(TInt)iDrive );		  
		if(!IsActive())
			{
			User::LeaveIfError(iFs.Connect());
			TBool critical = EFalse;
			TInt err = KErrNone;
			err=IsPkgSizeMoreThanWL(critical);		  
			if(critical)
				{	 
				FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--critical pkg dont fit on drive %d"),(TInt)iDrive );		  
				iStatus=KRequestPending;					
				iFs.NotifyDiskSpace( iSize, iDrive, iStatus ); 
				FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt-setting as active") );		  
				SetActive();	
				}
			else
				{
				if(err == KErrNone)
					{
					FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--critical pkg fits on drive %d"),(TInt)iDrive );
					LaunchFotaEngineL();
					}
				else
					{
					FLOG(_L("CFMSInterruptAob::Start--EMemoryInterrupt--System error %d on memory drive %d"), err,(TInt)iDrive );
					}
				//Stop the server	 
				StopServer();	   
				}
			}
		}  
	else //case where variation fails or by chance if a bad interrupt reason
		{
		StopServer();	  
		}	 
	}
Ejemplo n.º 6
0
void CUsbNotifier::RunL(void)
{
  TRAPD(err,iNotifier.LockNotifyL(iEvent.State()));
  NotifyL();
}
Ejemplo n.º 7
0
EXPORT_C void CClkIntermediateObserver::HandleUpdateL(TInt aNotification)
{
  if(!iObserver) Panic(2);
  NotifyL(aNotification);
}
Ejemplo n.º 8
0
EXPORT_C void CClkIdleObserver::DoIdleNotifyL(void)
{
  NotifyL(iNotification);
}