From 303f82d01200942e9d6080f0354452c3d39d00c2 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sat, 20 Jul 2019 20:53:52 +0200 Subject: [PATCH] plugin android: catch and log exception when using the vibrator: vibrator is currently not working with plyer, this patch avoid a crash and log the issue. rel 332 --- sat/plugins/plugin_misc_android.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sat/plugins/plugin_misc_android.py b/sat/plugins/plugin_misc_android.py index 3569e067..11a90858 100644 --- a/sat/plugins/plugin_misc_android.py +++ b/sat/plugins/plugin_misc_android.py @@ -243,7 +243,12 @@ class AndroidPlugin(object): if self.host.memory.getParamA( PARAM_VIBRATE_NAME, PARAM_VIBRATE_CATEGORY, profile_key=client.profile ): - vibrator.vibrate() + try: + vibrator.vibrate() + except Exception as e: + # FIXME: vibrator is currently not working, + # cf. https://github.com/kivy/plyer/issues/509 + log.warning(u"Can't use vibrator: {e}".format(e=e)) return mess_data def messageReceivedTrigger(self, client, message_elt, post_treat):