13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include "btnotifpairingmanager.h" |
18 #include "btnotifsecuritymanager.h" |
19 #include "btnotifbasepairinghandler.h" |
19 #include "btnotifbasepairinghandler.h" |
|
20 #include "btnotificationmanager.h" |
|
21 #include "bluetoothnotification.h" |
|
22 #include "btnotifconnectiontracker.h" |
|
23 #include "bluetoothtrace.h" |
20 |
24 |
21 // ======== MEMBER FUNCTIONS ======== |
25 // ======== MEMBER FUNCTIONS ======== |
22 |
26 |
23 // --------------------------------------------------------------------------- |
27 // --------------------------------------------------------------------------- |
24 // C++ default constructor |
28 // C++ default constructor |
25 // --------------------------------------------------------------------------- |
29 // --------------------------------------------------------------------------- |
26 // |
30 // |
27 CBTNotifBasePairingHandler::CBTNotifBasePairingHandler( CBTNotifPairingManager& aParent, const TBTDevAddr& aAddr) |
31 CBTNotifBasePairingHandler::CBTNotifBasePairingHandler( CBTNotifSecurityManager& aParent, const TBTDevAddr& aAddr) |
28 : iAddr( aAddr ), iParent( aParent ) |
32 : iAddr( aAddr ), iParent( aParent ) |
29 { |
33 { |
30 } |
34 } |
31 |
35 |
32 // --------------------------------------------------------------------------- |
36 // --------------------------------------------------------------------------- |
119 TBool CBTNotifBasePairingHandler::IsPairResultSet() |
123 TBool CBTNotifBasePairingHandler::IsPairResultSet() |
120 { |
124 { |
121 return iPairResultSet; |
125 return iPairResultSet; |
122 } |
126 } |
123 |
127 |
|
128 // --------------------------------------------------------------------------- |
|
129 // Invalidate iPairResultSet |
|
130 // --------------------------------------------------------------------------- |
|
131 // |
|
132 void CBTNotifBasePairingHandler::ShowPairingResultNoteL(TInt aResult) |
|
133 { |
|
134 BOstraceFunctionEntry0( DUMMY_DEVLIST ); |
|
135 CBluetoothNotification* notification = |
|
136 iParent.ConnectionTracker().NotificationManager()->GetNotification(); |
|
137 User::LeaveIfNull( notification ); // For OOM exception, leaves with KErrNoMemory |
|
138 TBTDialogResourceId resourceId = EPairingSuccess; |
|
139 if(KErrNone != aResult) |
|
140 { |
|
141 resourceId = EPairingFailure; |
|
142 } |
|
143 notification->SetNotificationType( TBluetoothDialogParams::ENote, resourceId ); |
|
144 const CBtDevExtension* dev = iParent.BTDevRepository().Device(iAddr); |
|
145 if(dev) |
|
146 { |
|
147 User::LeaveIfError(notification->SetData( TBluetoothDeviceDialog::EDeviceName, dev->Alias())); |
|
148 User::LeaveIfError(notification->SetData( TBluetoothDeviceDialog::EDeviceClass, dev->Device().DeviceClass().DeviceClass())); |
|
149 } |
|
150 else |
|
151 { |
|
152 TBTDeviceName name; |
|
153 iAddr.GetReadable(name); |
|
154 User::LeaveIfError(notification->SetData( TBluetoothDialogParams::EAddress, name )); |
|
155 User::LeaveIfError(notification->SetData( TBluetoothDeviceDialog::EDeviceClass, 0)); // No device class |
|
156 } |
|
157 iParent.ConnectionTracker().NotificationManager()->QueueNotificationL( notification); |
|
158 BOstraceFunctionExit0( DUMMY_DEVLIST ); |
|
159 } |
124 |
160 |
125 |
161 |
126 |
162 |