From e25757846f3e8f74bc943c60ebfc09c80cb2cb34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Tue, 22 Oct 2024 22:18:17 +0100 Subject: [PATCH] Add link to background service troubleshoot page --- .../freeyourgadget/gadgetbridge/GBApplication.java | 8 ++++---- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java index 42c19dd04..6d5d3e12d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java @@ -270,16 +270,16 @@ public class GBApplication extends Application { startService(new Intent(this, NotificationCollectorMonitorService.class)); } catch (IllegalStateException e) { String message = e.toString(); - if (message == null) { - message = getString(R.string._unknown_); - } + final Intent instructionsIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://gadgetbridge.org/basics/topics/background-service/")); + final PendingIntent pi = PendingIntentUtils.getActivity(context, 0, instructionsIntent, PendingIntent.FLAG_ONE_SHOT, false); GB.notify(NOTIFICATION_ID_ERROR, new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_HIGH_PRIORITY_ID) .setSmallIcon(R.drawable.ic_notification) .setContentTitle(getString(R.string.error_background_service)) .setContentText(getString(R.string.error_background_service_reason_truncated)) + .setContentIntent(pi) .setStyle(new NotificationCompat.BigTextStyle() - .bigText(getString(R.string.error_background_service_reason) + "\"" + message + "\"")) + .bigText(getString(R.string.error_background_service_reason) + " \"" + message + "\"")) .setPriority(NotificationCompat.PRIORITY_DEFAULT) .build(), context); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index efb059f14..e821358ce 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2135,7 +2135,7 @@ KEY REQUIRED, LONG PRESS TO ENTER UNSUPPORTED EXPERIMENTAL - Starting the background service failed because of an exception. Error: + Starting the background service failed because of an exception - click here for more information.\n\nError: Check permission status Check and ask for missing permissions even when they might not be instantly needed. Disable this only if your devices actually doesn\'t support any of these features. Not granting a permission might cause issues! Show changelog on startup