Java code style fixed (analogous to C code).
authorTobias Brunner <tobias@strongswan.org>
Wed, 22 Feb 2012 14:36:51 +0000 (15:36 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 8 Aug 2012 13:12:24 +0000 (15:12 +0200)
src/frontends/android/src/org/strongswan/android/CharonVpnService.java
src/frontends/android/src/org/strongswan/android/strongSwanActivity.java

index 52d427c..d917d3e 100644 (file)
@@ -3,24 +3,29 @@ package org.strongswan.android;
 import android.content.Intent;
 import android.net.VpnService;
 
-public class CharonVpnService extends VpnService {
+public class CharonVpnService extends VpnService
+{
 
        @Override
-       public int onStartCommand(Intent intent, int flags, int startId) {
+       public int onStartCommand(Intent intent, int flags, int startId)
+       {
                // called whenever the service is started with startService
-               // create our own thread because we are running in the calling processes main thread
+               // create our own thread because we are running in the calling processes
+               // main thread
                return super.onStartCommand(intent, flags, startId);
        }
 
        @Override
-       public void onCreate() {
+       public void onCreate()
+       {
                // onCreate is only called once
                initializeCharon();
                super.onCreate();
        }
 
        @Override
-       public void onDestroy() {
+       public void onDestroy()
+       {
                // called once the service is to be destroyed
                deinitializeCharon();
                super.onDestroy();
@@ -40,7 +45,8 @@ public class CharonVpnService extends VpnService {
         * The libraries are extracted to /data/data/org.strongswan.android/...
         * during installation.
         */
-       static {
+       static
+       {
                System.loadLibrary("crypto");
                System.loadLibrary("strongswan");
                System.loadLibrary("hydra");
index b4fb6f3..fabf718 100644 (file)
@@ -5,28 +5,36 @@ import android.content.Intent;
 import android.net.VpnService;
 import android.os.Bundle;
 
-public class strongSwanActivity extends Activity {
+public class strongSwanActivity extends Activity
+{
        @Override
-       public void onCreate(Bundle savedInstanceState) {
+       public void onCreate(Bundle savedInstanceState)
+       {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);
                startVpnService();
        }
 
-       private void startVpnService() {
+       private void startVpnService()
+       {
                Intent intent = VpnService.prepare(this);
-               if (intent != null) {
+               if (intent != null)
+               {
                        startActivityForResult(intent, 0);
-               } else {
+               }
+               else
+               {
                        onActivityResult(0, RESULT_OK, null);
                }
        }
 
        @Override
-       protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-               if (resultCode == RESULT_OK) {
+       protected void onActivityResult(int requestCode, int resultCode, Intent data)
+       {
+               if (resultCode == RESULT_OK)
+               {
                        Intent intent = new Intent(this, CharonVpnService.class);
                        startService(intent);
                }
        }
-}
\ No newline at end of file
+}