aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2010-05-04 13:12:57 +0000
committerKenny Root <kenny@the-b.org>2010-05-04 13:12:57 +0000
commitf5d392e3a334d230fb782a1faff37bda8153750f (patch)
tree1743c7a0556713e2005a766967a1650f4d94c52d
parentb8ec5e60fd3231c1fe96c3fc7dbd9cc2e640ce4d (diff)
downloadconnectbot-f5d392e3a334d230fb782a1faff37bda8153750f.tar.gz
connectbot-f5d392e3a334d230fb782a1faff37bda8153750f.tar.bz2
connectbot-f5d392e3a334d230fb782a1faff37bda8153750f.zip
Proper use of wakelocks in pause/resume
git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@501 df292f66-193f-0410-a5fc-6d59da041ff2
-rw-r--r--AndroidManifest.xml2
-rw-r--r--src/org/connectbot/ConsoleActivity.java20
2 files changed, 10 insertions, 12 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 83c92f5..053907d 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.connectbot"
android:versionName="1.7-dev"
- android:versionCode="264">
+ android:versionCode="265">
<application
android:icon="@drawable/icon"
diff --git a/src/org/connectbot/ConsoleActivity.java b/src/org/connectbot/ConsoleActivity.java
index 7dd336b..0240131 100644
--- a/src/org/connectbot/ConsoleActivity.java
+++ b/src/org/connectbot/ConsoleActivity.java
@@ -20,8 +20,6 @@ package org.connectbot;
import java.lang.ref.WeakReference;
import java.util.List;
-import org.connectbot.bean.HostBean;
-import org.connectbot.bean.PortForwardBean;
import org.connectbot.bean.SelectionArea;
import org.connectbot.service.PromptHelper;
import org.connectbot.service.TerminalBridge;
@@ -780,11 +778,6 @@ public class ConsoleActivity extends Activity {
// connect with manager service to find all bridges
// when connected it will insert all views
bindService(new Intent(this, TerminalManager.class), connection, Context.BIND_AUTO_CREATE);
-
- // make sure we dont let the screen fall asleep
- // this also keeps the wifi chipset from disconnecting us
- if(wakelock != null && prefs.getBoolean(PreferenceConstants.KEEP_ALIVE, true))
- wakelock.acquire();
}
@Override
@@ -792,6 +785,10 @@ public class ConsoleActivity extends Activity {
super.onPause();
Log.d(TAG, "onPause called");
+ // Allow the screen to dim and fall asleep.
+ if (wakelock != null && wakelock.isHeld())
+ wakelock.release();
+
if (forcedOrientation && bound != null)
bound.setResizeAllowed(false);
}
@@ -801,6 +798,11 @@ public class ConsoleActivity extends Activity {
super.onResume();
Log.d(TAG, "onResume called");
+ // Make sure we don't let the screen fall asleep.
+ // This also keeps the Wi-Fi chipset from disconnecting us.
+ if (wakelock != null && prefs.getBoolean(PreferenceConstants.KEEP_ALIVE, true))
+ wakelock.acquire();
+
configureOrientation();
if (forcedOrientation && bound != null)
@@ -860,10 +862,6 @@ public class ConsoleActivity extends Activity {
super.onStop();
unbindService(connection);
-
- // allow the screen to dim and fall asleep
- if(wakelock != null && wakelock.isHeld())
- wakelock.release();
}
protected void shiftCurrentTerminal(final int direction) {