Merge "Fix pair another dialog doesn't show up after pairing in all bluetooth device page." into udc-dev

This commit is contained in:
Jason Hsu
2023-04-18 08:47:37 +00:00
committed by Android (Google) Code Review
5 changed files with 183 additions and 3 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.bluetooth;
import static android.app.Activity.RESULT_OK;
import static android.os.UserManager.DISALLOW_CONFIG_BLUETOOTH;
import android.bluetooth.BluetoothAdapter;
@@ -93,6 +94,7 @@ public abstract class BluetoothDevicePairingDetailBase extends DeviceListPrefere
public void onDeviceBondStateChanged(CachedBluetoothDevice cachedDevice, int bondState) {
if (bondState == BluetoothDevice.BOND_BONDED) {
// If one device is connected(bonded), then close this fragment.
setResult(RESULT_OK);
finish();
return;
} else if (bondState == BluetoothDevice.BOND_BONDING) {
@@ -124,6 +126,7 @@ public abstract class BluetoothDevicePairingDetailBase extends DeviceListPrefere
if (cachedDevice != null && cachedDevice.isConnected()) {
final BluetoothDevice device = cachedDevice.getDevice();
if (device != null && mSelectedList.contains(device)) {
setResult(RESULT_OK);
finish();
} else if (mDevicePreferenceMap.containsKey(cachedDevice)) {
onDeviceDeleted(cachedDevice);