Loading AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1295,6 +1295,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> Loading src/com/android/settings/bluetooth/BluetoothPairingRequest.java +13 −0 Original line number Diff line number Diff line Loading @@ -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); } } } } Loading
AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -1295,6 +1295,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> Loading
src/com/android/settings/bluetooth/BluetoothPairingRequest.java +13 −0 Original line number Diff line number Diff line Loading @@ -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); } } } }