mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-31 20:27:44 +00:00
a6473bc922
When using notification channels, us setting priority actually has no effect. So instead of having a non-functional setting, we've routed the notification priority setting to go to the system notification channel settings page for our Messages channel.
39 lines
1.5 KiB
Java
39 lines
1.5 KiB
Java
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;
|
|
import org.thoughtcrime.securesms.database.RecipientDatabase;
|
|
import org.thoughtcrime.securesms.preferences.widgets.NotificationPrivacyPreference;
|
|
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);
|
|
|
|
setSmallIcon(R.drawable.icon_notification);
|
|
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);
|
|
setAlarms(null, RecipientDatabase.VibrateState.DEFAULT);
|
|
|
|
if (!NotificationChannels.supported()) {
|
|
setPriority(TextSecurePreferences.getNotificationPriority(context));
|
|
}
|
|
}
|
|
}
|