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:
parent
cf83f04af4
commit
303f82d012
1 changed files with 6 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue