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
This commit is contained in:
Goffi 2019-07-20 20:53:52 +02:00
commit 303f82d012

View file

@ -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):