[Libreoffice-commits] core.git: android/sdremote

Artur Dryomov artur.dryomov at gmail.com
Thu Sep 5 02:48:25 PDT 2013


 android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java |   12 +++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 4c30c48684cd09a057906f30d7a3f8927ecabb52
Author: Artur Dryomov <artur.dryomov at gmail.com>
Date:   Tue Sep 3 15:53:03 2013 +0300

    Move building server via TCP servers finder to a separate method.
    
    Change-Id: I8def7a5f7ecf924f6cc61f3a037defa9e8116089
    Reviewed-on: https://gerrit.libreoffice.org/5815
    Reviewed-by: Michael Meeks <michael.meeks at suse.com>
    Tested-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java
index b31e4f6..84f305b 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/TcpServersFinder.java
@@ -124,11 +124,7 @@ class TcpServersFinder implements ServersFinder, Runnable {
 
         String aFoundServerHostname = aSearchResultScanner.nextLine();
 
-        Server aFoundServer = new Server(Server.Protocol.TCP,
-            aSearchResultPacket.getAddress().getHostAddress(),
-            aFoundServerHostname);
-
-        addServer(aFoundServer);
+        addServer(buildServer(aSearchResultPacket, aFoundServerHostname));
 
         callUpdatingServersList();
     }
@@ -156,6 +152,12 @@ class TcpServersFinder implements ServersFinder, Runnable {
         mServers.put(aServer.getAddress(), aServer);
     }
 
+    private Server buildServer(DatagramPacket aSearchResultPacket, String aServerHostname) {
+        String aServerAddress = aSearchResultPacket.getAddress().getHostAddress();
+
+        return Server.newTcpInstance(aServerAddress, aServerHostname);
+    }
+
     private void callUpdatingServersList() {
         Intent aIntent = Intents.buildServersListChangedIntent();
         LocalBroadcastManager.getInstance(mContext).sendBroadcast(aIntent);


More information about the Libreoffice-commits mailing list