Space
- Space type parameter which the discovered devices belong toDevice
- Bluetooth device type parameterpublic abstract class AbstractDeviceDiscoverer<Space,Device extends RemoteBluetoothDevice,Filter extends com.android.internal.util.Predicate<Device>> extends java.lang.Object implements BluetoothDeviceDiscoverer, ShuffledDevicesResolver.ResolveCallback
Modifier | Constructor and Description |
---|---|
protected |
AbstractDeviceDiscoverer(DiscoveryContract discoveryContract,
ScanContext scanContext,
java.util.Collection<Space> spaceSet,
java.util.Collection<Filter> filters,
FutureShufflesCache shufflesCache) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
applyFilters(Device device) |
protected abstract BluetoothDeviceEvent |
createEvent(EventType eventType,
Space space,
java.util.List<Device> deviceList) |
void |
disable()
Disables and clears discoverer.
|
void |
evictInactiveDevices(long currentTimeMillis)
Evicts inactive devices.
|
protected ReplacingArrayList<Device> |
getDevicesInSpace(Space space) |
protected java.util.Collection<Space> |
getSpaceSet() |
protected void |
insertDevicesIntoSpace(Space space,
ReplacingArrayList<Device> deviceList) |
protected void |
notifyDevicePresent(int deviceAddressHashcode,
long timestamp) |
protected void |
notifySpacePresent(int spaceHashcode,
long timestamp) |
protected abstract void |
onBeforeDeviceLost(Device device) |
protected void |
onDeviceDiscoveredEvent(Space space,
Device device) |
protected void |
onDevicesUpdatedEvent(Space space,
java.util.Collection<Device> deviceList) |
void |
onResolved(RemoteBluetoothDevice device) |
protected abstract void |
onShuffleResolved(Device device) |
protected void |
onSpaceEnteredEvent(Space space) |
protected void |
resolveShuffled(RemoteBluetoothDevice device) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
performDiscovery
protected AbstractDeviceDiscoverer(DiscoveryContract discoveryContract, ScanContext scanContext, java.util.Collection<Space> spaceSet, java.util.Collection<Filter> filters, FutureShufflesCache shufflesCache)
protected abstract BluetoothDeviceEvent createEvent(EventType eventType, Space space, java.util.List<Device> deviceList)
protected abstract void onBeforeDeviceLost(Device device)
protected abstract void onShuffleResolved(Device device)
protected void notifyDevicePresent(int deviceAddressHashcode, long timestamp)
protected void notifySpacePresent(int spaceHashcode, long timestamp)
protected java.util.Collection<Space> getSpaceSet()
protected ReplacingArrayList<Device> getDevicesInSpace(Space space)
protected void resolveShuffled(RemoteBluetoothDevice device)
public void onResolved(RemoteBluetoothDevice device)
onResolved
in interface ShuffledDevicesResolver.ResolveCallback
protected boolean applyFilters(Device device)
protected void insertDevicesIntoSpace(Space space, ReplacingArrayList<Device> deviceList)
protected void onSpaceEnteredEvent(Space space)
protected void onDevicesUpdatedEvent(Space space, java.util.Collection<Device> deviceList)
public void evictInactiveDevices(long currentTimeMillis)
BluetoothDeviceDiscoverer
ActivityCheckConfiguration.getInactivityTimeout()
evictInactiveDevices
in interface BluetoothDeviceDiscoverer
currentTimeMillis
- current system time millispublic void disable()
BluetoothDeviceDiscoverer
disable
in interface BluetoothDeviceDiscoverer