mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Run notification reminder broadcast in an AsyncTask
Fixes #4016 // FREEBIE
This commit is contained in:
parent
fd61fcef0d
commit
5ef65f039d
@ -26,6 +26,7 @@ import android.database.Cursor;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.Spannable;
|
||||
@ -416,10 +417,17 @@ public class MessageNotifier {
|
||||
public static final String REMINDER_ACTION = "org.thoughtcrime.securesms.MessageNotifier.REMINDER_ACTION";
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
MasterSecret masterSecret = KeyCachingService.getMasterSecret(context);
|
||||
int reminderCount = intent.getIntExtra("reminder_count", 0);
|
||||
MessageNotifier.updateNotification(context, masterSecret, true, true, reminderCount + 1);
|
||||
public void onReceive(final Context context, final Intent intent) {
|
||||
new AsyncTask<Void, Void, Void>() {
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
MasterSecret masterSecret = KeyCachingService.getMasterSecret(context);
|
||||
int reminderCount = intent.getIntExtra("reminder_count", 0);
|
||||
MessageNotifier.updateNotification(context, masterSecret, true, true, reminderCount + 1);
|
||||
|
||||
return null;
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user