diff options
author | venkata Jagadeesh <vjagad@codeaurora.org> | 2013-04-05 19:02:43 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:21:07 -0600 |
commit | babc6b4611384abc484beee4cdda1228197c501b (patch) | |
tree | 8bbdcde339dd0722e2739c46ecc40d96eeaa1858 /src/com/android/settings/bluetooth | |
parent | 1f9075cce6a18a7cc3af85e5256e617e8526baaf (diff) | |
download | packages_apps_Settings-babc6b4611384abc484beee4cdda1228197c501b.zip packages_apps_Settings-babc6b4611384abc484beee4cdda1228197c501b.tar.gz packages_apps_Settings-babc6b4611384abc484beee4cdda1228197c501b.tar.bz2 |
Bluetooth: Handle pairing Cancel intent.
Receive Pairing cancel intent and clear pairing request
from notification window.
CRs-fixed: 463362
Change-Id: I63c9299edca4356485f26cbc6332e3be9bdfbf17
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rw-r--r-- | src/com/android/settings/bluetooth/BluetoothPairingRequest.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java index 5b06661..5290538 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java @@ -78,7 +78,7 @@ public final class BluetoothPairingRequest extends BroadcastReceiver { .setTicker(res.getString(R.string.bluetooth_notif_ticker)); PendingIntent pending = PendingIntent.getActivity(context, 0, - pairingIntent, PendingIntent.FLAG_ONE_SHOT); + pairingIntent, PendingIntent.FLAG_UPDATE_CURRENT); String name = intent.getStringExtra(BluetoothDevice.EXTRA_NAME); if (TextUtils.isEmpty(name)) { @@ -100,6 +100,16 @@ public final class BluetoothPairingRequest extends BroadcastReceiver { } } else if (action.equals(BluetoothDevice.ACTION_PAIRING_CANCEL)) { + Intent pairingIntent = new Intent(); + + pairingIntent.setClass(context, BluetoothPairingDialog.class); + pairingIntent.setAction(BluetoothDevice.ACTION_PAIRING_REQUEST); + pairingIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + PendingIntent pending = PendingIntent.getActivity(context, 0, + pairingIntent, PendingIntent.FLAG_NO_CREATE); + if (pending != null) { + pending.cancel(); + } // Remove the notification NotificationManager manager = (NotificationManager) context |