summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriele M <moto.falcon.git@gmail.com>2017-02-09 17:13:08 +0100
committerDan Pasanen <dan.pasanen@gmail.com>2017-02-09 18:59:09 +0000
commitfe100c6e50feeda676ec470e70c90621dbc57585 (patch)
treee5f3e8e3026b45b429b4c84e0ca016dbc1755f29
parent84752f915ee31ee5f2426474eb58ee4e05874dc6 (diff)
downloadandroid_packages_apps_Snap-fe100c6e50feeda676ec470e70c90621dbc57585.zip
android_packages_apps_Snap-fe100c6e50feeda676ec470e70c90621dbc57585.tar.gz
android_packages_apps_Snap-fe100c6e50feeda676ec470e70c90621dbc57585.tar.bz2
Snap: Fix max brightness and power shutter settings
Checking the value of arePreviewControlsVisible() doesn't allow to reliably determine whether we are using the app or not, so do it as we used to: set a local flag as soon as we show/hide the controls and check its value. Change-Id: Iadfa86d49b74bc811006e1b477b60fc487772219
-rw-r--r--src/com/android/camera/CameraActivity.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index d285b47..cce365e 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -217,6 +217,7 @@ public class CameraActivity extends Activity
private final Object mStorageSpaceLock = new Object();
private long mStorageSpaceBytes = Storage.LOW_STORAGE_THRESHOLD_BYTES;
private boolean mSecureCamera;
+ private boolean mInCameraApp = true;
// Keep track of powershutter state
public static boolean mPowerShutter = false;
// Keep track of max brightness state
@@ -1955,7 +1956,7 @@ public class CameraActivity extends Activity
if (!CameraUtil.hasCameraKey()) {
mPowerShutter = val.equals(CameraSettings.VALUE_ON);
}
- if (mPowerShutter && arePreviewControlsVisible()) {
+ if (mPowerShutter && mInCameraApp) {
getWindow().addPrivateFlags(
WindowManager.LayoutParams.PRIVATE_FLAG_PREVENT_POWER_KEY);
} else {
@@ -1973,7 +1974,7 @@ public class CameraActivity extends Activity
mMaxBrightness = val.equals(CameraSettings.VALUE_ON);
- if (mMaxBrightness && arePreviewControlsVisible()) {
+ if (mMaxBrightness && mInCameraApp) {
params.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_FULL;
} else {
params.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
@@ -2388,6 +2389,7 @@ public class CameraActivity extends Activity
*/
private void setPreviewControlsVisibility(boolean visible) {
mCurrentModule.onPreviewFocusChanged(visible);
+ mInCameraApp = visible;
}
// Accessor methods for getting latency times used in performance testing