summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/SlideshowPage.java
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2011-11-28 11:43:23 -0500
committerDaniel Sandler <dsandler@android.com>2011-11-29 08:49:39 -0500
commitb4a1da9f32d61cf9347617a382291e488428a744 (patch)
tree045a2074be1a29eaa5e27084856d76aa2e15fa79 /src/com/android/gallery3d/app/SlideshowPage.java
parentef71b24dbf31f73e6df8ae15ac2a1ad1cbc255f6 (diff)
downloadandroid_packages_apps_Snap-b4a1da9f32d61cf9347617a382291e488428a744.tar.gz
android_packages_apps_Snap-b4a1da9f32d61cf9347617a382291e488428a744.tar.bz2
android_packages_apps_Snap-b4a1da9f32d61cf9347617a382291e488428a744.zip
Improve screen on/off logic in slideshow.
When used as a screensaver or otherwise, the slideshow should not keep the screen on if the device is not plugged in. It should also allow the screen to lock while the slideshow is playing (otherwise a device left in this state may be left unsecured for long periods by accident). Additionally, when used as a screensaver, it must dismiss the keyguard in order to be shown on a secured device. Bug: 5660833 Change-Id: I1bafc50127aaa7ae2b67235d30736faa606c5ac1
Diffstat (limited to 'src/com/android/gallery3d/app/SlideshowPage.java')
-rw-r--r--src/com/android/gallery3d/app/SlideshowPage.java12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/com/android/gallery3d/app/SlideshowPage.java b/src/com/android/gallery3d/app/SlideshowPage.java
index 938785e9e..86976292a 100644
--- a/src/com/android/gallery3d/app/SlideshowPage.java
+++ b/src/com/android/gallery3d/app/SlideshowPage.java
@@ -23,8 +23,6 @@ import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
-import android.os.PowerManager;
-import android.os.PowerManager.WakeLock;
import android.view.MotionEvent;
import com.android.gallery3d.common.Utils;
@@ -83,7 +81,6 @@ public class SlideshowPage extends ActivityState {
private Slide mPendingSlide = null;
private boolean mIsActive = false;
- private WakeLock mWakeLock;
private final Intent mResultIntent = new Intent();
private final GLView mRootPane = new GLView() {
@@ -108,12 +105,7 @@ public class SlideshowPage extends ActivityState {
@Override
public void onCreate(Bundle data, Bundle restoreState) {
- mFlags |= (FLAG_HIDE_ACTION_BAR | FLAG_HIDE_STATUS_BAR);
-
- PowerManager pm = (PowerManager) mActivity.getAndroidContext().getSystemService(
- Context.POWER_SERVICE);
- mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK
- | PowerManager.ON_AFTER_RELEASE, TAG);
+ mFlags |= (FLAG_HIDE_ACTION_BAR | FLAG_HIDE_STATUS_BAR | FLAG_SCREEN_ON);
mHandler = new SynchronizedHandler(mActivity.getGLRoot()) {
@Override
@@ -165,7 +157,6 @@ public class SlideshowPage extends ActivityState {
@Override
public void onPause() {
super.onPause();
- mWakeLock.release();
mIsActive = false;
mModel.pause();
mSlideshowView.release();
@@ -177,7 +168,6 @@ public class SlideshowPage extends ActivityState {
@Override
public void onResume() {
super.onResume();
- mWakeLock.acquire();
mIsActive = true;
mModel.resume();