mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
Update our boot receiver to schedule a message pull.
Previously we were starting a background service, which isn't allowed for targetSdk 26. This will do the same thing but at a time decided by the system.
This commit is contained in:
parent
4c63428b71
commit
89f97f57cb
@ -5,14 +5,13 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
|
||||
import org.thoughtcrime.securesms.ApplicationContext;
|
||||
import org.thoughtcrime.securesms.jobs.PushNotificationReceiveJob;
|
||||
|
||||
public class BootReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (intent != null && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
||||
Intent messageRetrievalService = new Intent(context, MessageRetrievalService.class);
|
||||
context.startService(messageRetrievalService);
|
||||
}
|
||||
ApplicationContext.getInstance(context).getJobManager().add(new PushNotificationReceiveJob(context));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user