summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraActivity.java
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2015-01-09 13:09:03 +0800
committerkaiyiz <kaiyiz@codeaurora.org>2015-01-09 13:09:03 +0800
commit3f873303a847f112558f081f42720a284558cace (patch)
tree6228d5abe8e81f55bd229904348b992d01647f99 /src/com/android/camera/CameraActivity.java
parentcc56779da62644898eb319d4b296f69d6d820013 (diff)
downloadandroid_packages_apps_Snap-3f873303a847f112558f081f42720a284558cace.tar.gz
android_packages_apps_Snap-3f873303a847f112558f081f42720a284558cace.tar.bz2
android_packages_apps_Snap-3f873303a847f112558f081f42720a284558cace.zip
SnapdragonCamera: fix don't lock screen after press power key
The window flag FLAG_SHOW_WHEN_LOCKED is workding even if press power key, so camera activity will not be close still run above locked screen UI. The CameraGestureActivity is start from screen off, so it will be a SecureCameraActivity. Finish activity as same as the secure camera activity. Change-Id: I76d8ff3d2f037b81140b35255b52b4c4f4de95d3 CRs-Fixed: 777770
Diffstat (limited to 'src/com/android/camera/CameraActivity.java')
-rw-r--r--src/com/android/camera/CameraActivity.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 8fd8f9daa..d460867a6 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -122,6 +122,9 @@ public class CameraActivity extends Activity
// panorama. If the extra is not set, it is in the normal camera mode.
public static final String SECURE_CAMERA_EXTRA = "secure_camera";
+ // This string is used for judge start activity from screenoff or not
+ public static final String GESTURE_CAMERA_NAME = "com.android.camera.CameraGestureActivity";
+
/**
* Request code from an activity we started that indicated that we do not
* want to reset the view to the preview in onResume.
@@ -1158,9 +1161,6 @@ public class CameraActivity extends Activity
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
setContentView(R.layout.camera_filmstrip);
- int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
- | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
- getWindow().addFlags(flags);
mActionBar = getActionBar();
mActionBar.addOnMenuVisibilityListener(this);
@@ -1174,7 +1174,8 @@ public class CameraActivity extends Activity
Intent intent = getIntent();
String action = intent.getAction();
if (INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action)
- || ACTION_IMAGE_CAPTURE_SECURE.equals(action)) {
+ || ACTION_IMAGE_CAPTURE_SECURE.equals(action)
+ || intent.getComponent().getClassName().equals(GESTURE_CAMERA_NAME)) {
mSecureCamera = true;
} else {
mSecureCamera = intent.getBooleanExtra(SECURE_CAMERA_EXTRA, false);
@@ -1185,6 +1186,9 @@ public class CameraActivity extends Activity
Window win = getWindow();
WindowManager.LayoutParams params = win.getAttributes();
params.flags |= WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
+ if (intent.getComponent().getClassName().equals(GESTURE_CAMERA_NAME)) {
+ params.flags |= WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
+ }
win.setAttributes(params);
// Filter for screen off so that we can finish secure camera activity