bluetoothengine/btnotif/src/BTNGenericInfoNotifier.cpp
branchRCL_3
changeset 13 b6f55cd40afd
parent 6 6a29d5ad0713
child 14 f7fbeaeb166a
equal deleted inserted replaced
11:a42ed326b458 13:b6f55cd40afd
    83 // ----------------------------------------------------------
    83 // ----------------------------------------------------------
    84 //
    84 //
    85 TPtrC8 CBTGenericInfoNotifier::StartL( const TDesC8& aBuffer )
    85 TPtrC8 CBTGenericInfoNotifier::StartL( const TDesC8& aBuffer )
    86     {
    86     {
    87     FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::StartL()"));
    87     FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::StartL()"));
    88  	ProcessParamBufferL(aBuffer);
    88     if( !iNotifUiUtil )
    89 
    89         {
    90 	FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::StartL() completed"));
    90         iNotifUiUtil = CBTNotifUIUtil::NewL( iIsCoverUI );
    91 	
    91         }
       
    92     ProcessParamBufferL(aBuffer, ETrue);
       
    93     FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::StartL() completed"));
       
    94 
    92     TPtrC8 ret(KNullDesC8);
    95     TPtrC8 ret(KNullDesC8);
    93     return (ret);
    96     return (ret);
    94     }
    97     }
    95 
    98 
    96 // ----------------------------------------------------------
    99 // ----------------------------------------------------------
   107 	    {
   110 	    {
   108 	    aMessage.Complete(KErrInUse);
   111 	    aMessage.Complete(KErrInUse);
   109 	    return;
   112 	    return;
   110 	    }
   113 	    }
   111     iMessage = aMessage;
   114     iMessage = aMessage;
   112  	ProcessParamBufferL(aBuffer);
   115  	ProcessParamBufferL(aBuffer, EFalse);
   113     }
   116     }
   114 
   117 
   115 // ----------------------------------------------------------
   118 // ----------------------------------------------------------
   116 // CBTGenericInfoNotifier::ProcessParamBufferL
   119 // CBTGenericInfoNotifier::ProcessParamBufferL
   117 // Parse the data out of the message that is sent by the
   120 // Parse the data out of the message that is sent by the
   118 // client of the notifier.
   121 // client of the notifier.
   119 // ----------------------------------------------------------
   122 // ----------------------------------------------------------
   120 void CBTGenericInfoNotifier::ProcessParamBufferL(const TDesC8& aBuffer)
   123 void CBTGenericInfoNotifier::ProcessParamBufferL(const TDesC8& aBuffer, TBool aSyncCall)
   121 	{
   124 	{
   122 	TBTGenericInfoNotifierParams bParams;
   125 	TBTGenericInfoNotifierParams bParams;
   123 	TPckgC<TBTGenericInfoNotifierParams> bPckg(bParams);	
   126 	TPckgC<TBTGenericInfoNotifierParams> bPckg(bParams);
   124 		
   127 		
   125 	bPckg.Set( aBuffer );
   128 	bPckg.Set( aBuffer );
   126 	iSecondaryDisplayCommand = ECmdBTnotifUnavailable;
   129 	iSecondaryDisplayCommand = ECmdBTnotifUnavailable;
   127 	switch (bPckg().iMessageType)
   130 	switch (bPckg().iMessageType)
   128 		{
   131 		{
   220 		    }
   223 		    }
   221 	    GetDeviceFromRegL( iBTAddr );
   224 	    GetDeviceFromRegL( iBTAddr );
   222 		}
   225 		}
   223 	else
   226 	else
   224 	    {
   227 	    {
   225 	    ShowNoteAndCompleteL();
   228 	    ShowNoteAndCompleteL(aSyncCall);
   226 	    }
   229 	    }
   227 	}
   230 	}
   228 	
   231 	
   229 // ----------------------------------------------------------
   232 // ----------------------------------------------------------
   230 // CBTGenericInfoNotifier::ShowNoteAndCompleteL
   233 // CBTGenericInfoNotifier::ShowNoteAndCompleteL
   231 // Shows the notifier in backround 
   234 // Shows the notifier in backround 
   232 // ----------------------------------------------------------
   235 // ----------------------------------------------------------
   233 //
   236 //
   234 void CBTGenericInfoNotifier::ShowNoteAndCompleteL()
   237 void CBTGenericInfoNotifier::ShowNoteAndCompleteL(TBool aSyncCall)
   235 	{
   238 	{
   236 	iNotifUiUtil->ShowInfoNoteL( iQueryMessage, iSecondaryDisplayCommand );
   239 	iNotifUiUtil->ShowInfoNoteL( iQueryMessage, iSecondaryDisplayCommand );
   237     CompleteMessage(KErrNone);
   240 	if (!aSyncCall)
       
   241 		{
       
   242         CompleteMessage(KErrNone);
       
   243         }
   238     FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::ShowNoteAndComplete() complete"));
   244     FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::ShowNoteAndComplete() complete"));
   239 	}
   245 	}
   240 
   246 
   241 void CBTGenericInfoNotifier::HandleGetDeviceCompletedL(const CBTDevice* /*aDev*/)
   247 void CBTGenericInfoNotifier::HandleGetDeviceCompletedL(const CBTDevice* /*aDev*/)
   242     {
   248     {
   246     BtNotifNameUtils::GetDeviceDisplayName(name, iDevice);
   252     BtNotifNameUtils::GetDeviceDisplayName(name, iDevice);
   247     iQueryMessage.Zero();
   253     iQueryMessage.Zero();
   248     BluetoothUiUtil::LoadResourceAndSubstringL( 
   254     BluetoothUiUtil::LoadResourceAndSubstringL( 
   249             iQueryMessage, iMessageResourceId, name, 0);      
   255             iQueryMessage, iMessageResourceId, name, 0);      
   250     
   256     
   251     ShowNoteAndCompleteL();
   257     ShowNoteAndCompleteL(EFalse);
   252 
   258 
   253     FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::HandleGetDeviceComplete() Complete"));        
   259     FLOG(_L("[BTNOTIF]\t CBTGenericInfoNotifier::HandleGetDeviceComplete() Complete"));        
   254     }
   260     }
   255 
   261 
   256 // End of File
   262 // End of File