diff options
| author | Arne Schwabe <arne@rfc2549.org> | 2013-07-09 10:42:04 +0200 | 
|---|---|---|
| committer | Arne Schwabe <arne@rfc2549.org> | 2013-07-09 10:42:04 +0200 | 
| commit | 5be1eaadf71bb880bf8e7f9d917e9aa3504f019a (patch) | |
| tree | f1dba5ac298299b42fd726f8812dbe6a5d86c444 | |
| parent | 7191007061b5ecf493251d5d260fdc4ad2b614e9 (diff) | |
Add support for IntelliJ annotations (@Nullable, @NotNull)
Also remove superfluous log message
| -rw-r--r-- | build.gradle | 11 | ||||
| -rw-r--r-- | icsopenvpn.iml | 9 | ||||
| -rw-r--r-- | src/de/blinkt/openvpn/core/OpenVpnManagementThread.java | 16 | 
3 files changed, 24 insertions, 12 deletions
diff --git a/build.gradle b/build.gradle index 413e6240..7708404b 100644 --- a/build.gradle +++ b/build.gradle @@ -9,13 +9,18 @@ buildscript {  apply plugin: 'android' +repositories { +    mavenCentral() +} +  dependencies { +    compile 'com.intellij:annotations:12.0'  }  android {      compileSdkVersion 17      buildToolsVersion "17" -     +      defaultConfig {          minSdkVersion 14          targetSdkVersion 17 @@ -48,8 +53,7 @@ android {      }  } - -// ~/.gradle/gradle.properties  +// ~/.gradle/gradle.properties  if (project.hasProperty('keystoreFile') &&          project.hasProperty('keystorePassword') &&          project.hasProperty('keystoreAliasPassword')) { @@ -61,7 +65,6 @@ if (project.hasProperty('keystoreFile') &&      android.buildTypes.release.signingConfig = null  } -  //http://stackoverflow.com/questions/16683775/include-so-library-in-apk-in-android-studio  tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->      pkgTask.jniDir new File(buildDir, 'native-libs') diff --git a/icsopenvpn.iml b/icsopenvpn.iml index 4d42372c..4d6b2748 100644 --- a/icsopenvpn.iml +++ b/icsopenvpn.iml @@ -66,6 +66,15 @@      </content>      <orderEntry type="jdk" jdkName="Android 4.2.2" jdkType="Android SDK" />      <orderEntry type="sourceFolder" forTests="false" /> +    <orderEntry type="module-library"> +      <library> +        <CLASSES> +          <root url="jar://$APPLICATION_HOME_DIR$/lib/annotations.jar!/" /> +        </CLASSES> +        <JAVADOC /> +        <SOURCES /> +      </library> +    </orderEntry>    </component>  </module> diff --git a/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java b/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java index c4b4f379..2cb6dfe3 100644 --- a/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java +++ b/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java @@ -8,6 +8,9 @@ import android.net.LocalSocketAddress;  import android.os.ParcelFileDescriptor;
  import android.preference.PreferenceManager;
  import android.util.Log;
 +
 +import org.jetbrains.annotations.NotNull;
 +
  import de.blinkt.openvpn.R;
  import de.blinkt.openvpn.VpnProfile;
  import de.blinkt.openvpn.core.OpenVPN.ConnectionStatus;
 @@ -53,8 +56,7 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement {  	}
 -
 -    public boolean openManagementInterface(Context c) {
 +    public boolean openManagementInterface(@NotNull Context c) {
          // Could take a while to open connection
          int tries=8;
 @@ -109,7 +111,6 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement {  	@Override
  	public void run() {
 -		Log.i(TAG, "Managment Socket Thread started");
  		byte [] buffer  =new byte[2048];
  		//	mSocket.setSoTimeout(5); // Setting a timeout cannot be that bad
 @@ -213,9 +214,8 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement {  			if(cmd.equals("INFO")) {
 -				// Ignore greeting from mgmt
 -				//logStatusMessage(command);
 -                ;
 +				/* Ignore greeting from management */
 +                return;
  			}else if (cmd.equals("PASSWORD")) {
  				processPWCommand(argument);
  			} else if (cmd.equals("HOLD")) {
 @@ -241,8 +241,8 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement {  				Log.i(TAG, "Got unrecognized command" + command);
  			}
  		} else if (command.startsWith("SUCCESS:")) {
 -            ;
 -			// ignore
 +			/* Ignore this kind of message too */
 +            return;
  		} else {
  			Log.i(TAG, "Got unrecognized line from managment" + command);
  			OpenVPN.logMessage(0, "MGMT:", "Got unrecognized line from management:" + command);
  | 
