aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AndroidManifest.xml3
-rw-r--r--src/org/connectbot/ConsoleActivity.java17
2 files changed, 6 insertions, 14 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 10dbb7e..a0b99e8 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.0"
- android:versionCode="320"
+ android:versionCode="321"
android:installLocation="auto">
<application
@@ -60,7 +60,6 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
- <uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
diff --git a/src/org/connectbot/ConsoleActivity.java b/src/org/connectbot/ConsoleActivity.java
index 2b5cbb4..f0d930f 100644
--- a/src/org/connectbot/ConsoleActivity.java
+++ b/src/org/connectbot/ConsoleActivity.java
@@ -44,7 +44,6 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
-import android.os.PowerManager;
import android.preference.PreferenceManager;
import android.text.ClipboardManager;
import android.util.Log;
@@ -99,8 +98,6 @@ public class ConsoleActivity extends Activity {
private SharedPreferences prefs = null;
- private PowerManager.WakeLock wakelock = null;
-
protected Uri requested;
protected ClipboardManager clipboard;
@@ -278,9 +275,6 @@ public class ConsoleActivity extends Activity {
// TODO find proper way to disable volume key beep if it exists.
setVolumeControlStream(AudioManager.STREAM_MUSIC);
- PowerManager manager = (PowerManager)getSystemService(Context.POWER_SERVICE);
- wakelock = manager.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, TAG);
-
// handle requested console from incoming intent
requested = getIntent().getData();
@@ -817,10 +811,6 @@ 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);
}
@@ -832,8 +822,11 @@ public class ConsoleActivity extends Activity {
// 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();
+ if (prefs.getBoolean(PreferenceConstants.KEEP_ALIVE, true)) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+ } else {
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+ }
configureOrientation();