mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +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.content.Intent;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.ApplicationContext;
|
||||||
|
import org.thoughtcrime.securesms.jobs.PushNotificationReceiveJob;
|
||||||
|
|
||||||
public class BootReceiver extends BroadcastReceiver {
|
public class BootReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (intent != null && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
ApplicationContext.getInstance(context).getJobManager().add(new PushNotificationReceiveJob(context));
|
||||||
Intent messageRetrievalService = new Intent(context, MessageRetrievalService.class);
|
|
||||||
context.startService(messageRetrievalService);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user