From b2af6ce1bd237f34f4bb3ccf84ae896a38de7e73 Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Thu, 27 May 2021 10:08:24 +0800 Subject: [PATCH] Fix bluetooth pairing notification could not be removed Remove the notification when deivce is not bonding. Bug: 189284833 Test: manually test Change-Id: Iaa7f04175dac2016777b0de287122108b74b34d8 --- .../android/settings/bluetooth/BluetoothPairingService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/BluetoothPairingService.java b/src/com/android/settings/bluetooth/BluetoothPairingService.java index 0bff721b8a9..e8d8b1e6ee0 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingService.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingService.java @@ -134,7 +134,8 @@ public final class BluetoothPairingService extends Service { mDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); if (mDevice != null && mDevice.getBondState() != BluetoothDevice.BOND_BONDING) { - Log.w(TAG, "Device " + mDevice + " not bonding: " + mDevice.getBondState()); + Log.w(TAG, "Device " + mDevice.getName() + " not bonding: " + mDevice.getBondState()); + mNm.cancel(NOTIFICATION_ID); stopSelf(); return START_NOT_STICKY; }