use of org.thoughtcrime.securesms.components.reminder.Reminder in project Signal-Android by WhisperSystems.
the class ConversationListFragment method updateReminders.
private void updateReminders() {
reminderView.hide();
new AsyncTask<Context, Void, Optional<? extends Reminder>>() {
@Override
protected Optional<? extends Reminder> 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 if (DefaultSmsReminder.isEligible(context)) {
return Optional.of(new DefaultSmsReminder(context));
} else if (Util.isDefaultSmsProvider(context) && SystemSmsImportReminder.isEligible(context)) {
return Optional.of((new SystemSmsImportReminder(context, masterSecret)));
} else if (PushRegistrationReminder.isEligible(context)) {
return Optional.of((new PushRegistrationReminder(context, masterSecret)));
} else if (ShareReminder.isEligible(context)) {
return Optional.of(new ShareReminder(context));
} else if (DozeReminder.isEligible(context)) {
return Optional.of(new DozeReminder(context));
} else {
return Optional.absent();
}
}
@Override
protected void onPostExecute(Optional<? extends Reminder> reminder) {
if (reminder.isPresent() && getActivity() != null && !isRemoving()) {
reminderView.showReminder(reminder.get());
}
}
}.execute(getActivity());
}
Aggregations