diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2015-01-13 12:19:49 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-01-13 12:19:49 -0800 |
commit | 373dc8241d2dfe9d115fee987ec76fe26baa6cad (patch) | |
tree | 8e12f5cd1ae2d300a5430b334bdd8e2d5d513261 /src | |
parent | 04a3178fd0e7ce1bf2d3bb590732423e99db4e57 (diff) | |
parent | 3f873303a847f112558f081f42720a284558cace (diff) | |
download | android_packages_apps_Snap-373dc8241d2dfe9d115fee987ec76fe26baa6cad.tar.gz android_packages_apps_Snap-373dc8241d2dfe9d115fee987ec76fe26baa6cad.tar.bz2 android_packages_apps_Snap-373dc8241d2dfe9d115fee987ec76fe26baa6cad.zip |
Merge "SnapdragonCamera: fix don't lock screen after press power key"
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 12 |
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 |