am 8e6a5d31
: am 27543d42
: am 0223f9c5
: Merge "Bluetooth: GAP: Cancel the pairing notification on bond state change"
* commit '8e6a5d31344395ffce77caff217a90f5d0d25ab1': Bluetooth: GAP: Cancel the pairing notification on bond state change
This commit is contained in:
@@ -103,6 +103,19 @@ public final class BluetoothPairingRequest extends BroadcastReceiver {
|
||||
NotificationManager manager = (NotificationManager) context
|
||||
.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
manager.cancel(NOTIFICATION_ID);
|
||||
|
||||
} else if (BluetoothDevice.ACTION_BOND_STATE_CHANGED.equals(action)) {
|
||||
int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE,
|
||||
BluetoothDevice.ERROR);
|
||||
int oldState = intent.getIntExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE,
|
||||
BluetoothDevice.ERROR);
|
||||
if((oldState == BluetoothDevice.BOND_BONDING) &&
|
||||
(bondState == BluetoothDevice.BOND_NONE)) {
|
||||
// Remove the notification
|
||||
NotificationManager manager = (NotificationManager) context
|
||||
.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
manager.cancel(NOTIFICATION_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user