aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/org/connectbot/service/TerminalManager.java7
-rw-r--r--src/org/connectbot/util/PreferenceConstants.java2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/org/connectbot/service/TerminalManager.java b/src/org/connectbot/service/TerminalManager.java
index 2faac98..1e057af 100644
--- a/src/org/connectbot/service/TerminalManager.java
+++ b/src/org/connectbot/service/TerminalManager.java
@@ -160,6 +160,13 @@ public class TerminalManager extends Service implements BridgeDisconnectedListen
enableMediaPlayer();
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+
+ /* If user wants the connections to stay alive at all costs,
+ * set the service to be "foreground."
+ */
+ if (prefs.getBoolean(PreferenceConstants.CONNECTION_PERSIST, true)) {
+ setForeground(true);
+ }
}
@Override
diff --git a/src/org/connectbot/util/PreferenceConstants.java b/src/org/connectbot/util/PreferenceConstants.java
index beec052..7231d8f 100644
--- a/src/org/connectbot/util/PreferenceConstants.java
+++ b/src/org/connectbot/util/PreferenceConstants.java
@@ -70,4 +70,6 @@ public class PreferenceConstants {
public static final String BELL_VIBRATE = "bellVibrate";
public static final String BELL_NOTIFICATION = "bellNotification";
public static final float DEFAULT_BELL_VOLUME = 0.25f;
+
+ public static final String CONNECTION_PERSIST = "connPersist";
}