mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-27 02:55:50 +01:00
DeviceCommunicationService: catch uncaught exceptions from handleActions
Exceptions raised while handling actions in the device's support class may result in the DeviceCommunicationService crashing as a whole and not being started again until the user forces GB to make a connection by pressing the device from the list. This change is made, because Xiaomi devices make use of proto2 messages, where optional fields cannot be set to null values as that will make it throw NPEs.
This commit is contained in:
parent
7f7834c620
commit
561dc16b28
@ -689,6 +689,8 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
|
|||||||
handleAction(intent, action, device1);
|
handleAction(intent, action, device1);
|
||||||
} catch (DeviceNotFoundException e) {
|
} catch (DeviceNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.error("An exception was raised while handling the action {} for the device {}: ", action, device1, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user