Limit LiveActivityFragment to just the current device

Filter incoming realtime samples by device
This commit is contained in:
René Vögeli 2024-10-15 18:39:35 +02:00 committed by José Rebelo
parent 43a1613f95
commit 8bb9a36a68

View File

@ -158,6 +158,11 @@ public class LiveActivityFragment extends AbstractActivityChartFragment<ChartsDa
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final GBDevice device = intent.getParcelableExtra(GBDevice.EXTRA_DEVICE);
if (device == null || !device.equals(getChartsHost().getDevice())) {
return;
}
String action = intent.getAction();
switch (action) {
case DeviceService.ACTION_REALTIME_SAMPLES: {