From 459db1a0a36fee8e0fcd5f96198b8370aee2219b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 9 Jan 2019 18:30:25 +0100 Subject: [PATCH] ignore startService failure some nokia devices with Android 9 fail to start the service from the activity sometimes. since this is probably a race it should be save to ignore this --- src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index bade7e111..03c60d959 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -217,7 +217,11 @@ public abstract class XmppActivity extends ActionBarActivity { public void connectToBackend() { Intent intent = new Intent(this, XmppConnectionService.class); intent.setAction("ui"); - startService(intent); + try { + startService(intent); + } catch (IllegalStateException e) { + Log.w(Config.LOGTAG,"unable to start service from "+getClass().getSimpleName()); + } bindService(intent, mConnection, Context.BIND_AUTO_CREATE); }