Update contrib.
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "cdevcommoncontrol.h"
17 #include <a3f/maudiocontext.h>
18 #include <a3f/maudiocodec.h>
21 CDevCommonControl::CDevCommonControl()
24 DP_CONTEXT(CDevCommonControl::CDevCommonControl, CtxDevSound, DPLOCAL);
30 CDevCommonControl::~CDevCommonControl()
32 DP_CONTEXT(CDevCommonControl::~CDevCommonControl, CtxDevSound, DPLOCAL);
38 TInt CDevCommonControl::Stop() // from CDevAudioControl
40 DP_CONTEXT(CDevCommonControl::Stop, CtxDevSound, DPLOCAL);
44 switch(iDevAudio->iActiveState)
46 case EDevSoundAdaptorActive_Active:
47 case EDevSoundAdaptorPaused_Primed:
48 err = iDevAudio->iAudioStream->Stop();
51 err = iDevAudio->CommitAudioContext();
55 iDevAudio->iActiveState = EDevSoundAdaptorStopping;
58 case EDevSoundAdaptorGoingActive:
59 iDevAudio->iActiveState = EDevSoundAdaptorStopping;
61 case EDevSoundAdaptorInitialised_Idle:
63 //If following condition is true, then we are here because of a
64 //pre-emption clash in last Commit cycle started from
65 //CDevCommonControl::ContextEventUpdateWithStateEventNoError.
66 if(iDevAudio->iPreviousState == EDevSoundAdaptorUnloading)
78 iDevAudio->iStop = ETrue;
85 TInt CDevCommonControl::Pause() // from CDevAudioControl
87 DP_CONTEXT(CDevCommonControl::Pause, CtxDevSound, DPLOCAL);
90 TInt err = iDevAudio->iAudioStream->Prime();
93 err = iDevAudio->CommitAudioContext();
97 iDevAudio->iActiveState = EDevSoundAdaptorPausing;
104 TInt CDevCommonControl::Resume() // from CDevAudioControl
106 DP_CONTEXT(CDevCommonControl::Resume, CtxDevSound, DPLOCAL);
111 //If following condition is true, then we are here because of a
112 //pre-emption clash in last Commit cycle started from
113 //CDevCommonControl::ContextEventUpdateWithStateEventAndError.
114 if(iDevAudio->iActiveState == EDevSoundAdaptorInitialised_Idle &&
115 iDevAudio->iPreviousState == EDevSoundAdaptorUnloading)
120 else if(iDevAudio->iActiveState != EDevSoundAdaptorPaused_Primed)
122 DP0_RET(KErrNotReady, "%d");
127 // Populate gain and balance values set in the Paused state and being cached
128 err = iDevAudio->RequestGainAndBalance(this);
132 err = iDevAudio->iAudioStream->Activate();
134 if ( err == KErrNone)
136 err = iDevAudio->CommitAudioContext();
140 iDevAudio->iActiveState = EDevSoundAdaptorActivating;
147 void CDevCommonControl::StateEvent(MAudioStream& aStream, TInt aError, // from MAudioProcessingUnitObserver
148 TAudioState aNewState)
150 DP_CONTEXT(CDevCommonControl::StateEvent, CtxDevSound, DPLOCAL);
151 DP3_IN("activeState %d -> newstate %d, (%d)",
152 iDevAudio->iActiveState, aNewState, aError);
154 __ASSERT_ALWAYS(iDevAudio->iAudioStream == &aStream, Panic(EStreamMismatch));
156 if(aError != KErrNone || iDevAudio->iActiveStreamState != aNewState)
158 iDevAudio->iActiveStreamState = aNewState;
159 iStateEventReceived = ETrue;
161 // Since the audiostream already demoted the state for the most of the cases
162 // only is need when a error comes were the stream was at the middle of A3f two-phase transition
168 // Demote the stream state
169 iDevAudio->iActiveStreamState = EIdle;
175 iStateEventError = aError;
181 void CDevCommonControl::ProcessingUnitError(MAudioProcessingUnit* /*aInstance*/, // from MAudioProcessingUnitObserver
184 DP_CONTEXT(CDevCommonControl::ProcessingUnitError, CtxDevSound, DPLOCAL);
187 if(iCallbackFromAdaptor == KCallbackNone)
189 iProcessingUnitError = aError;
190 iCallbackFromAdaptor = KCallbackProcessingUnitError;
191 iAdaptationObserver->CallbackFromAdaptorReceived(KCallbackProcessingUnitError, aError);
195 // Multiple callbacks from adaptor
196 DP0(DLINFO, "Multiple callbacks from adaptor");
203 void CDevCommonControl::ContextEvent(TUid aEvent, TInt aError)
205 DP_CONTEXT(CDevCommonControl::ContextEvent, CtxDevSound, DPLOCAL);
206 DP3_IN("ContextEvent aEvent=%x iActiveState=%d aError=%d",aEvent, iDevAudio->iActiveState, aError);
208 // Can't "switch {...}" on UIDs unfortunately:
209 if (aEvent == KUidA3FContextUpdateComplete)
213 if(iStateEventReceived)
215 //use a sub state pattern to make pre-emption cycles like other cycles.
216 DP1(DLERR,"Preemption error=%d", aError);
217 iDevAudio->iActiveState = EDevSoundAdaptorBeingPreempted;
220 // remove last request from front of queue without processing it
221 iAdaptationObserver->PreemptionClashWithStateChange();
222 iPreemptionClash=EFalse;
225 else if(!iStateEventReceived && iPreemptionClash)
227 iIgnoreAsyncOpComplete=ETrue;
228 iPreemptionClash=EFalse;
230 iBeingPreempted=EFalse;
232 ContextEventUpdateComplete(aError);
235 else if ((aEvent == KUidA3FContextCommitUpdate))
237 iBeingPreempted=EFalse; // clear being preempted
238 iPreemptionClash=EFalse; // clear pre-emption clash flag
239 TBool adaptorControlsContext = iAdaptationObserver->AdaptorControlsContext();
240 iIgnoreAsyncOpComplete = !adaptorControlsContext;
241 // if we don't control context, always send a PreemptionFinishedCallbackReceived()
242 iStateEventReceived=EFalse;
245 else if (aEvent == KUidA3FContextPreEmption)
247 // clear iBeingPreepted - will be set in ContextEventPreEmption if req
248 iBeingPreempted=EFalse;
249 iPreemptionClash=EFalse; // clear pre-emption clash flag
250 TBool adaptorControlsContext = iAdaptationObserver->AdaptorControlsContext();
251 iStateEventReceived=EFalse;
252 iIgnoreAsyncOpComplete=EFalse; // clear being iIgnoreAsyncOpComplete
253 ContextEventPreEmption(aEvent, aError);
254 if (!adaptorControlsContext)
256 iIgnoreAsyncOpComplete = ETrue; // if we don't control context never do AsyncOpComplete
259 else if (aEvent == KUidA3FContextPreEmptedCommit)
261 DP0(DLINFO,"KUidA3FContextPreEmptedCommit event received, thus clash with Pre-emption");
262 // clear iBeingPreepted - will be set in ContextEventPreEmption if req
263 iBeingPreempted=EFalse;
264 TBool adaptorControlsContext = iAdaptationObserver->AdaptorControlsContext();
265 if (adaptorControlsContext)
267 // push current request that was being processed onto front of queue.
268 iAdaptationObserver->PreemptionClash();
269 iPreemptionClash=ETrue;
271 iStateEventReceived=EFalse;
272 iIgnoreAsyncOpComplete=EFalse; // clear being iIgnoreAsyncOpComplete
273 ContextEventPreEmption(aEvent, aError);
274 if (!adaptorControlsContext)
276 iIgnoreAsyncOpComplete = ETrue; // if we don't control context never do AsyncOpComplete
280 else if (aEvent == KUidA3FContextAbort)
282 ContextEventAbort(aError);
289 void CDevCommonControl::ContextEventAsynchronousPlayCompletion(TInt aError) // from CDevCommonControl
291 DP_CONTEXT(CDevCommonControl::ContextEventAsynchronousPlayCompletion, CtxDevSound, DPLOCAL);
294 iAdaptationObserver->AsynchronousOperationComplete(aError, ETrue);
298 FinishWithError(aError);
305 void CDevCommonControl::ContextEventAsynchronousInitializeComplete(TInt aError) // from CDevCommonControl
307 DP_CONTEXT(CDevCommonControl::ContextEventAsynchronousInitializeComplete, CtxDevSound, DPLOCAL);
310 iAdaptationObserver->AsynchronousOperationComplete(aError, ETrue);
311 iAdaptationObserver->InitializeComplete(aError);
317 void CDevCommonControl::ContextEventUpdateComplete(TInt aError) // from CDevCommonControl
319 DP_CONTEXT(CDevCommonControl::ContextEventUpdateComplete, CtxDevSound, DPLOCAL);
322 if (iStateEventReceived)
324 iStateEventReceived = EFalse;
325 DP0(DLINFO,"Context event for that does involve state change");
329 ContextEventUpdateWithStateEventAndError(aError);
333 ContextEventUpdateWithStateEventNoError();
339 DP0(DLINFO,"Context event for that doesn't involve state change");
343 ContextEventUpdateWithoutStateEventButWithError(aError);
347 ContextEventUpdateWithoutStateEventNoError();
354 void CDevCommonControl::ContextEventPreEmption(TUid aEvent, TInt aError) // from CDevCommonControl
356 DP_CONTEXT(CDevCommonControl::ContextEventPreEmption, CtxDevSound, DPLOCAL);
359 DP1(DLERR,"Preemption error=%d", aError);
360 CDevAudioControl::ContextEvent(aEvent, aError);
361 iBeingPreempted=ETrue;
367 void CDevCommonControl::ContextEventAbort(TInt aError) // from CDevCommonControl
369 DP_CONTEXT(CDevCommonControl::ContextEventAbort, CtxDevSound, DPLOCAL);
372 DP1(DLERR,"Abort error=%d", aError);
373 FinishWithError(aError==KErrAbort ? KErrDied:aError);
379 void CDevCommonControl::ContextEventStopDevSoundNotifications() // from CDevCommonControl
381 DP_CONTEXT(CDevCommonControl::ContextEventStopDevSoundNotifications, CtxDevSound, DPLOCAL);
384 iDevAudio->iAudioStream->UnregisterAudioStreamObserver(*this);
385 iGainControl->UnregisterAudioGainControlObserver(*this);
386 iAudioCodecIf->UnregisterAudioCodecObserver(*this);
387 iAudioCodecIf = NULL;
393 void CDevCommonControl::ContextEventPauseResumeSequenceDueToEmptyBuffers(TBool aFlush) // from CDevCommonControl
395 DP_CONTEXT(CDevCommonControl::ContextEventPauseResumeSequenceDueToEmptyBuffers, CtxDevSound, DPLOCAL);
400 if (iPauseResumeSequenceDueToEmptyBuffers)
404 err = iDevAudio->iAudioStream->Flush();
407 if ((err) or (aFlush==EFalse))
409 iPauseResumeSequenceDueToEmptyBuffers = EFalse;
410 iAdaptationObserver->CallbackFromAdaptorReceived(KCallbackFlushComplete, err);
415 iAdaptationObserver->AsynchronousOperationComplete(KErrNone, ETrue);
422 void CDevCommonControl::ContextEventStateDevSoundAdaptorUnloading() // from CDevCommonControl
424 DP_CONTEXT(CDevCommonControl::ContextEventStateDevSoundAdaptorUnloading, CtxDevSound, DPLOCAL);
427 // Due destruction sequence or reinitialization
428 if (iDevAudio->iClosing or iDevAudio->iReinitializing)
430 TInt err = Uninitialize();
431 if (err and iDevAudio->iReinitializing)
433 ContextEventAsynchronousInitializeComplete(err);
441 // Notify the user that ProcessingFinished is complete.
442 // Stop call complete, sent callback.
443 if (iCallbackFromAdaptor != KCallbackNone)
445 iAdaptationObserver->AsynchronousOperationComplete(KErrNone, ETrue);
447 if (iCallbackFromAdaptor == KCallbackProcessingFinished)
449 FinishWithError(KErrUnderflow);
451 else if (iCallbackFromAdaptor == KCallbackProcessingUnitError)
453 FinishWithError(iProcessingUnitError);
456 iCallbackFromAdaptor = KCallbackNone;
464 FinishWithError(iErrorCondition);
465 iErrorCondition = KErrNone;
470 iAdaptationObserver->AsynchronousOperationComplete(KErrNone, ETrue);
477 void CDevCommonControl::ContextEventStateDevSoundAdaptorLoading() // from CDevCommonControl
479 DP_CONTEXT(CDevCommonControl::ContextEventStateDevSoundAdaptorLoading, CtxDevSound, DPLOCAL);
482 iDevAudio->RequestGainAndBalance(this); // TODO handle error
484 TInt err = iDevAudio->iAudioStream->Activate();
491 err = iDevAudio->CommitAudioContext();
494 ContextEventAsynchronousPlayCompletion(err);
499 iDevAudio->iActiveState = EDevSoundAdaptorActivating;
500 iAdaptationObserver->AsynchronousOperationComplete(KErrNone, EFalse);
506 void CDevCommonControl::ContextEventStateDevSoundAdaptorStopping() // from CDevCommonControl
508 DP_CONTEXT(CDevCommonControl::ContextEventStateDevSoundAdaptorStopping, CtxDevSound, DPLOCAL);
514 DP0(DLINFO,"Commit failed during stopping");
515 FinishWithError(err);
518 __ASSERT_DEBUG(err==KErrNone, Panic(ECommitFailedDuringStop));
524 void CDevCommonControl::ContextEventStateDevSoundAdaptorBeingPreempted() // from CDevCommonControl
526 DP_CONTEXT(CDevCommonControl::ContextEventStateDevSoundAdaptorBeingPreempted, CtxDevSound, DPLOCAL);
529 __ASSERT_DEBUG(iDevAudio->iActiveStreamState == EInitialized, Panic(EStreamBeingDemotedToEIdle));
530 FinishWithError(KErrInUse);
531 if (iIgnoreAsyncOpComplete)
533 iAdaptationObserver->PreemptionFinishedCallbackReceived(ETrue);
534 iIgnoreAsyncOpComplete=EFalse;
539 ContextEventPauseResumeSequenceDueToEmptyBuffers(EFalse);
545 void CDevCommonControl::ContextEventStateDevSoundAdaptorUninitializing() // from CDevCommonControl
547 DP_CONTEXT(CDevCommonControl::ContextEventStateDevSoundAdaptorUninitializing, CtxDevSound, DPLOCAL);
549 TInt err = RemoveProcessingUnits();
553 iDevAudio->iActiveState = EDevSoundAdaptorRemovingProcessingUnits;
555 else if (iDevAudio->iReinitializing)
557 ContextEventAsynchronousInitializeComplete(err);
564 void CDevCommonControl::ContextEventErrorStateDevSoundAdaptorActivating(TInt aError) // from CDevCommonControl
566 DP_CONTEXT(CDevCommonControl::ContextEventErrorStateDevSoundAdaptorActivating, CtxDevSound, DPLOCAL);
569 // If the resume operation fails as result of EmptyBuffers
570 // Notify about operation complete through CallbackFromAdaptorReceived
571 // and continue to allow client to receive PlayError()
572 if (iPauseResumeSequenceDueToEmptyBuffers)
574 iPauseResumeSequenceDueToEmptyBuffers = EFalse;
575 iAdaptationObserver->CallbackFromAdaptorReceived(KCallbackFlushComplete, KErrNone);
578 iErrorCondition = aError;
583 DP0(DLINFO,"Commit failed during stopping");
584 FinishWithError(err);
586 __ASSERT_DEBUG(err==KErrNone, Panic(ECommitFailedDuringStop));
592 void CDevCommonControl::ContextEventErrorStateDevSoundAdaptorBeingPreempted() // from CDevCommonControl
594 DP_CONTEXT(CDevCommonControl::ContextEventErrorStateDevSoundAdaptorBeingPreempted, CtxDevSound, DPLOCAL);
597 __ASSERT_DEBUG(iDevAudio->iActiveStreamState == EInitialized, Panic(EStreamBeingDemotedToEIdle));
598 FinishWithError(KErrInUse);
600 if(iIgnoreAsyncOpComplete)
602 iAdaptationObserver->PreemptionFinishedCallbackReceived(ETrue);
609 void CDevCommonControl::ContextEventUpdateWithoutStateEventNoError() // from CDevCommonControl
611 DP_CONTEXT(CDevCommonControl::ContextEventUpdateWithoutStateEventNoError, CtxDevSound, DPLOCAL);
612 DP2_IN("iActiveState=%d iIgnoreAsyncOpComplete=%d",iDevAudio->iActiveState, iIgnoreAsyncOpComplete);
614 if (iDevAudio->iActiveState != EDevSoundAdaptorRemovingProcessingUnits)
616 if (iIgnoreAsyncOpComplete)
618 iAdaptationObserver->PreemptionFinishedCallbackReceived(ETrue);
619 iIgnoreAsyncOpComplete = EFalse;
623 iAdaptationObserver->AsynchronousOperationComplete(KErrNone, ETrue);
629 //If the Commit cycle when going into EDevSoundAdaptorRemovingProcessingUnits fails due to pre-emption
630 //clash then we re-apply the client request again.
631 if (iDevAudio->iActiveState == EDevSoundAdaptorRemovingProcessingUnits && iIgnoreAsyncOpComplete)
633 //Pop front of queue to re-apply the request again via CMMFDevSoundSession::DequeueRequest
634 //from the callback into CMMFDevSoundSession below:
635 iAdaptationObserver->PreemptionFinishedCallbackReceived(ETrue);
636 iIgnoreAsyncOpComplete = EFalse;
641 iDevAudio->iActiveState = EDevSoundAdaptorCreated_Uninitialised;
643 if (iDevAudio->iReinitializing)
645 ContextEventStopDevSoundNotifications();
647 TInt err = iDevAudio->Initialize(iDevAudio->iTargetFormat, iDevAudio->iTargetMode);
650 ContextEventAsynchronousInitializeComplete(err);
653 iDevAudio->iReinitializing = EFalse;
658 iDevAudio->iClosing = EFalse;
659 iAdaptationObserver->AsynchronousOperationComplete(KErrNone, ETrue);
665 void CDevCommonControl::ContextEventUpdateWithoutStateEventButWithError(TInt aError) // from CDevCommonControl
667 DP_CONTEXT(CDevCommonControl::ContextEventUpdateWithoutStateEventButWithError, CtxDevSound, DPLOCAL);
670 //If flag is true below then it must be due to a stateless normal pre-emption or
671 //stateless pre-emption clash scenario.
672 if(iIgnoreAsyncOpComplete)
674 //If we are in pre-emption clash then callback below will retry the client request again.
675 iAdaptationObserver->PreemptionFinishedCallbackReceived(ETrue); // notify client of end of cycle
676 iIgnoreAsyncOpComplete = EFalse;
680 TDevSoundAdaptorState previousState = iDevAudio->iPreviousState;
682 DP3(DLINFO,"Error with no state change, state %d, previous %d, error %d during Commit cycle",
683 iDevAudio->iActiveState, previousState, aError);
685 // We can end up here for a number of reasons. For non "mid states", this is
686 // a standard error scenario. For some mid-states (e.g. Activating, Loading etc),
687 // when we try and "promote" the state, this happens when the promotion is rejected
688 // and we handle thus accordingly. For other mid-states the situation is less clear
689 // and we call AsynchronousOperationComplete() with the error assuming the parent
690 // session will deal with it. Whatever we don't want to stay in a mid-state, so
691 // rewind to the previous ("normal") one if we are in one.
693 // Longer term TODO. If the code were refactored so that the InitializeComplete(),
694 // PlayError() etc callback came from AsynchronousOperationComplete() then the
695 // following code might be simpler. Most of the time (at least) we get here because
696 // we are doing a session function, and we can use the function to determine what
697 // to do more easily than relying on the state. As it is, for some mid-states we
698 // try and work out what error code to generate. Not clear this covers 100% cases,
699 // although demotion transitions should not fail, so the problem cases might not occur.
702 //If we reach this condition then it is because of rejection/error during Commit cycle.
703 switch (iDevAudio->iActiveState)
705 case EDevSoundAdaptorInitialising:
707 iDevAudio->iActiveState = previousState;
708 ContextEventAsynchronousInitializeComplete(aError);
711 case EDevSoundAdaptorLoading:
713 iDevAudio->iActiveState = previousState;
714 ContextEventAsynchronousPlayCompletion(aError);
717 case EDevSoundAdaptorActivating:
719 iDevAudio->iActiveState = previousState;
720 ContextEventAsynchronousPlayCompletion(aError);
723 case EDevSoundAdaptorRemovingProcessingUnits:
724 case EDevSoundAdaptorUninitialising:
725 case EDevSoundAdaptorUnloading:
726 case EDevSoundAdaptorStopping:
727 case EDevSoundAdaptorPausing:
729 DP2(DLINFO,"Unexpected mid state [%d] when handling error [%d] during Commit cycle, workback", iDevAudio->iActiveState, aError);
730 iDevAudio->iActiveState = previousState;
731 iAdaptationObserver->AsynchronousOperationComplete(aError, ETrue);
736 DP2(DLINFO,"Unexpected state [%d] when handling error [%d] during Commit cycle", iDevAudio->iActiveState, aError);
737 iAdaptationObserver->AsynchronousOperationComplete(aError, ETrue);
746 void CDevCommonControl::ContextEventUpdateWithStateEventNoError() // from CDevCommonControl
748 DP_CONTEXT(CDevCommonControl::ContextEventUpdateWithStateEventNoError, CtxDevSound, DPLOCAL);
751 switch (iDevAudio->iActiveState)
753 case EDevSoundAdaptorUninitialising:
754 iDevAudio->iActiveState = EDevSoundAdaptorUnitialised_Uninitialised;
755 ContextEventStateDevSoundAdaptorUninitializing();
758 case EDevSoundAdaptorInitialising:
759 iDevAudio->iActiveState = EDevSoundAdaptorInitialised_Initialised;
760 ContextEventAsynchronousInitializeComplete(KErrNone);
763 case EDevSoundAdaptorUnloading:
764 iDevAudio->iActiveState = EDevSoundAdaptorInitialised_Initialised;
765 ContextEventStateDevSoundAdaptorUnloading();
768 case EDevSoundAdaptorLoading:
769 iDevAudio->iActiveState = EDevSoundAdaptorGoingActive;
770 ContextEventStateDevSoundAdaptorLoading();
773 case EDevSoundAdaptorStopping:
774 iDevAudio->iActiveState = EDevSoundAdaptorInitialised_Idle;
775 ContextEventStateDevSoundAdaptorStopping();
778 case EDevSoundAdaptorActivating:
779 iDevAudio->iActiveState = EDevSoundAdaptorActive_Active;
780 ContextEventPauseResumeSequenceDueToEmptyBuffers(EFalse);
783 case EDevSoundAdaptorPausing:
784 iDevAudio->iActiveState = EDevSoundAdaptorPaused_Primed;
785 ContextEventPauseResumeSequenceDueToEmptyBuffers(ETrue);
788 case EDevSoundAdaptorBeingPreempted:
789 iDevAudio->iActiveState = EDevSoundAdaptorInitialised_Initialised;
790 ContextEventStateDevSoundAdaptorBeingPreempted();
801 void CDevCommonControl::ContextEventUpdateWithStateEventAndError(TInt aError) // from CDevCommonControl
803 DP_CONTEXT(CDevCommonControl::ContextEventUpdateWithStateEventAndError, CtxDevSound, DPLOCAL);
806 DP1(DLERR,"ContextEventUpdateWithStateEventAndError error=%d", aError);
808 switch(iDevAudio->iActiveState)
810 case EDevSoundAdaptorInitialising:
811 iDevAudio->iActiveState = EDevSoundAdaptorCreated_Uninitialised;
812 iAdaptationObserver->InitializeComplete(aError);
815 case EDevSoundAdaptorLoading:
816 iDevAudio->iActiveState = EDevSoundAdaptorInitialised_Initialised;
817 FinishWithError(aError);
820 case EDevSoundAdaptorActivating:
821 iDevAudio->iActiveState = EDevSoundAdaptorInitialised_Idle;
822 ContextEventErrorStateDevSoundAdaptorActivating(aError);
825 case EDevSoundAdaptorBeingPreempted:
826 iDevAudio->iActiveState = EDevSoundAdaptorInitialised_Initialised;
827 ContextEventErrorStateDevSoundAdaptorBeingPreempted();
834 iCallbackFromAdaptor = KCallbackNone;
836 if(!iIgnoreAsyncOpComplete)
838 iAdaptationObserver->AsynchronousOperationComplete(aError, ETrue);
842 iAdaptationObserver->PreemptionFinishedCallbackReceived(ETrue);
843 iIgnoreAsyncOpComplete=EFalse;