From c918765931d55be2a27fa3a656ab56700f1fc99a Mon Sep 17 00:00:00 2001 From: Arjan Schrijver Date: Fri, 13 Dec 2024 21:38:38 +0100 Subject: [PATCH] Fix app crash when switching between Android user profiles --- .../gadgetbridge/service/btclassic/BtClassicIoThread.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btclassic/BtClassicIoThread.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btclassic/BtClassicIoThread.java index 8ff15e519..6c91b54c3 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btclassic/BtClassicIoThread.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btclassic/BtClassicIoThread.java @@ -168,6 +168,13 @@ public abstract class BtClassicIoThread extends GBDeviceIoThread { mOutStream = null; mBtSocket = null; return false; + } catch (SecurityException e) { + LOG.error("Could not connect to device.", e); + setUpdateState(originalState); + mInStream = null; + mOutStream = null; + mBtSocket = null; + return false; } initialize();