This method replaces the
BleManager#shouldAutoConnect() method.
Sets whether to connect to the remote device just once (false) or to add the address to
white list of devices that will be automatically connect as soon as they become available
(true). In the latter case, if Bluetooth adapter is enabled, Android scans periodically
for devices from the white list and, if an advertising packet is received from such, it tries
to connect to it. When the connection is lost, the system will keep trying to reconnect to
it. If method is called with parameter set to true, and the connection to the device is
lost, the
BleManagerCallbacks#onLinkLossOccurred(BluetoothDevice) callback is
called instead of
BleManagerCallbacks#onDeviceDisconnected(BluetoothDevice).
This feature works much better on newer Android phone models and may have issues on older
phones.
This method should only be used with bonded devices, as otherwise the device may change
it's address. It will however work also with non-bonded devices with private static address.
A connection attempt to a non-bonded device with private resolvable address will fail.
The first connection to a device will always be created with autoConnect flag to false
(see
BluetoothDevice#connectGatt(Context,boolean,BluetoothGattCallback)). This is
to make it quick as the user most probably waits for a quick response. If autoConnect is
used (true), the following connections will be done using
BluetoothGatt#connect(),
which forces the autoConnect parameter to true.