bluetoothengine/btnotif/src/btnpairnotifier.cpp
branchRCL_3
changeset 72 4b59561a31c0
parent 61 269724087bed
equal deleted inserted replaced
64:1934667b0e2b 72:4b59561a31c0
    68     {
    68     {
    69     return iInfo;
    69     return iInfo;
    70     }
    70     }
    71 
    71 
    72 // ----------------------------------------------------------
    72 // ----------------------------------------------------------
    73 // CBTNPairNotifierBase::ProcessStartParamsL
    73 // CBTNPairNotifierBase::GetParamsL
    74 // ----------------------------------------------------------
    74 // ----------------------------------------------------------
    75 //
    75 //
    76 void CBTNPairNotifierBase::ProcessStartParamsL()
    76 void CBTNPairNotifierBase::GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
    77     {
    77     {
       
    78     (void)aBuffer;
       
    79     if( !iMessage.IsNull() )
       
    80         {
       
    81         User::Leave(KErrInUse);
       
    82         }
       
    83 
       
    84     iMessage = (RMessage2)aMessage;
       
    85     iReplySlot = aReplySlot;
       
    86 
    78     if ( AutoLockOnL() )
    87     if ( AutoLockOnL() )
    79         {
    88         {
    80         // The phone is locked, access denied.
    89         // The phone is locked, access denied.
    81         //
    90         //
    82         CompleteMessage(KErrCancel);
    91         CompleteMessage(KErrCancel);
    83         }
    92         }
       
    93 
    84     }
    94     }
    85 
    95 
    86 // ----------------------------------------------------------
    96 // ----------------------------------------------------------
    87 // CBTNPairNotifierBase::UpdateL
    97 // CBTNPairNotifierBase::UpdateL
    88 // ----------------------------------------------------------
    98 // ----------------------------------------------------------
   113     if (pckg().Result() == KErrNone)
   123     if (pckg().Result() == KErrNone)
   114         {
   124         {
   115         BtNotifNameUtils::SetDeviceNameL(pckg().DeviceName(), *iDevice);
   125         BtNotifNameUtils::SetDeviceNameL(pckg().DeviceName(), *iDevice);
   116 
   126 
   117     // Finally show new prompt for dialog if it is still on the screen
   127     // Finally show new prompt for dialog if it is still on the screen
   118     // and user has not given a alias for device.
   128     // and user has not given a alias for device.   
   119         CBTNotifUIUtil* dialog = NULL;
   129         if( !iNotifUiUtil->IsQueryReleased() && !iDevice->IsValidFriendlyName() )
   120         if ( !iNotifUiUtil->IsQueryReleased())
       
   121             {
       
   122             dialog = iNotifUiUtil;
       
   123             }
       
   124         else if ( !iAuthoriseDialog->IsQueryReleased())
       
   125             {
       
   126             dialog = iAuthoriseDialog;
       
   127             }
       
   128                     
       
   129         if( dialog && !iDevice->IsValidFriendlyName() )
       
   130             {
   130             {
   131             RBuf prompt;
   131             RBuf prompt;
   132             prompt.CleanupClosePushL();
   132             prompt.CleanupClosePushL();
   133             GenerateQueryPromptL( prompt );
   133             GenerateQueryPromptL( prompt );
   134             dialog->UpdateQueryDlgL( prompt );
   134             iNotifUiUtil->UpdateQueryDlgL( prompt );
   135             CleanupStack::PopAndDestroy( &prompt );
   135             CleanupStack::PopAndDestroy( &prompt );
   136             }
   136             }
   137         }
   137         }
   138 
   138 
   139     FLOG(_L("[BTNOTIF]\t CBTNPairNotifierBase::UpdateL() completed"));
   139     FLOG(_L("[BTNOTIF]\t CBTNPairNotifierBase::UpdateL() completed"));
   211     BluetoothUiUtil::LoadResourceAndSubstringL( 
   211     BluetoothUiUtil::LoadResourceAndSubstringL( 
   212             prompt, R_BT_ACCEPT_PAIRING_REQUEST, devName, 0 );
   212             prompt, R_BT_ACCEPT_PAIRING_REQUEST, devName, 0 );
   213 
   213 
   214     devName.Zero();
   214     devName.Zero();
   215     // Show query for use to accept/reject incoming pairing request
   215     // Show query for use to accept/reject incoming pairing request
   216     TInt keypress = iAuthoriseDialog->ShowQueryL( prompt, R_BT_GENERIC_QUERY, 
   216     TInt keypress = iNotifUiUtil->ShowQueryL( prompt, R_BT_GENERIC_QUERY, 
   217              ECmdBTnotifUnavailable, devName, CAknQueryDialog::EConfirmationTone);
   217              ECmdBTnotifUnavailable, devName, CAknQueryDialog::EConfirmationTone );
   218     
       
   219     CleanupStack::PopAndDestroy( &prompt );
   218     CleanupStack::PopAndDestroy( &prompt );
   220 
   219 
   221     if( iMessage.IsNull() ) // cancelled by the stack
   220     if( iMessage.IsNull() ) // cancelled by the stack
   222         {
   221         {
   223         return EFalse;
   222         return EFalse;