From 2434daa173adeb2284ca43941923e0f4931cd096 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Mon, 16 Dec 2019 14:30:14 +0100 Subject: [PATCH] add a try/catch block around the reminder-stuff. there is the PowerManager envolved that may create all kind of problems. so i like to be sure-careful here, also as the code is run frequently and may cause problems only on very few devices. --- .../securesms/ConversationListFragment.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ConversationListFragment.java b/src/org/thoughtcrime/securesms/ConversationListFragment.java index 58d6fb7a6..73cf039b1 100644 --- a/src/org/thoughtcrime/securesms/ConversationListFragment.java +++ b/src/org/thoughtcrime/securesms/ConversationListFragment.java @@ -184,20 +184,18 @@ public class ConversationListFragment extends Fragment @Override protected Optional doInBackground(Context... params) { final Context context = params[0]; -// if (ExpiredBuildReminder.isEligible()) { -// return Optional.of(new ExpiredBuildReminder(context)); -// } else if (OutdatedBuildReminder.isEligible()) { -// return Optional.of(new OutdatedBuildReminder(context)); -// } else + try { if (DozeReminder.isEligible(context)) { DozeReminder.addDozeReminderDeviceMsg(context); return Optional.absent(); } else if (OutdatedReminder.isEligible(context)) { return Optional.of(new OutdatedReminder(context)); } - else { - return Optional.absent(); - } + } catch(Exception e) { + e.printStackTrace(); + } + + return Optional.absent(); } @Override