From 13375e5f44bac2d66cab6111339c1c5a95869d9d Mon Sep 17 00:00:00 2001 From: Hugh Chen Date: Fri, 5 Nov 2021 09:22:13 +0000 Subject: [PATCH] Fix phone shows incorrect pairing code in pairing dialog Add PendingIntent.FLAG_UPDATE_CURRENT to let peding intent can be updated the intent extra. Bug: 204133175 Test: make -j64 RunSettingsRoboTests Change-Id: I42966432dacc3727d31231d10aa07b782bb1d92e --- .../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 4c3c9a9be94..bc5dc6695d1 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingService.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingService.java @@ -188,7 +188,8 @@ public final class BluetoothPairingService extends Service { } PendingIntent pairIntent = PendingIntent.getService(this, 0, pairingDialogIntent, - PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT + | PendingIntent.FLAG_IMMUTABLE); Intent serviceIntent = new Intent(ACTION_DISMISS_PAIRING); serviceIntent.setClass(this, BluetoothPairingService.class);