From 02b704b0bae46e2d460c34bf0c19288ad8a9d347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Mon, 18 Sep 2023 21:36:12 +0100 Subject: [PATCH] Fossil: Fix crash due to voice helper --- .../qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java index e06437a2e..26e1395a1 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java @@ -366,7 +366,12 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter implements VoiceHel } private void attachToVoiceService(){ - voiceHelper.connect(); + if (voiceHelper == null) { + voiceHelper = new VoiceHelper(getContext(), this); + } + if (!voiceHelper.isConnected()) { + voiceHelper.connect(); + } } private void detachFromVoiceService(){