diff options
3 files changed, 12 insertions, 12 deletions
diff --git a/app/src/main/java/org/connectbot/ConsoleActivity.java b/app/src/main/java/org/connectbot/ConsoleActivity.java index 77f8a3f..e7a8f7d 100644 --- a/app/src/main/java/org/connectbot/ConsoleActivity.java +++ b/app/src/main/java/org/connectbot/ConsoleActivity.java @@ -145,9 +145,6 @@ public class ConsoleActivity extends Activity { // let manager know about our event handling services bound.disconnectHandler = disconnectHandler; - - Log.d(TAG, String.format("Connected to TerminalManager and found bridges.size=%d", bound.bridges.size())); - bound.setResizeAllowed(true); // clear out any existing bridges and record requested index @@ -169,7 +166,7 @@ public class ConsoleActivity extends Activity { } // create views for all bridges on this service - for (TerminalBridge bridge : bound.bridges) { + for (TerminalBridge bridge : bound.getBridges()) { final int currentIndex = addNewTerminalView(bridge); @@ -182,12 +179,6 @@ public class ConsoleActivity extends Activity { } public void onServiceDisconnected(ComponentName className) { - // tell each bridge to forget about our prompt handler - synchronized (bound.bridges) { - for (TerminalBridge bridge : bound.bridges) - bridge.promptHelper.setHandler(null); - } - flip.removeAllViews(); updateEmptyVisible(); bound = null; diff --git a/app/src/main/java/org/connectbot/HostListActivity.java b/app/src/main/java/org/connectbot/HostListActivity.java index 7946e9a..2fd9560 100644 --- a/app/src/main/java/org/connectbot/HostListActivity.java +++ b/app/src/main/java/org/connectbot/HostListActivity.java @@ -447,7 +447,7 @@ public class HostListActivity extends ListActivity { // Don't lose hosts that are connected via shortcuts but not in the database. if (bound != null) { - for (TerminalBridge bridge : bound.bridges) { + for (TerminalBridge bridge : bound.getBridges()) { if (!hosts.contains(bridge.host)) hosts.add(0, bridge.host); } diff --git a/app/src/main/java/org/connectbot/service/TerminalManager.java b/app/src/main/java/org/connectbot/service/TerminalManager.java index 8e7187f..1688d2a 100644 --- a/app/src/main/java/org/connectbot/service/TerminalManager.java +++ b/app/src/main/java/org/connectbot/service/TerminalManager.java @@ -70,7 +70,7 @@ import android.util.Log; public class TerminalManager extends Service implements BridgeDisconnectedListener, OnSharedPreferenceChangeListener { public final static String TAG = "CB.TerminalManager"; - public List<TerminalBridge> bridges = new LinkedList<TerminalBridge>(); + private List<TerminalBridge> bridges = new LinkedList<TerminalBridge>(); public Map<HostBean, WeakReference<TerminalBridge>> mHostBridgeMap = new HashMap<HostBean, WeakReference<TerminalBridge>>(); public Map<String, WeakReference<TerminalBridge>> mNicknameBridgeMap = @@ -471,6 +471,10 @@ public class TerminalManager extends Service implements BridgeDisconnectedListen } } + public List<TerminalBridge> getBridges() { + return bridges; + } + public class TerminalBinder extends Binder { public TerminalManager getService() { return TerminalManager.this; @@ -518,6 +522,11 @@ public class TerminalManager extends Service implements BridgeDisconnectedListen if (bridges.size() == 0) { stopWithDelay(); + } else { + // tell each bridge to forget about their previous prompt handler + for (TerminalBridge bridge : bridges) { + bridge.promptHelper.setHandler(null); + } } return true; |