1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-11 19:27:50 +01:00

Limit LiveActivityFragment to just the current device

This commit is contained in:
Arjan Schrijver 2024-10-15 11:19:33 +02:00
parent ace0aa3ea7
commit 2398dd0fbe

View File

@ -348,7 +348,7 @@ public class LiveActivityFragment extends AbstractActivityChartFragment<ChartsDa
renderCharts(); renderCharts();
// have to enable it again and again to keep it measuring // have to enable it again and again to keep it measuring
GBApplication.deviceService().onEnableRealtimeHeartRateMeasurement(true); GBApplication.deviceService(getChartsHost().getDevice()).onEnableRealtimeHeartRateMeasurement(true);
} }
private int getPulseIntervalMillis() { private int getPulseIntervalMillis() {
@ -367,8 +367,8 @@ public class LiveActivityFragment extends AbstractActivityChartFragment<ChartsDa
return; return;
} }
GBApplication.deviceService().onEnableRealtimeSteps(enable); GBApplication.deviceService(getChartsHost().getDevice()).onEnableRealtimeSteps(enable);
GBApplication.deviceService().onEnableRealtimeHeartRateMeasurement(enable); GBApplication.deviceService(getChartsHost().getDevice()).onEnableRealtimeHeartRateMeasurement(enable);
if (enable) { if (enable) {
if (getActivity() != null) { if (getActivity() != null) {
getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);