Add user defined parameter support to ACTS and other improvements.

Allow user to add extra params in test bed config file.
Add the option to specify test bed config file location.
Fix a bug where illegal chars in adb log cause error.
Change load_config to guarantee file closure.
Fix a problem in sl4a where multiple instances of HttpFacade causes exception.
Replace '+' with join in event_dispatcher.

Change-Id: I6c74d901f847623aeabdc38853a87e8b07f26ba3
diff --git a/Common/src/com/googlecode/android_scripting/facade/wifi/HttpFacade.java b/Common/src/com/googlecode/android_scripting/facade/wifi/HttpFacade.java
index 854a41b..fbb703a 100644
--- a/Common/src/com/googlecode/android_scripting/facade/wifi/HttpFacade.java
+++ b/Common/src/com/googlecode/android_scripting/facade/wifi/HttpFacade.java
@@ -10,7 +10,6 @@
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.net.SocketException;
@@ -33,7 +32,6 @@
 
     private final Service mService;
     private ServerSocket mServerSocket = null;
-    private int mSocketPort = 8081;
     private int mServerTimeout = -1;
     private HashMap<Integer, Socket> mSockets = null;
     private int socketCnt = 0;
@@ -42,7 +40,6 @@
         super(manager);
         mService = manager.getService();
         mSockets = new HashMap<Integer, Socket>();
-        mServerSocket = new ServerSocket(mSocketPort);
     }
 
     private void inputStreamToOutputStream(InputStream in, OutputStream out) throws IOException {
@@ -113,7 +110,7 @@
 
     @Rpc(description = "Start waiting for a connection request on a specified port.",
             returns = "The index of the connection.")
-    public Integer httpAcceptConnection(int port) throws IOException {
+    public Integer httpAcceptConnection(Integer port) throws IOException {
         mServerSocket = new ServerSocket(port);
         if (mServerTimeout > 0) {
             mServerSocket.setSoTimeout(mServerTimeout);
@@ -179,7 +176,7 @@
     }
 
     @Rpc(description = "Set how many milliseconds to wait for an incoming connection.")
-    public void httpSetServerTimeout(@RpcParameter(name = "timeout") int timeout)
+    public void httpSetServerTimeout(@RpcParameter(name = "timeout") Integer timeout)
             throws SocketException {
         mServerSocket.setSoTimeout(timeout);
         mServerTimeout = timeout;