mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-09 11:41:29 +00:00
parent
192c00ebf0
commit
83ee3f3db9
1 changed files with 8 additions and 1 deletions
|
@ -14,6 +14,7 @@ import android.net.wifi.WifiInfo;
|
|||
import android.net.wifi.WifiManager;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.PowerManager;
|
||||
import androidx.annotation.Nullable;
|
||||
import android.util.Log;
|
||||
|
@ -118,7 +119,13 @@ public class RunConditionMonitor {
|
|||
public void onReceive(Context context, Intent intent) {
|
||||
if (Intent.ACTION_POWER_CONNECTED.equals(intent.getAction())
|
||||
|| Intent.ACTION_POWER_DISCONNECTED.equals(intent.getAction())) {
|
||||
updateShouldRunDecision();
|
||||
Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateShouldRunDecision();
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue