summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-11-26 13:21:51 +0100
committercyBerta <cyberta@riseup.net>2021-11-26 13:21:51 +0100
commitbbc040a05d4c6050248a813f7488c1c59d00d759 (patch)
treefdb5ca16250df397a42af61312d92acbfee7dd3c /app/src/main
parentcf3e52d0b4add8d805ac7a9e0b5e6e340106265e (diff)
fix save battery feature
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java5
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)