blob: f9cfd52f648a4b38c0e6eabbb4ad6366543325f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
package com.mapswithme.maps.scheduling;
import android.app.Application;
import androidx.annotation.NonNull;
import com.mapswithme.maps.background.NotificationService;
import com.mapswithme.util.ConnectionState;
class JobServiceDelegate
{
@NonNull
private final Application mApp;
JobServiceDelegate(@NonNull Application app)
{
mApp = app;
}
boolean onStartJob()
{
ConnectionState.Type type = ConnectionState.requestCurrentType();
if (type == ConnectionState.Type.WIFI)
NotificationService.startOnConnectivityChanged(mApp);
retryJob();
return true;
}
private void retryJob()
{
ConnectivityJobScheduler.from(mApp).listen();
}
boolean onStopJob()
{
return false;
}
}
|