diff options
author | cyBerta <cyberta@riseup.net> | 2021-11-26 13:21:51 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2021-11-26 13:21:51 +0100 |
commit | bbc040a05d4c6050248a813f7488c1c59d00d759 (patch) | |
tree | fdb5ca16250df397a42af61312d92acbfee7dd3c | |
parent | cf3e52d0b4add8d805ac7a9e0b5e6e340106265e (diff) |
fix save battery feature
-rw-r--r-- | app/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java b/app/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java index 02184f03..d3fc0b4e 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java +++ b/app/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java @@ -137,13 +137,10 @@ public class DeviceStateReceiver extends BroadcastReceiver implements ByteCountL @Override public void onReceive(Context context, Intent intent) { - SharedPreferences prefs = Preferences.getDefaultSharedPreferences(context); - - if (ConnectivityManager.CONNECTIVITY_ACTION.equals(intent.getAction())) { networkStateChange(context); } else if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) { - boolean screenOffPause = prefs.getBoolean("screenoff", false); + boolean screenOffPause = PreferenceHelper.getSaveBattery(context); boolean isTethering = TetheringObservable.getInstance().getTetheringState().isVpnTetheringRunning(); if (screenOffPause && !isTethering) { if (VpnStatus.getLastConnectedVpnProfile() != null && !VpnStatus.getLastConnectedVpnProfile().mPersistTun) |