bluetoothengine/btnotif/btnotifsrv/src/btnotifincomingpairinghandler.cpp
changeset 63 bcf742120177
parent 41 0b2439c3e397
--- a/bluetoothengine/btnotif/btnotifsrv/src/btnotifincomingpairinghandler.cpp	Wed Aug 18 09:59:05 2010 +0300
+++ b/bluetoothengine/btnotif/btnotifsrv/src/btnotifincomingpairinghandler.cpp	Fri Sep 17 08:30:56 2010 +0300
@@ -22,6 +22,7 @@
 #include "bluetoothtrace.h"
 
 const TInt KBTNotifWaitingForPairingOkDelay = 500000; // 0.5s
+const TInt KBTNotif10SecondTimer = 10000000;
 
 enum TPairingStageId
     {
@@ -156,6 +157,11 @@
         {
         // Pair failure situation.
         SetPairResult( aResult );
+        TRAPD(err , ShowPairingResultNoteL(KErrGeneral));
+        if(!err && iNotification)
+            {
+            iNotification->SetCloseTimer(KBTNotif10SecondTimer);
+            }
         }
     BOstraceFunctionExit0( DUMMY_DEVLIST );
     }
@@ -175,6 +181,11 @@
         iActivePairingOk->Cancel();
         UnSetPairResult();  // we might have set it before (if the link went down) so we want to reset it.   
         }
+    // If the user checked the trusted checkbox then we trust the device
+    if(iTrustDevice)
+        {
+        iParent.TrustDevice(iAddr);
+        }
     if (aDev.LinkKeyType() == ELinkKeyUnauthenticatedNonUpgradable && !iUserAwarePairing)
 		{
 		// If an application uses btengconnman API to connect a service of 
@@ -245,6 +256,11 @@
                 // it has been reset. But we need to have it set to an error as we are notifying 
                 // the "unable to pair" message.
                 SetPairResult(KErrGeneral);
+                TRAPD(err , ShowPairingResultNoteL(KErrGeneral));
+                if(!err && iNotification)
+                    {
+                    iNotification->SetCloseTimer(KBTNotif10SecondTimer);
+                    }
                 }
             iParent.RenewPairingHandler( NULL );
             break;