# HG changeset patch # User Goffi # Date 1580156228 -3600 # Node ID bbf992b0be0d4e4f74d34387dde56fb2a218cc06 # Parent 7fd138c1250651740bafea9b93beb5c678da17a2 android (service): set autorestart: with this option, the backend will automatically restart as soon as terminated. This is notably important at the moment to work around a P4A bug which result in a backend killed when frontend is closed (cf. https://github.com/kivy/python-for-android/issues/2053) diff -r 7fd138c12506 -r bbf992b0be0d service/main.py --- a/service/main.py Mon Jan 27 21:17:08 2020 +0100 +++ b/service/main.py Mon Jan 27 21:17:08 2020 +0100 @@ -1,5 +1,4 @@ -#!/usr//bin/env python2 -# -*- coding: utf-8 -*- +#!/usr/bin/env python3 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client # Copyright (C) 2016-2018 Jérôme Poisson (goffi@goffi.org) @@ -37,6 +36,12 @@ from sat.core import sat_main from twisted.internet import reactor from twisted.application import app, service +from jnius import autoclass + + +PythonService = autoclass('org.kivy.android.PythonService') +PythonService.mService.setAutoRestartService(True) + sat = sat_main.SAT() application = service.Application("SàT backend")