uifw/AvKon/src/AknEcs.cpp
branchRCL_3
changeset 9 aabf2c525e0f
parent 4 8ca85d2f0db7
child 55 aecbbf00d063
equal deleted inserted replaced
4:8ca85d2f0db7 9:aabf2c525e0f
     1 /*
     1 /*
     2 * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    33 #include <MPhCltEmergencyCallObserver.h>
    33 #include <MPhCltEmergencyCallObserver.h>
    34 #include <PhCltTypes.h>
    34 #include <PhCltTypes.h>
    35 #include <AvkonInternalCRKeys.h>
    35 #include <AvkonInternalCRKeys.h>
    36 #include <PtiDefs.h>
    36 #include <PtiDefs.h>
    37 #include <e32property.h>
    37 #include <e32property.h>
       
    38 #include <AiwCommon.hrh>
       
    39 #include <aiwdialdata.h>
       
    40 #include <AiwServiceHandler.h>
       
    41 #include <centralrepository.h>
    38 
    42 
    39 #include "akntrace.h"
    43 #include "akntrace.h"
       
    44 
       
    45 const TInt KAknKeyScanCodeBegin = 33;
       
    46 const TInt KAknKeyScanCodeEnd   = 126;
    40 
    47 
    41 // CLASS DECLARATIONS
    48 // CLASS DECLARATIONS
    42 
    49 
    43 /** Class for getting emergency call events */
    50 /** Class for getting emergency call events */
    44 NONSHARABLE_CLASS(CPhCltEmergencyCallObserver) : public CBase,
    51 NONSHARABLE_CLASS(CPhCltEmergencyCallObserver) : public CBase,
    96         * These statuses are returned by MatchText
   103         * These statuses are returned by MatchText
    97         */
   104         */
    98         enum TStatus
   105         enum TStatus
    99             {
   106             {
   100             ENoMatch,
   107             ENoMatch,
   101             ECompleteMatch
   108             ECompleteMatch,
       
   109             EServiceNumMatch
   102             };
   110             };
   103     public:
   111     public:
   104         /**
   112         /**
   105         * C++ constructor
   113         * C++ constructor
   106         */
   114         *
   107         CAknMatchingCharacterQueue( CPhCltEmergencyCall* aPhCltEmergencyCall );
   115         * @param aPhCltEmergencyCall  Emergency call client
       
   116         * @param aServiceCallEnabled  Is service call feature enabled during device or key lock.
       
   117         */
       
   118         CAknMatchingCharacterQueue( CPhCltEmergencyCall* aPhCltEmergencyCall, TBool aServiceCallEnabled );
   108 
   119 
   109         /**
   120         /**
   110         * C++ destructor
   121         * C++ destructor
   111         */
   122         */
   112         ~CAknMatchingCharacterQueue( );
   123         ~CAknMatchingCharacterQueue( );
   171         *
   182         *
   172         * @return the index in the current buffer where the match starts
   183         * @return the index in the current buffer where the match starts
   173         */
   184         */
   174         TInt IndexOfCurrentMatch() const;
   185         TInt IndexOfCurrentMatch() const;
   175 
   186 
       
   187         /**
       
   188         * Validates the service number.
       
   189         *
       
   190         * @param aNumber Service number to be validated from CenRep.
       
   191         *
       
   192         * @return Returns ETrue if aNumber is a service number, EFalse if not.
       
   193         */
       
   194         TBool ValidateServiceNumberL( const TDesC& aNumber );
       
   195 
   176     private:
   196     private:
   177         /**
   197         /**
   178         * Update the status of the queue
   198         * Update the status of the queue
   179         */
   199         */
   180         void UpdateStatus( TBool aBufferMode );
   200         void UpdateStatus( TBool aBufferMode );
   185 
   205 
   186         /** Pointer to phone client interface of emergency call. Not owned */
   206         /** Pointer to phone client interface of emergency call. Not owned */
   187         CPhCltEmergencyCall* iPhCltEmergencyCall; 
   207         CPhCltEmergencyCall* iPhCltEmergencyCall; 
   188         TStatus iStatus;      // Holds the status;
   208         TStatus iStatus;      // Holds the status;
   189         TInt iMatchPosition;  // Position in iCharBuffer from where the match starts.
   209         TInt iMatchPosition;  // Position in iCharBuffer from where the match starts.
       
   210         TBool iServiceCallFeature;  // True if service call feature is enabled.
   190 
   211 
   191         TAny* iSpare;
   212         TAny* iSpare;
   192     };
   213     };
   193 
   214 
   194 
   215 
   216 // Queue used for storing and matching the keys used in emergency number detection
   237 // Queue used for storing and matching the keys used in emergency number detection
   217 //
   238 //
   218 //
   239 //
   219 
   240 
   220 
   241 
   221 CAknMatchingCharacterQueue::CAknMatchingCharacterQueue( CPhCltEmergencyCall* aPhCltEmergencyCall ) 
   242 CAknMatchingCharacterQueue::CAknMatchingCharacterQueue( CPhCltEmergencyCall* aPhCltEmergencyCall, TBool aServiceCallEnabled )
   222         : iPhCltEmergencyCall( aPhCltEmergencyCall )
   243         : iPhCltEmergencyCall( aPhCltEmergencyCall ), iServiceCallFeature( aServiceCallEnabled )
   223     {
   244     {
   224     _AKNTRACE_FUNC_ENTER;
   245     _AKNTRACE_FUNC_ENTER;
   225     Reset();
   246     Reset();
   226     _AKNTRACE_FUNC_EXIT;
   247     _AKNTRACE_FUNC_EXIT;
   227     }
   248     }
   254         {
   275         {
   255         iCharBuffer = iCharBuffer.Right(length - 1);
   276         iCharBuffer = iCharBuffer.Right(length - 1);
   256         }
   277         }
   257     iCharBuffer.Append( aNewChar );
   278     iCharBuffer.Append( aNewChar );
   258     UpdateStatus( EFalse );
   279     UpdateStatus( EFalse );
   259     _AKNTRACE_FUNC_ENTER;
   280     _AKNTRACE_FUNC_EXIT;
   260     }
   281     }
   261 
   282 
   262 void CAknMatchingCharacterQueue::SetBuffer( const TDesC& aNewBuffer )
   283 void CAknMatchingCharacterQueue::SetBuffer( const TDesC& aNewBuffer )
   263     {    
   284     {    
   264     _AKNTRACE_FUNC_ENTER;
   285     _AKNTRACE_FUNC_ENTER;
   322     if ( isEmergency )
   343     if ( isEmergency )
   323         {
   344         {
   324         iMatchPosition = cbLength - bLength;
   345         iMatchPosition = cbLength - bLength;
   325         iStatus = ECompleteMatch;
   346         iStatus = ECompleteMatch;
   326         }
   347         }
       
   348     else if ( iServiceCallFeature && cbLength >= KAknServiceCallMinLength )
       
   349         {
       
   350         // Check if this is a service call
       
   351         TBool isServiceNum = EFalse;
       
   352         TRAP_IGNORE( isServiceNum = ValidateServiceNumberL( iCharBuffer ) );
       
   353 
       
   354         if ( isServiceNum )
       
   355             {
       
   356             iMatchPosition = 0;
       
   357             iStatus = EServiceNumMatch;
       
   358             }
       
   359         else
       
   360             {
       
   361             iMatchPosition = cbLength;
       
   362             iStatus = ENoMatch;
       
   363             }
       
   364         }
   327     else
   365     else
   328         {
   366         {
   329         iMatchPosition = cbLength;
   367         iMatchPosition = cbLength;
   330         iStatus = ENoMatch;
   368         iStatus = ENoMatch;
   331         }
   369         }
   332     
       
   333     _AKNTRACE( "[%s][%s] iStatus: %d", "CAknMatchingCharacterQueue", 
   370     _AKNTRACE( "[%s][%s] iStatus: %d", "CAknMatchingCharacterQueue", 
   334                 		__FUNCTION__,iStatus );
   371                 		__FUNCTION__,iStatus );
   335     _AKNTRACE_FUNC_EXIT;
   372     _AKNTRACE_FUNC_EXIT;
   336     }
   373     }
   337 
   374 
       
   375 // -----------------------------------------------------------------------------
       
   376 // CAknMatchingCharacterQueue::ValidateServiceNumber
       
   377 // 
       
   378 // Validates the service phone number.
       
   379 // -----------------------------------------------------------------------------
       
   380 //
       
   381 TBool CAknMatchingCharacterQueue::ValidateServiceNumberL( const TDesC& aNumber )
       
   382     {
       
   383     _AKNTRACE_FUNC_ENTER;
       
   384 	TBool isServiceNum = EFalse;
       
   385     HBufC* serviceNum = HBufC::NewLC( KAknEcsMaxMatchingLength );
       
   386     CRepository* cenRep = CRepository::NewLC( KCRUidAvkon );
       
   387     TPtr bufPtr = serviceNum->Des();
       
   388 
       
   389     if( cenRep->Get( KAknServiceCallNumber, bufPtr ) != KErrNone )
       
   390         {
       
   391         CleanupStack::PopAndDestroy( cenRep );
       
   392         CleanupStack::PopAndDestroy( serviceNum );
       
   393         return EFalse;
       
   394         }
       
   395 
       
   396     // Check if aNumber matches serviceNum
       
   397     if ( aNumber.Compare( *serviceNum ) == 0 )
       
   398         {
       
   399         isServiceNum = ETrue;
       
   400 		}
       
   401 
       
   402     CleanupStack::PopAndDestroy( cenRep );
       
   403     CleanupStack::PopAndDestroy( serviceNum );
       
   404     _AKNTRACE_FUNC_EXIT;
       
   405     return isServiceNum;
       
   406     }
   338 
   407 
   339 //
   408 //
   340 //
   409 //
   341 // Implementation of CAknEcsDetector
   410 // Implementation of CAknEcsDetector
   342 //  (Emergency Call Support Detector)
   411 //  (Emergency Call Support Detector)
   368     {
   437     {
   369     _AKNTRACE_FUNC_ENTER;
   438     _AKNTRACE_FUNC_ENTER;
   370     iEmergencyCallObserver = new (ELeave) CPhCltEmergencyCallObserver( this );
   439     iEmergencyCallObserver = new (ELeave) CPhCltEmergencyCallObserver( this );
   371     // Phone client interface
   440     // Phone client interface
   372     iPhCltEmergencyCall = CPhCltEmergencyCall::NewL( iEmergencyCallObserver );
   441     iPhCltEmergencyCall = CPhCltEmergencyCall::NewL( iEmergencyCallObserver );
   373     iQueue = new (ELeave) CAknMatchingCharacterQueue(iPhCltEmergencyCall);
   442 
       
   443     // Check if service call is allowed during device and key lock
       
   444     iServiceCallEnabled = 
       
   445         FeatureManager::FeatureSupported( KFeatureIdFfServiceCallWhilePhoneLocked );
       
   446 
       
   447     iQueue = new (ELeave) CAknMatchingCharacterQueue( iPhCltEmergencyCall, iServiceCallEnabled );
   374     iQueue->ConstructL();
   448     iQueue->ConstructL();
   375 
   449 
   376     DetermineState();
   450     DetermineState();
   377 
   451 
   378     // Idler for delaying the change of state to Call Attempted
   452     // Idler for delaying the change of state to Call Attempted
   421 EXPORT_C void CAknEcsDetector::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* /* aDestination  */)
   495 EXPORT_C void CAknEcsDetector::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* /* aDestination  */)
   422     {
   496     {
   423     _AKNTRACE_FUNC_ENTER;
   497     _AKNTRACE_FUNC_ENTER;
   424     _AKNTRACE( "[%s][%s] aEvent.type(): %d, aEvent.Key()->iScanCode :%d", "CAknEcsDetector", 
   498     _AKNTRACE( "[%s][%s] aEvent.type(): %d, aEvent.Key()->iScanCode :%d", "CAknEcsDetector", 
   425                             		__FUNCTION__,aEvent.Type(),aEvent.Key()->iScanCode );
   499                             		__FUNCTION__,aEvent.Type(),aEvent.Key()->iScanCode );
   426     
       
   427     if ( aEvent.Type() == EEventKeyDown || 
   500     if ( aEvent.Type() == EEventKeyDown || 
   428     // EKeyPhoneEnd/EKeyNo doesn't send EEVentKeyDown events, so EEventKey is used instead
   501         // EKeyPhoneEnd/EKeyNo doesn't send EEVentKeyDown events, so EEventKey is used instead
   429     ( ( aEvent.Key()->iScanCode == EStdKeyNo ) && ( aEvent.Type() == EEventKey ) ) 
   502        ( ( aEvent.Key()->iScanCode == EStdKeyNo ) && ( aEvent.Type() == EEventKey ) ) )
   430         )
       
   431         {
   503         {
   432         AddChar( (TText)(aEvent.Key()->iScanCode ) ); // top 16 ( in Unicode build) bits removed
   504         AddChar( (TText)(aEvent.Key()->iScanCode ) ); // top 16 ( in Unicode build) bits removed
   433         }    
   505         }
       
   506 
       
   507     if ( iServiceCallEnabled )
       
   508         {
       
   509         // When Cancel is pressed we need to clear the queue
       
   510         if ( iState == EServiceNumMatch && aEvent.Type() == EEventPointer && 
       
   511         	   aEvent.Pointer()->iType == TPointerEvent::EButton1Down )
       
   512             {
       
   513             // Clear the queue, set state to EEmpty, and cancel any pending timeout
       
   514             Reset();
       
   515             iKeyTimeoutTimer->Cancel();
       
   516             }
       
   517         }
   434     _AKNTRACE_FUNC_EXIT;
   518     _AKNTRACE_FUNC_EXIT;
   435     }
   519     }
   436 
   520 
   437 
   521 
   438 EXPORT_C void CAknEcsDetector::AddChar( TText aNewChar )
   522 EXPORT_C void CAknEcsDetector::AddChar( TText aNewChar )
   439     {
   523     {
   440     _AKNTRACE_FUNC_ENTER;
   524     _AKNTRACE_FUNC_ENTER;
   441     _AKNTRACE( "[%s][%s] aNewChar: %s", "CAknEcsDetector", 
   525     _AKNTRACE( "[%s][%s] aNewChar: %s", "CAknEcsDetector", 
   442                                 		__FUNCTION__, &aNewChar );
   526                                 		__FUNCTION__, &aNewChar );
   443     
   527 
   444     if (aNewChar == EKeyQwertyOn || aNewChar == EKeyQwertyOff)
   528     if (aNewChar == EKeyQwertyOn || aNewChar == EKeyQwertyOff)
   445     	{ 
   529         { 
   446         _AKNTRACE_FUNC_EXIT;
   530         _AKNTRACE_FUNC_EXIT;
   447     	return;   // return directly if the aNewChar is slide open/closed.
   531         return;   // return directly if the aNewChar is slide open/closed.
   448     	}
   532         }
   449 
   533 	
   450     iKeyTimeoutTimer->Cancel(); // there might be pending timeout; clear it
   534     iKeyTimeoutTimer->Cancel(); // there might be pending timeout; clear it
   451     if ( aNewChar == EStdKeyYes || aNewChar ==EKeyPhoneSend )
   535     if ( aNewChar == EStdKeyYes || aNewChar == EKeyPhoneSend )
   452         {
   536         {
   453         if ( State() == ECompleteMatch )
   537         if ( iServiceCallEnabled )
   454             {
   538             {
   455             _AKNTRACE( "[%s][%s] SetState( ECompleteMatchThenSendKey )", "CAknEcsDetector", 
   539             if ( iState == ECompleteMatch || iState == EServiceNumMatch )
   456                                             		__FUNCTION__ );
   540                 {
   457             SetState( ECompleteMatchThenSendKey );
   541                 _AKNTRACE( "[%s][%s] SetState( ECompleteMatchThenSendKey )", "CAknEcsDetector", 
       
   542                                             		    __FUNCTION__ );
       
   543                 SetState( ECompleteMatchThenSendKey );
       
   544                 }
       
   545             }
       
   546         else
       
   547             {
       
   548             if ( iState == ECompleteMatch )
       
   549                 {
       
   550                 _AKNTRACE( "[%s][%s] SetState( ECompleteMatchThenSendKey )", "CAknEcsDetector", 
       
   551                                                         __FUNCTION__ );
       
   552                 SetState( ECompleteMatchThenSendKey );
       
   553                 }
   458             }
   554             }
   459         // else do nothing with it...
   555         // else do nothing with it...
   460         }
   556         }
   461     else
   557     else
   462         {
   558         {
   463         TText scanCode = aNewChar;
   559         TText scanCode = aNewChar;
       
   560 
       
   561         if ( scanCode < KAknKeyScanCodeBegin || scanCode > KAknKeyScanCodeEnd )
       
   562             {
       
   563             // Just return since it is an invalid character
       
   564             return;
       
   565             }
       
   566 
   464 #ifdef RD_INTELLIGENT_TEXT_INPUT 
   567 #ifdef RD_INTELLIGENT_TEXT_INPUT 
   465         // Convert scan code to number value here 
   568         // Convert scan code to number value here 
   466         // for 4*10, 3*11, half-qwerty key pad
   569         // for 4*10, 3*11, half-qwerty key pad
   467         // The convert value is referenced from KeymapBuilder.pl in ptienginev2
   570         // The convert value is referenced from KeymapBuilder.pl in ptienginev2
   468         // Note: if the product change the scancode defintion,pls change the following 
   571         // Note: if the product change the scancode defintion,pls change the following 
   586                 bestState = ENoMatch;
   689                 bestState = ENoMatch;
   587                 break;
   690                 break;
   588             case CAknMatchingCharacterQueue::ECompleteMatch:
   691             case CAknMatchingCharacterQueue::ECompleteMatch:
   589                 bestState = ECompleteMatch;
   692                 bestState = ECompleteMatch;
   590                 break;
   693                 break;
       
   694             case CAknMatchingCharacterQueue::EServiceNumMatch:
       
   695                 if ( iServiceCallEnabled )
       
   696                     {
       
   697                     bestState = EServiceNumMatch;
       
   698                     break;
       
   699                     }
       
   700                 // Fall through to default case if service call feature is off
   591             default:
   701             default:
   592                 __ASSERT_DEBUG( 0, Panic(EAknEcsPanicBadState) );
   702                 __ASSERT_DEBUG( 0, Panic(EAknEcsPanicBadState) );
   593                 break;
   703                 break;
   594             }
   704             }
   595         SetState(bestState);
   705         SetState(bestState);
   630         
   740         
   631     iKeyTimeoutTimer->Cancel(); // there might be pending timeout; clear it
   741     iKeyTimeoutTimer->Cancel(); // there might be pending timeout; clear it
   632     iQueue->Reset();
   742     iQueue->Reset();
   633     iQueue->SetBuffer(aNewBuffer);
   743     iQueue->SetBuffer(aNewBuffer);
   634     DetermineState();
   744     DetermineState();
   635     if ( State() == ECompleteMatch )
   745 
   636         {
   746     if ( iServiceCallEnabled )
   637         _AKNTRACE( "[%s][%s] State() == ECompleteMatch ", "CAknEcsDetector", 
   747         {
   638                                                 		__FUNCTION__ );
   748         if ( iState == ECompleteMatch || iState == EServiceNumMatch )
   639         iKeyTimeoutTimer->Start( KEcsInterKeyTimeout,
   749             {
   640             KEcsInterKeyTimeout, TCallBack( CancelMatch, this ) );
   750             iKeyTimeoutTimer->Start( KEcsInterKeyTimeout,
       
   751                 KEcsInterKeyTimeout, TCallBack( CancelMatch, this ) );
       
   752             }
       
   753         }
       
   754     else
       
   755         {
       
   756         if ( iState == ECompleteMatch )
       
   757             {
       
   758             _AKNTRACE( "[%s][%s] State() == ECompleteMatch ", "CAknEcsDetector", 
       
   759                                                 		    __FUNCTION__ );
       
   760             iKeyTimeoutTimer->Start( KEcsInterKeyTimeout,
       
   761                 KEcsInterKeyTimeout, TCallBack( CancelMatch, this ) );
       
   762             }
   641         }
   763         }
   642     _AKNTRACE_FUNC_EXIT;
   764     _AKNTRACE_FUNC_EXIT;
   643     }
   765     }
   644 
   766 
   645 EXPORT_C void CAknEcsDetector::SetState( TState aNewState )
   767 EXPORT_C void CAknEcsDetector::SetState( TState aNewState )
   682                     SetState( EEmpty );
   804                     SetState( EEmpty );
   683                     }
   805                     }
   684                 }
   806                 }
   685             break;
   807             break;
   686 
   808 
       
   809         case EServiceNumMatch:
       
   810             if ( iServiceCallEnabled )
       
   811                 {
       
   812                 if ( aNewState == ECompleteMatchThenSendKey )
       
   813                     {
       
   814                     RelinquishCapturedKeys();
       
   815                     _AKNTRACE( "[%s][%s] Make Service Call", "CAknEcsDetector", 
       
   816                                                                 		__FUNCTION__);
       
   817                     TRAP_IGNORE( MakeServiceCallL() );
       
   818                     }
       
   819                 }
       
   820             break;
       
   821 
   687         default:
   822         default:
   688             break;
   823             break;
   689 
   824 
   690         }
   825         }
   691     _AKNTRACE_FUNC_EXIT;
   826     _AKNTRACE_FUNC_EXIT;
   732     TRAPD( err, iPhCltEmergencyCall->DialEmergencyCallL( CurrentMatch() ) );
   867     TRAPD( err, iPhCltEmergencyCall->DialEmergencyCallL( CurrentMatch() ) );
   733     __ASSERT_DEBUG( err==KErrNone, Panic( EAknEcsPanicDialLLeft ) );
   868     __ASSERT_DEBUG( err==KErrNone, Panic( EAknEcsPanicDialLLeft ) );
   734     if(err != KErrNone)
   869     if(err != KErrNone)
   735         {
   870         {
   736         err = KErrNone;
   871         err = KErrNone;
       
   872         }
       
   873     _AKNTRACE_FUNC_EXIT;
       
   874     }
       
   875 
       
   876 void CAknEcsDetector::MakeServiceCallL()
       
   877     {
       
   878     _AKNTRACE_FUNC_ENTER;
       
   879     if ( iServiceCallEnabled )
       
   880         {
       
   881         CAiwServiceHandler* aiwServiceHandler = CAiwServiceHandler::NewLC();
       
   882         RCriteriaArray interest;
       
   883         CleanupClosePushL( interest );
       
   884 
       
   885         CAiwCriteriaItem* criteria = CAiwCriteriaItem::NewLC( KAiwCmdCall,
       
   886                                          KAiwCmdCall, _L8( "*" ) );
       
   887         TUid base;
       
   888         base.iUid = KAiwClassBase;
       
   889         criteria->SetServiceClass( base );
       
   890         User::LeaveIfError( interest.Append( criteria ) );
       
   891         aiwServiceHandler->AttachL( interest );
       
   892 
       
   893         CAiwDialData* dialData = CAiwDialData::NewLC();
       
   894         dialData->SetCallType( CAiwDialData::EAIWForcedCS );
       
   895         dialData->SetPhoneNumberL( CurrentMatch() );
       
   896         dialData->SetWindowGroup( AIWDialData::KAiwGoToIdle );
       
   897 
       
   898         CAiwGenericParamList& paramList = aiwServiceHandler->InParamListL();
       
   899         dialData->FillInParamListL( paramList );
       
   900 
       
   901         TRAPD( err, aiwServiceHandler->ExecuteServiceCmdL( KAiwCmdCall, paramList,
       
   902                     aiwServiceHandler->OutParamListL(), 0, NULL ) );
       
   903         __ASSERT_DEBUG( err == KErrNone, Panic( EAknEcsPanicDialLLeft ) );
       
   904 
       
   905         //reset the queue
       
   906         iQueue->Reset();
       
   907 
       
   908         CleanupStack::PopAndDestroy( dialData );
       
   909         CleanupStack::PopAndDestroy( criteria );
       
   910         CleanupStack::PopAndDestroy( &interest );
       
   911         CleanupStack::PopAndDestroy( aiwServiceHandler );
       
   912 
       
   913         if( err != KErrNone )
       
   914             {
       
   915             User::Leave( err );
       
   916             }
   737         }
   917         }
   738     _AKNTRACE_FUNC_EXIT;
   918     _AKNTRACE_FUNC_EXIT;
   739     }
   919     }
   740 
   920 
   741 EXPORT_C void CAknEcsDetector::SetObserver( MAknEcsObserver* aObserver )
   921 EXPORT_C void CAknEcsDetector::SetObserver( MAknEcsObserver* aObserver )