INNER CODE UNIT · Java
storeDetectedUserDeviceInDB
nic-delhi/AarogyaSetu_Android · app/src/main/java/nic/goi/aarogyasetu/GattClient.java:123
private void storeDetectedUserDeviceInDB(BluetoothModel bluetoothModel) {
Location loc = CoronaApplication.getInstance().getDeviceLastKnownLocation();
if (loc != null) {
if (bluetoothModel != null) {
BluetoothData bluetoothData = new BluetoothData(bluetoothModel.getAddress(), bluetoothModel.getRssi(),
bluetoothModel.getTxPower(), bluetoothModel.getTxPowerLevel());
bluetoothData.setLatitude(loc.getLatitude());
bluetoothData.setLongitude(loc.getLongitude());
DBManager.insertNearbyDetectedDeviceInfo(bluetoothData);
}
}
}
/**
* Listens for Bluetooth adapter events to enable/disable
* advertising and server functionality.
*/
private final BroadcastReceiver mBluetoothReceiver = new BroadcastReceiver() {