public final class CachedBluetoothDeviceManager extends Object
Modifier and Type | Method and Description |
---|---|
CachedBluetoothDevice |
addDevice(LocalBluetoothAdapter adapter,
LocalBluetoothProfileManager profileManager,
BluetoothDevice device)
Create and return a new
CachedBluetoothDevice . |
void |
clearNonBondedDevices() |
CachedBluetoothDevice |
findDevice(BluetoothDevice device)
Search for existing
CachedBluetoothDevice or return null
if this device isn't in the cache. |
Collection<CachedBluetoothDevice> |
getCachedDevicesCopy() |
String |
getName(BluetoothDevice device)
Attempts to get the name of a remote device, otherwise returns the address.
|
void |
onBluetoothStateChanged(int bluetoothState) |
void |
onBtClassChanged(BluetoothDevice device) |
static boolean |
onDeviceDisappeared(CachedBluetoothDevice cachedDevice) |
void |
onDeviceNameUpdated(BluetoothDevice device) |
void |
onScanningStateChanged(boolean started) |
void |
onUuidChanged(BluetoothDevice device) |
public Collection<CachedBluetoothDevice> getCachedDevicesCopy()
public static boolean onDeviceDisappeared(CachedBluetoothDevice cachedDevice)
public void onDeviceNameUpdated(BluetoothDevice device)
public CachedBluetoothDevice findDevice(BluetoothDevice device)
CachedBluetoothDevice
or return null
if this device isn't in the cache. Use addDevice(com.android.settingslib.bluetooth.LocalBluetoothAdapter, com.android.settingslib.bluetooth.LocalBluetoothProfileManager, android.bluetooth.BluetoothDevice)
to create and return a new CachedBluetoothDevice
for
a newly discovered BluetoothDevice
.device
- the address of the Bluetooth devicepublic CachedBluetoothDevice addDevice(LocalBluetoothAdapter adapter, LocalBluetoothProfileManager profileManager, BluetoothDevice device)
CachedBluetoothDevice
. This assumes
that findDevice(android.bluetooth.BluetoothDevice)
has already been called and returned null.device
- the address of the new Bluetooth devicepublic String getName(BluetoothDevice device)
device
- The remote device.public void clearNonBondedDevices()
public void onScanningStateChanged(boolean started)
public void onBtClassChanged(BluetoothDevice device)
public void onUuidChanged(BluetoothDevice device)
public void onBluetoothStateChanged(int bluetoothState)