diff options
author | Matthew Xie <mattx@google.com> | 2014-02-24 14:25:28 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-02-24 14:25:28 +0000 |
commit | 27543d42ff79b92e2ec3ddcbe970633b848231e8 (patch) | |
tree | 25a318e80ef1a3c80b849b0926ef91fa90f9bc6d | |
parent | e0388230768168af31c26507b5889985daa93169 (diff) | |
parent | 0223f9c5ddfdbcd2c759d1b0cf289844ca0438c0 (diff) | |
download | packages_apps_Settings-27543d42ff79b92e2ec3ddcbe970633b848231e8.zip packages_apps_Settings-27543d42ff79b92e2ec3ddcbe970633b848231e8.tar.gz packages_apps_Settings-27543d42ff79b92e2ec3ddcbe970633b848231e8.tar.bz2 |
am 0223f9c5: Merge "Bluetooth: GAP: Cancel the pairing notification on bond state change"
* commit '0223f9c5ddfdbcd2c759d1b0cf289844ca0438c0':
Bluetooth: GAP: Cancel the pairing notification on bond state change
-rw-r--r-- | AndroidManifest.xml | 1 | ||||
-rw-r--r-- | src/com/android/settings/bluetooth/BluetoothPairingRequest.java | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 36bc9f6..48be7d8 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1297,6 +1297,7 @@ <intent-filter> <action android:name="android.bluetooth.device.action.PAIRING_REQUEST" /> <action android:name="android.bluetooth.device.action.PAIRING_CANCEL" /> + <action android:name="android.bluetooth.device.action.BOND_STATE_CHANGED" /> </intent-filter> </receiver> diff --git a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java index 838e7b1..ea36fee 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java @@ -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); + } } } } |