Mercurial > libervia-backend
comparison sat/plugins/plugin_misc_android.py @ 3661:cbb988a6f507
merge bookmark `@`
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 08 Sep 2021 11:20:37 +0200 |
parents | 3910ad643e9d |
children | 524856bd7b19 |
comparison
equal
deleted
inserted
replaced
3639:05db744f194f | 3661:cbb988a6f507 |
---|---|
307 | 307 |
308 # XXX: we need to keep a reference to BroadcastReceiver to avoid | 308 # XXX: we need to keep a reference to BroadcastReceiver to avoid |
309 # "XXX has no attribute 'invoke'" error (looks like the same issue as | 309 # "XXX has no attribute 'invoke'" error (looks like the same issue as |
310 # https://github.com/kivy/pyjnius/issues/59) | 310 # https://github.com/kivy/pyjnius/issues/59) |
311 self.br = BroadcastReceiver( | 311 self.br = BroadcastReceiver( |
312 callback=lambda *args, **kwargs: reactor.callLater(0, | 312 callback=lambda *args, **kwargs: reactor.callFromThread( |
313 self.onConnectivityChange), | 313 self.onConnectivityChange |
314 actions=["android.net.conn.CONNECTIVITY_CHANGE"]) | 314 ), |
315 actions=["android.net.conn.CONNECTIVITY_CHANGE"] | |
316 ) | |
315 self.br.start() | 317 self.br.start() |
316 | 318 |
317 @property | 319 @property |
318 def state(self): | 320 def state(self): |
319 return self._state | 321 return self._state |