Auto-connect Bluetooth device only when user initiates pairing.
Fix bug 2271901: do not auto-connect to services on a BT device when pairing was initiated by the device (e.g. for OPP file transfer). Also corrected some typos and removed an unneeded lock object in LocalBluetoothManager (synchronize on .class object instead, like android.bluetooth.BluetoothDevice.getService() does). Change-Id: I121105c6eee2658129f6094786754bbc7932d324
This commit is contained in:
@@ -182,15 +182,6 @@ public class CachedBluetoothDeviceManager {
|
||||
}
|
||||
|
||||
cachedDevice.onBondingStateChanged(bondState);
|
||||
|
||||
if (bondState == BluetoothDevice.BOND_BONDED) {
|
||||
// Auto-connect after pairing
|
||||
if (!device.isBluetoothDock()) {
|
||||
cachedDevice.connect();
|
||||
} else {
|
||||
cachedDevice.onBondingDockConnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user