From 5be1eaadf71bb880bf8e7f9d917e9aa3504f019a Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 9 Jul 2013 10:42:04 +0200 Subject: Add support for IntelliJ annotations (@Nullable, @NotNull) Also remove superfluous log message --- build.gradle | 11 +++++++---- icsopenvpn.iml | 9 +++++++++ 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 @@ + + + + + + + + + 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); -- cgit v1.2.3