Merge pull request #2162 from MilosKozak/adrian/NCRworkaround

ncr-workaround
This commit is contained in:
AdrianLxM 2019-10-31 08:36:26 +01:00 committed by GitHub
commit c87c68f84c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View file

@ -20,7 +20,7 @@ class NsClientReceiverDelegate {
private final Context context;
private NetworkChangeReceiver networkChangeReceiver = NetworkChangeReceiver.instance;
private NetworkChangeReceiver networkChangeReceiver = new NetworkChangeReceiver();
private ChargingStateReceiver chargingStateReceiver = new ChargingStateReceiver();
private boolean allowedChargingState = true;

View file

@ -28,11 +28,7 @@ public class NetworkChangeReceiver extends BroadcastReceiver {
// TODO: Split NSClient into network state component that can be used by several plugins and logic for plugin
public static void fetch() {
NetworkChangeReceiver.instance.grabNetworkStatus(MainApp.instance().getApplicationContext());
}
private NetworkChangeReceiver() {
super();
new NetworkChangeReceiver().grabNetworkStatus(MainApp.instance().getApplicationContext());
}
@Override
@ -90,4 +86,4 @@ public class NetworkChangeReceiver extends BroadcastReceiver {
public static EventNetworkChange getLastEvent() {
return lastEvent;
}
}
}