2017-05-31 12:14:18 -07:00
|
|
|
package org.thoughtcrime.securesms.notifications;
|
|
|
|
|
|
|
|
|
|
|
|
import android.app.PendingIntent;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.support.v4.app.NotificationCompat;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.ConversationListActivity;
|
|
|
|
import org.thoughtcrime.securesms.R;
|
2017-08-21 18:37:39 -07:00
|
|
|
import org.thoughtcrime.securesms.database.RecipientDatabase;
|
2017-09-21 10:03:05 -07:00
|
|
|
import org.thoughtcrime.securesms.preferences.widgets.NotificationPrivacyPreference;
|
2017-05-31 12:14:18 -07:00
|
|
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
|
|
|
|
|
|
|
public class PendingMessageNotificationBuilder extends AbstractNotificationBuilder {
|
|
|
|
|
|
|
|
public PendingMessageNotificationBuilder(Context context, NotificationPrivacyPreference privacy) {
|
|
|
|
super(context, privacy);
|
|
|
|
|
|
|
|
Intent intent = new Intent(context, ConversationListActivity.class);
|
|
|
|
|
2019-07-24 09:51:09 +10:00
|
|
|
setSmallIcon(R.drawable.ic_notification);
|
2017-05-31 12:14:18 -07:00
|
|
|
setColor(context.getResources().getColor(R.color.textsecure_primary));
|
|
|
|
setCategory(NotificationCompat.CATEGORY_MESSAGE);
|
|
|
|
|
|
|
|
setContentTitle(context.getString(R.string.MessageNotifier_pending_signal_messages));
|
|
|
|
setContentText(context.getString(R.string.MessageNotifier_you_have_pending_signal_messages));
|
|
|
|
setTicker(context.getString(R.string.MessageNotifier_you_have_pending_signal_messages));
|
|
|
|
|
|
|
|
setContentIntent(PendingIntent.getActivity(context, 0, intent, 0));
|
|
|
|
setAutoCancel(true);
|
2017-08-21 18:37:39 -07:00
|
|
|
setAlarms(null, RecipientDatabase.VibrateState.DEFAULT);
|
2018-08-15 12:11:10 -07:00
|
|
|
|
|
|
|
if (!NotificationChannels.supported()) {
|
|
|
|
setPriority(TextSecurePreferences.getNotificationPriority(context));
|
|
|
|
}
|
2017-05-31 12:14:18 -07:00
|
|
|
}
|
|
|
|
}
|