From d4c0f2d288aed4ec49a0eaa1e369a98bf34cc1dc Mon Sep 17 00:00:00 2001 From: cyBerta Date: Wed, 10 Jun 2020 23:22:38 +0200 Subject: catch rare IllegalStateExceptions when enqueueing jobs --- app/src/main/AndroidManifest.xml | 11 +++-------- app/src/main/java/se/leap/bitmaskclient/eip/EIP.java | 6 +++++- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 83394209..c2ae2cb3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -51,7 +51,9 @@ + android:exported="false" + android:permission="android.permission.BIND_JOB_SERVICE"> + - - - - - - - diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java index 511a33bc..34c88ef9 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java @@ -123,7 +123,11 @@ public final class EIP extends JobIntentService implements Observer { * Convenience method for enqueuing work in to this service. */ static void enqueueWork(Context context, Intent work) { - enqueueWork(context, EIP.class, JOB_ID, work); + try { + enqueueWork(context, EIP.class, JOB_ID, work); + } catch (IllegalStateException e) { + e.printStackTrace(); + } } @Override -- cgit v1.2.3