# HG changeset patch # User Goffi # Date 1631092633 -7200 # Node ID 3910ad643e9d12a487ddfacf04f6a8570841f538 # Parent d2b17f0f2615d66b3a8cf623a5a1f156e2cc58b7 plugin android: use `callFromThread` instead of `callLater`: `callLater` is not made to be called outside of main thread, `callFromThread` is the method to call in this case. diff -r d2b17f0f2615 -r 3910ad643e9d sat/plugins/plugin_misc_android.py --- a/sat/plugins/plugin_misc_android.py Wed Sep 08 11:17:04 2021 +0200 +++ b/sat/plugins/plugin_misc_android.py Wed Sep 08 11:17:13 2021 +0200 @@ -309,9 +309,11 @@ # "XXX has no attribute 'invoke'" error (looks like the same issue as # https://github.com/kivy/pyjnius/issues/59) self.br = BroadcastReceiver( - callback=lambda *args, **kwargs: reactor.callLater(0, - self.onConnectivityChange), - actions=["android.net.conn.CONNECTIVITY_CHANGE"]) + callback=lambda *args, **kwargs: reactor.callFromThread( + self.onConnectivityChange + ), + actions=["android.net.conn.CONNECTIVITY_CHANGE"] + ) self.br.start() @property