Mercurial > 510ConnectbotMonitor
comparison src/com/five_ten_sg/connectbot/monitor/MonitorService.java @ 16:a481d8fb5571 stable-1.0.2
add switch session command to the TE
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Tue, 01 Jul 2014 19:08:47 -0700 |
parents | 5bf6d84cc5b8 |
children | a94ca5a89fe8 |
comparison
equal
deleted
inserted
replaced
15:357bbbbcf201 | 16:a481d8fb5571 |
---|---|
30 import android.widget.TextView; | 30 import android.widget.TextView; |
31 | 31 |
32 public class MonitorService extends Service implements OnInitListener { | 32 public class MonitorService extends Service implements OnInitListener { |
33 public final static String TAG = "ConnectBot.MonitorService"; | 33 public final static String TAG = "ConnectBot.MonitorService"; |
34 | 34 |
35 public static final char MONITOR_CMD_INIT = 0; | 35 public static final char MONITOR_CMD_INIT = 0; |
36 public static final char MONITOR_CMD_ACTIVATE = 1; | 36 public static final char MONITOR_CMD_ACTIVATE = 1; |
37 public static final char MONITOR_CMD_KEYSTATE = 2; | 37 public static final char MONITOR_CMD_KEYSTATE = 2; |
38 public static final char MONITOR_CMD_CURSORMOVE = 3; | 38 public static final char MONITOR_CMD_CURSORMOVE = 3; |
39 public static final char MONITOR_CMD_SCREENCHANGE = 4; | 39 public static final char MONITOR_CMD_SCREENCHANGE = 4; |
40 public static final char MONITOR_CMD_FIELDVALUE = 5; | 40 public static final char MONITOR_CMD_FIELDVALUE = 5; |
41 public static final char MONITOR_CMD_SETFIELD = 5; | 41 public static final char MONITOR_CMD_SETFIELD = 5; |
42 public static final char MONITOR_CMD_GETFIELD = 6; | 42 public static final char MONITOR_CMD_GETFIELD = 6; |
43 public static final char MONITOR_CMD_SCREENWATCH = 7; | 43 public static final char MONITOR_CMD_SCREENWATCH = 7; |
44 public static final char MONITOR_CMD_DEPRESS = 8; | 44 public static final char MONITOR_CMD_DEPRESS = 8; |
45 public static final char MONITOR_CMD_SHOWURL = 9; | 45 public static final char MONITOR_CMD_SHOWURL = 9; |
46 public static final char MONITOR_CMD_SWITCHSESSION = 10; | |
46 | 47 |
47 public static final int MONITORPORT = 6000; | 48 public static final int MONITORPORT = 6000; |
48 public static ConcurrentHashMap<Integer,CommunicationThread> clients = new ConcurrentHashMap<Integer,CommunicationThread>(); | 49 public static ConcurrentHashMap<Integer,CommunicationThread> clients = new ConcurrentHashMap<Integer,CommunicationThread>(); |
49 public static int currentConnection = -1; | 50 public static int currentConnection = -1; |
50 | 51 |
438 System.arraycopy(url, 0, arg2, base, len); | 439 System.arraycopy(url, 0, arg2, base, len); |
439 cm.clientWrite(MONITOR_CMD_SHOWURL, arg2); | 440 cm.clientWrite(MONITOR_CMD_SHOWURL, arg2); |
440 } | 441 } |
441 } | 442 } |
442 | 443 |
444 public static void teSwitchSession(int connection) { | |
445 CommunicationThread cm = clients.get(connection); | |
446 if (cm != null) { | |
447 char [] arg2 = new char[2]; | |
448 cm.clientWrite(MONITOR_CMD_SWITCHSESSION, arg2); | |
449 } | |
450 } | |
451 | |
443 } | 452 } |