Run notification reminder broadcast in an AsyncTask

Fixes #4016
// FREEBIE
pull/1/head
Moxie Marlinspike 9 years ago
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…
Cancel
Save