From 4a5c128624e5ebde612e7bb502f9a994d658bf5e Mon Sep 17 00:00:00 2001 From: William Escande Date: Tue, 8 Feb 2022 15:33:16 +0100 Subject: [PATCH] Resolve bluetooth hidden API usages Bug: 143245666 Test: build Change-Id: Idadf84873c88155382c48bb9108cf28d88aaef0a --- .../settings/bluetooth/BluetoothPairingController.java | 2 +- .../android/settings/bluetooth/BluetoothPairingService.java | 4 ++-- .../settings/bluetooth/BluetoothPairingServiceTest.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/android/settings/bluetooth/BluetoothPairingController.java b/src/com/android/settings/bluetooth/BluetoothPairingController.java index b75e02a754a..c70a56ab866 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingController.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingController.java @@ -435,7 +435,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener, */ public void onCancel() { Log.d(TAG, "Pairing dialog canceled"); - mDevice.cancelPairing(); + mDevice.cancelBondProcess(); } /** diff --git a/src/com/android/settings/bluetooth/BluetoothPairingService.java b/src/com/android/settings/bluetooth/BluetoothPairingService.java index bc5dc6695d1..9883e617392 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingService.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingService.java @@ -98,7 +98,7 @@ public final class BluetoothPairingService extends Service { } else if (action.equals(ACTION_DISMISS_PAIRING)) { Log.d(TAG, "Notification cancel " + " (" + mDevice.getName() + ")"); - mDevice.cancelPairing(); + mDevice.cancelBondProcess(); } else { int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR); @@ -144,7 +144,7 @@ public final class BluetoothPairingService extends Service { createPairingNotification(intent); } else if (TextUtils.equals(action, ACTION_DISMISS_PAIRING)) { Log.d(TAG, "Notification cancel " + " (" + mDevice.getName() + ")"); - mDevice.cancelPairing(); + mDevice.cancelBondProcess(); mNm.cancel(NOTIFICATION_ID); stopSelf(); } else if (TextUtils.equals(action, ACTION_PAIRING_DIALOG)) { diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingServiceTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingServiceTest.java index e73b447728e..3194e55770f 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingServiceTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingServiceTest.java @@ -106,7 +106,7 @@ public class BluetoothPairingServiceTest { mBluetoothPairingService.onStartCommand(intent, /* flags */ 0, /* startId */ 0); - verify(mDevice).cancelPairing(); + verify(mDevice).cancelBondProcess(); verify(mNm).cancel(mBluetoothPairingService.NOTIFICATION_ID); }