diff options
| -rw-r--r-- | build.gradle | 6 | ||||
| -rw-r--r-- | src/de/blinkt/openvpn/core/DeviceStateReceiver.java | 15 | 
2 files changed, 9 insertions, 12 deletions
| diff --git a/build.gradle b/build.gradle index f2d0b9d1..f25f2efa 100644 --- a/build.gradle +++ b/build.gradle @@ -42,9 +42,9 @@ android {      buildTypes {          release {              signingConfig signingConfigs.release -      } +        }      } -   } +}  // ~/.gradle/gradle.properties  @@ -56,7 +56,7 @@ if (project.hasProperty('keystoreFile') &&      android.signingConfigs.release.keyPassword = keystoreAliasPassword      android.signingConfigs.release.keyAlias = keystoreAlias  } else { -  android.buildTypes.release.signingConfig = null +    android.buildTypes.release.signingConfig = null  } diff --git a/src/de/blinkt/openvpn/core/DeviceStateReceiver.java b/src/de/blinkt/openvpn/core/DeviceStateReceiver.java index 479860bc..7d6e80db 100644 --- a/src/de/blinkt/openvpn/core/DeviceStateReceiver.java +++ b/src/de/blinkt/openvpn/core/DeviceStateReceiver.java @@ -1,7 +1,5 @@  package de.blinkt.openvpn.core;
 -import java.util.LinkedList;
 -
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
 @@ -14,6 +12,8 @@ import android.util.Log;  import de.blinkt.openvpn.R;
  import de.blinkt.openvpn.core.OpenVPN.ByteCountListener;
 +import java.util.LinkedList;
 +
  public class DeviceStateReceiver extends BroadcastReceiver implements ByteCountListener {
  	private int lastNetwork=-1;
  	private OpenVPNMangement mManangement;
 @@ -104,9 +104,7 @@ public class DeviceStateReceiver extends BroadcastReceiver implements ByteCountL              fillTrafficData();
              if (network == connectState.DISCONNECTED)
                  screen = connectState.DISCONNECTED;
 -        }
 -
 -		} else if (Intent.ACTION_SCREEN_ON.equals(intent.getAction())) {
 +        } else if (Intent.ACTION_SCREEN_ON.equals(intent.getAction())) {
  			// Network was disabled because screen off
  			if (screen == connectState.DISCONNECTED && network == connectState.SHOULDBECONNECTED) {
  				mManangement.resume();
 @@ -129,9 +127,9 @@ public class DeviceStateReceiver extends BroadcastReceiver implements ByteCountL  		String netstatestring;
 -		if(networkInfo==null)
 +		if(networkInfo==null) {
  			netstatestring = "not connected";
 -		else  {
 +        } else  {
  			String subtype = networkInfo.getSubtypeName();
  			if(subtype==null)
  				subtype = "";
 @@ -197,7 +195,6 @@ public class DeviceStateReceiver extends BroadcastReceiver implements ByteCountL  		ConnectivityManager conn =  (ConnectivityManager)
  				context.getSystemService(Context.CONNECTIVITY_SERVICE);
 -		NetworkInfo networkInfo = conn.getActiveNetworkInfo();
 -		return networkInfo;
 +        return conn.getActiveNetworkInfo();
  	}
  }
 | 
