diff app/src/main/java/com/five_ten_sg/connectbot/ConsoleActivity.java @ 496:f698820bffdf

add socket2 monitor protocol
author Carl Byington <carl@five-ten-sg.com>
date Sun, 05 Jun 2022 14:46:41 -0700
parents 2043bbaac86e
children
line wrap: on
line diff
--- a/app/src/main/java/com/five_ten_sg/connectbot/ConsoleActivity.java	Sun Jun 05 12:00:10 2022 -0700
+++ b/app/src/main/java/com/five_ten_sg/connectbot/ConsoleActivity.java	Sun Jun 05 14:46:41 2022 -0700
@@ -92,9 +92,10 @@
     private static final int SHIFT_LEFT = 0;
     private static final int SHIFT_RIGHT = 1;
 
-    protected ViewFlipper flip = null;
-    protected TerminalManager bound = null;
-    protected LayoutInflater inflater = null;
+    protected ConsoleActivity activity = null;
+    protected ViewFlipper     flip     = null;
+    protected TerminalManager bound    = null;
+    protected LayoutInflater  inflater = null;
 
     private SharedPreferences prefs = null;
 
@@ -150,6 +151,8 @@
             bound = ((TerminalManager.TerminalBinder) service).getService();
             // let manager know about our event handling services
             bound.disconnectHandler = disconnectHandler;
+            // let manager know about this activity
+            bound.activity = activity;
             Log.d(TAG, String.format("Connected to TerminalManager and found bridges.size=%d", bound.bridges.size()));
             bound.setResizeAllowed(true);
             bound.hardKeyboardHidden = (getResources().getConfiguration().hardKeyboardHidden ==
@@ -268,6 +271,10 @@
         }
     }
 
+    public View getCurrentView() {
+        return flip.getCurrentView();
+    }
+
     protected View findCurrentView(int id) {
         View view = flip.getCurrentView();
 
@@ -337,6 +344,7 @@
     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
+        activity = this;
         configureStrictMode();
         hardKeyboard = getResources().getConfiguration().keyboard ==
                        Configuration.KEYBOARD_QWERTY;