summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-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)