Simplification

pull/153/head
M66B 6 years ago
parent f5b35190bf
commit fa579d3c10

@ -137,18 +137,19 @@ public class ServiceSend extends LifecycleService {
@Override
public void onAvailable(Network network) {
Log.i("Service send available=" + network);
if (Helper.suitableNetwork(ServiceSend.this, false))
run();
check();
}
@Override
public void onCapabilitiesChanged(Network network, NetworkCapabilities caps) {
Log.i("Service send caps=" + caps);
if (Helper.suitableNetwork(ServiceSend.this, false))
run();
Log.i("Service send network=" + network + " caps=" + caps);
check();
}
private void run() {
private void check() {
if (!Helper.suitableNetwork(ServiceSend.this, false))
return;
if (thread != null && thread.isAlive())
return;

Loading…
Cancel
Save