summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/CameraActivity.java')
-rw-r--r--src/com/android/camera/CameraActivity.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index c900d1bf4..77438881c 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012 The Android Open Source Project
+ * Copyright (C) 2013-2015 The CyanogenMod Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -198,6 +199,8 @@ public class CameraActivity extends Activity
private OnScreenHint mStorageHint;
private long mStorageSpaceBytes = Storage.LOW_STORAGE_THRESHOLD_BYTES;
private boolean mSecureCamera;
+ // Keep track of powershutter state
+ public static boolean mPowerShutter = false;
// This is a hack to speed up the start of SecureCamera.
private static boolean sFirstStartAfterScreenOn = true;
private int mLastRawOrientation;
@@ -1773,6 +1776,19 @@ public class CameraActivity extends Activity
}
}
+ protected void initPowerShutter(ComboPreferences prefs) {
+ String val = prefs.getString(CameraSettings.KEY_POWER_SHUTTER,
+ getResources().getString(R.string.pref_camera_power_shutter_default));
+ mPowerShutter = val.equals(CameraSettings.VALUE_ON);
+ if (mPowerShutter /*TODO: && mShowCameraAppView*/) {
+ getWindow().addPrivateFlags(
+ WindowManager.LayoutParams.PRIVATE_FLAG_PREVENT_POWER_KEY);
+ } else {
+ getWindow().clearPrivateFlags(
+ WindowManager.LayoutParams.PRIVATE_FLAG_PREVENT_POWER_KEY);
+ }
+ }
+
protected void setResultEx(int resultCode) {
mResultCodeForTesting = resultCode;
setResult(resultCode);