Resolve bluetooth hidden API usages

Bug: 143245666
Test: build
Change-Id: Idadf84873c88155382c48bb9108cf28d88aaef0a
This commit is contained in:
William Escande
2022-02-08 15:33:16 +01:00
parent b2ac9d5c9f
commit 4a5c128624
3 changed files with 4 additions and 4 deletions

View File

@@ -435,7 +435,7 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
*/ */
public void onCancel() { public void onCancel() {
Log.d(TAG, "Pairing dialog canceled"); Log.d(TAG, "Pairing dialog canceled");
mDevice.cancelPairing(); mDevice.cancelBondProcess();
} }
/** /**

View File

@@ -98,7 +98,7 @@ public final class BluetoothPairingService extends Service {
} else if (action.equals(ACTION_DISMISS_PAIRING)) { } else if (action.equals(ACTION_DISMISS_PAIRING)) {
Log.d(TAG, "Notification cancel " + " (" + Log.d(TAG, "Notification cancel " + " (" +
mDevice.getName() + ")"); mDevice.getName() + ")");
mDevice.cancelPairing(); mDevice.cancelBondProcess();
} else { } else {
int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE,
BluetoothDevice.ERROR); BluetoothDevice.ERROR);
@@ -144,7 +144,7 @@ public final class BluetoothPairingService extends Service {
createPairingNotification(intent); createPairingNotification(intent);
} else if (TextUtils.equals(action, ACTION_DISMISS_PAIRING)) { } else if (TextUtils.equals(action, ACTION_DISMISS_PAIRING)) {
Log.d(TAG, "Notification cancel " + " (" + mDevice.getName() + ")"); Log.d(TAG, "Notification cancel " + " (" + mDevice.getName() + ")");
mDevice.cancelPairing(); mDevice.cancelBondProcess();
mNm.cancel(NOTIFICATION_ID); mNm.cancel(NOTIFICATION_ID);
stopSelf(); stopSelf();
} else if (TextUtils.equals(action, ACTION_PAIRING_DIALOG)) { } else if (TextUtils.equals(action, ACTION_PAIRING_DIALOG)) {

View File

@@ -106,7 +106,7 @@ public class BluetoothPairingServiceTest {
mBluetoothPairingService.onStartCommand(intent, /* flags */ 0, /* startId */ 0); mBluetoothPairingService.onStartCommand(intent, /* flags */ 0, /* startId */ 0);
verify(mDevice).cancelPairing(); verify(mDevice).cancelBondProcess();
verify(mNm).cancel(mBluetoothPairingService.NOTIFICATION_ID); verify(mNm).cancel(mBluetoothPairingService.NOTIFICATION_ID);
} }