summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-12-22 22:27:33 +0000
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-01-16 02:39:17 +0200
commita676e15c3728422f31970dce3f60e74bfc9c9e60 (patch)
treef297d7c8148e51c7a6e97e2e74e506529648f758
parent44cfc318abd5ffaca40b88215e5f2834c4b1bf68 (diff)
downloadandroid_packages_apps_Snap-a676e15c3728422f31970dce3f60e74bfc9c9e60.zip
android_packages_apps_Snap-a676e15c3728422f31970dce3f60e74bfc9c9e60.tar.gz
android_packages_apps_Snap-a676e15c3728422f31970dce3f60e74bfc9c9e60.tar.bz2
Revert "Camera: Propagate power mode selection from UI to lower layers."
This reverts commit 5302d2e099de0ae1c3cb4a9cda993fe28b0e8c46, runtime power-mode changes are causing stability issues in camcorder Change-Id: I118f7c47bea2d07296dc18ed8a3a790eef592ca2 Revert "SnapdragonCamera: Disable LPM if DIS/Flip are enabled." This reverts commit 6cd860119a45b4a44d3e1314981862d9dac47955. Revert "SnapdragonCamera: Set low power mode by default." This reverts commit d4fccc04331a6a5a7038a542f7d17ecefa4ac95a. Revert "SnapdragonCamera: Enable low power mode in Camera." This reverts commit 195fccbe69e92b0312822aa762bb53d301c0f56f. Change-Id: I623626e60efc850fe182e54d9e9997ca41275579 [mikeioannina]: Remove the now obsolete power mode setting and unhide the video snapshot size setting Change-Id: I118f7c47bea2d07296dc18ed8a3a790eef592ca2
-rw-r--r--res/values/qcomarrays.xml11
-rw-r--r--res/values/qcomstrings.xml7
-rw-r--r--res/xml/camera_preferences.xml6
-rw-r--r--res/xml/video_preferences.xml6
-rw-r--r--src/com/android/camera/CameraSettings.java13
-rw-r--r--src/com/android/camera/PhotoModule.java23
-rw-r--r--src/com/android/camera/VideoMenu.java1
-rw-r--r--src/com/android/camera/VideoModule.java42
8 files changed, 4 insertions, 105 deletions
diff --git a/res/values/qcomarrays.xml b/res/values/qcomarrays.xml
index 48e6e46..3605ec9 100644
--- a/res/values/qcomarrays.xml
+++ b/res/values/qcomarrays.xml
@@ -22,17 +22,6 @@
<resources>
<!-- Preferences -->
- <!-- Power mode -->
- <string-array name="pref_camera_powermode_entries" translatable="false">
- <item>@string/pref_camera_powermode_entry_lp</item>
- <item>@string/pref_camera_powermode_entry_np</item>
- </string-array>
-
- <string-array name="pref_camera_powermode_entryvalues" translatable="false">
- <item>Low_Power</item>
- <item>Normal_Power</item>
- </string-array>
-
<!-- Picture format -->
<string-array name="pref_camera_picture_format_entries" translatable="false">
<item>@string/pref_camera_picture_format_entry_jpeg</item>
diff --git a/res/values/qcomstrings.xml b/res/values/qcomstrings.xml
index 3eec7fe..78fa98c 100644
--- a/res/values/qcomstrings.xml
+++ b/res/values/qcomstrings.xml
@@ -33,13 +33,6 @@
<string name="pref_camera_videosnapsize_default" translatable="false">1920x1080</string>
- <!-- Power mode -->
- <string name="pref_camera_powermode_title">Power mode</string>
- <string name="pref_camera_powermode_default" translatable="false">Normal_Power</string>
-
- <string name="pref_camera_powermode_entry_lp">Low power</string>
- <string name="pref_camera_powermode_entry_np">Normal</string>
-
<!-- Auto exposure -->
<string name="pref_camera_autoexposure_title">Auto exposure</string>
<string name="pref_camera_autoexposure_default" translatable="false">frame-average</string>
diff --git a/res/xml/camera_preferences.xml b/res/xml/camera_preferences.xml
index 075367c..f036dee 100644
--- a/res/xml/camera_preferences.xml
+++ b/res/xml/camera_preferences.xml
@@ -258,12 +258,6 @@
camera:singleIcon="@drawable/ic_settings_storage"
camera:entryValues="@array/pref_camera_savepath_entryvalues" />
<ListPreference
- camera:key="pref_camera_videosnapsize_key"
- camera:title="@string/pref_camera_picturesize_title"
- camera:defaultValue="@string/pref_camera_videosnapsize_default"
- camera:entries="@array/pref_camera_picturesize_entries"
- camera:entryValues="@array/pref_camera_picturesize_entryvalues" />
- <ListPreference
camera:key="pref_camera_advanced_features_key"
camera:defaultValue="@string/pref_camera_advanced_feature_default"
camera:title="@string/pref_camera_advanced_features_title"
diff --git a/res/xml/video_preferences.xml b/res/xml/video_preferences.xml
index 00b55ae..530d987 100644
--- a/res/xml/video_preferences.xml
+++ b/res/xml/video_preferences.xml
@@ -104,12 +104,6 @@
camera:entries="@array/pref_camera_recordlocation_entries"
camera:entryValues="@array/pref_camera_recordlocation_entryvalues" />
<ListPreference
- camera:key="pref_camera_powermode_key"
- camera:defaultValue="@string/pref_camera_powermode_default"
- camera:title="@string/pref_camera_powermode_title"
- camera:entries="@array/pref_camera_powermode_entries"
- camera:entryValues="@array/pref_camera_powermode_entryvalues" />
- <ListPreference
camera:key="pref_camera_dis_key"
camera:defaultValue="@string/pref_camera_dis_default"
camera:title="@string/pref_camera_dis_title"
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 148e1fc..e322421 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -80,7 +80,6 @@ public class CameraSettings {
public static final String KEY_MAX_BRIGHTNESS = "pref_max_brightness";
public static final String KEY_VIDEO_ENCODER = "pref_camera_videoencoder_key";
public static final String KEY_AUDIO_ENCODER = "pref_camera_audioencoder_key";
- public static final String KEY_POWER_MODE = "pref_camera_powermode_key";
public static final String KEY_PICTURE_FORMAT = "pref_camera_pictureformat_key";
public static final String KEY_ZSL = "pref_camera_zsl_key";
public static final String KEY_CAMERA_SAVEPATH = "pref_camera_savepath_key";
@@ -647,7 +646,6 @@ public class CameraSettings {
private void qcomInitPreferences(PreferenceGroup group){
//Qcom Preference add here
- ListPreference powerMode = group.findPreference(KEY_POWER_MODE);
ListPreference zsl = group.findPreference(KEY_ZSL);
ListPreference colorEffect = group.findPreference(KEY_COLOR_EFFECT);
ListPreference camcorderColorEffect = group.findPreference(KEY_VIDEOCAMERA_COLOR_EFFECT);
@@ -721,10 +719,6 @@ public class CameraSettings {
ListPreference videoRotation = group.findPreference(KEY_VIDEO_ROTATION);
- if (!mParameters.isPowerModeSupported() && powerMode != null) {
- removePreference(group, powerMode.getKey());
- }
-
if (selectableZoneAf != null) {
filterUnsupportedOptions(group,
selectableZoneAf, mParameters.getSupportedSelectableZoneAf());
@@ -800,12 +794,9 @@ public class CameraSettings {
autoExposure, mParameters.getSupportedAutoexposure());
}
- if (!mParameters.isPowerModeSupported()){
- filterUnsupportedOptions(group,
- videoSnapSize, null);
- } else {
+ if (videoSnapSize != null) {
filterUnsupportedOptions(group, videoSnapSize, sizeListToStringList(
- mParameters.getSupportedPictureSizes()));
+ mParameters.getSupportedPictureSizes()));
}
if (histogram!= null) {
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 53468eb..825e3ed 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -357,9 +357,6 @@ public class PhotoModule
private int mJpegFileSizeEstimation = 0;
private int mRemainingPhotos = -1;
- //settings, which if enabled, need to turn off low power mode
- private boolean mIsFlipEnabled = false;
-
private MediaSaveService.OnMediaSavedListener mOnMediaSavedListener =
new MediaSaveService.OnMediaSavedListener() {
@Override
@@ -1948,7 +1945,6 @@ public class PhotoModule
if (mParameters != null && mCameraDevice != null && mCameraState == IDLE) {
Log.v(TAG, "onOrientationChanged, update parameters");
setFlipValue();
- updatePowerMode();
mCameraDevice.setParameters(mParameters);
}
mUI.setOrientation(mOrientation, true);
@@ -3304,8 +3300,6 @@ public class PhotoModule
mParameters.setFlashMode(fMode);
}
- updatePowerMode();
-
mLongShotMaxSnap = SystemProperties.getInt(PERSIST_LONGSHOT_MAX_SNAP, -1);
mParameters.set("max-longshot-snap",mLongShotMaxSnap);
}
@@ -3370,12 +3364,6 @@ public class PhotoModule
if(CameraUtil.isSupported(picture_flip, CameraSettings.getSupportedFlipMode(mParameters))){
mParameters.set(CameraSettings.KEY_QC_SNAPSHOT_PICTURE_FLIP, picture_flip);
}
-
- if ((preview_flip_value != 0) || (video_flip_value != 0) || (picture_flip_value != 0)) {
- mIsFlipEnabled = true;
- } else {
- mIsFlipEnabled = false;
- }
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@@ -4472,17 +4460,6 @@ public class PhotoModule
return mLastPhotoTakenWithRefocus;
}
- private void updatePowerMode() {
- String lpmSupported = mParameters.get("low-power-mode-supported");
- if ((lpmSupported != null) && "true".equals(lpmSupported)) {
- if (!mIsFlipEnabled) {
- mParameters.set("low-power-mode", "enable");
- } else {
- mParameters.set("low-power-mode", "disable");
- }
- }
- }
-
public boolean isLongshotDone() {
return ((mCameraState == LONGSHOT) && (mLongshotSnapNum == mReceivedSnapNum) &&
!mLongshotActive);
diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java
index 5d71cf6..6018fcf 100644
--- a/src/com/android/camera/VideoMenu.java
+++ b/src/com/android/camera/VideoMenu.java
@@ -137,7 +137,6 @@ public class VideoMenu extends MenuController
CameraSettings.KEY_VIDEO_ENCODER,
CameraSettings.KEY_AUDIO_ENCODER,
CameraSettings.KEY_VIDEO_HDR,
- CameraSettings.KEY_POWER_MODE,
CameraSettings.KEY_VIDEO_ROTATION,
CameraSettings.KEY_VIDEO_CDS_MODE,
CameraSettings.KEY_VIDEO_TNR_MODE
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 996166f..92d9e29 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -209,10 +209,6 @@ public class VideoModule implements CameraModule,
private boolean mIsVideoCDSUpdated = false;
private boolean mOverrideCDS = false;
- //settings, which if enabled, need to turn off low power mode
- private boolean mIsFlipEnabled = false;
- private boolean mIsDISEnabled = false;
-
// The preview window is on focus
private boolean mPreviewFocused = false;
@@ -656,7 +652,6 @@ public class VideoModule implements CameraModule,
if ((mCameraDevice != null) && (mParameters != null)
&& (true == mPreviewing) && !mMediaRecorderRecording){
setFlipValue();
- updatePowerMode();
mCameraDevice.setParameters(mParameters);
}
mUI.setOrientation(newOrientation, true);
@@ -816,18 +811,6 @@ public class VideoModule implements CameraModule,
Log.v(TAG, "Audio Encoder selected = " +mAudioEncoder);
- if(mParameters.isPowerModeSupported()) {
- String powermode = mPreferences.getString(
- CameraSettings.KEY_POWER_MODE,
- mActivity.getString(R.string.pref_camera_powermode_default));
- Log.v(TAG, "read videopreferences power mode =" +powermode);
- String old_mode = mParameters.getPowerMode();
- if(!old_mode.equals(powermode) && mPreviewing)
- mRestartPreview = true;
-
- mParameters.setPowerMode(powermode);
- }
-
// Set wavelet denoise mode
if (mParameters.getSupportedDenoiseModes() != null) {
String denoise = mPreferences.getString(CameraSettings.KEY_DENOISE,
@@ -2253,11 +2236,7 @@ public class VideoModule implements CameraModule,
mParameters.set(CameraSettings.KEY_QC_SNAPSHOT_PICTURE_FLIP, picture_flip);
}
- if ((preview_flip_value != 0) || (video_flip_value != 0) || (picture_flip_value != 0)) {
- mIsFlipEnabled = true;
- } else {
- mIsFlipEnabled = false;
- }
+
}
private void qcomSetCameraParameters(){
@@ -2276,7 +2255,6 @@ public class VideoModule implements CameraModule,
CameraSettings.KEY_DIS,
mActivity.getString(R.string.pref_camera_dis_default));
Log.v(TAG, "DIS value =" + disMode);
- mIsDISEnabled = disMode.equals("enable");
if (is4KEnabled()) {
if (isSupported(mActivity.getString(R.string.pref_camera_dis_value_disable),
@@ -2531,7 +2509,6 @@ public class VideoModule implements CameraModule,
Toast.LENGTH_LONG).show();
mParameters.set(CameraSettings.KEY_QC_DIS_MODE, "disable");
mUI.overrideSettings(CameraSettings.KEY_DIS,"disable");
- mIsDISEnabled = false;
}
}
//setting video rotation
@@ -2542,10 +2519,7 @@ public class VideoModule implements CameraModule,
mParameters.setVideoRotation(videoRotation);
}
- //set power mode settings
- updatePowerMode();
}
-
@SuppressWarnings("deprecation")
private void setCameraParameters() {
Log.d(TAG,"Preview dimension in App->"+mDesiredPreviewWidth+"X"+mDesiredPreviewHeight);
@@ -2712,7 +2686,7 @@ public class VideoModule implements CameraModule,
// We need to restart the preview if preview size is changed.
Size size = mParameters.getPreviewSize();
if (size.width != mDesiredPreviewWidth
- || size.height != mDesiredPreviewHeight || mRestartPreview) {
+ || size.height != mDesiredPreviewHeight) {
stopPreview();
resizeForPreviewAspectRatio();
@@ -2720,7 +2694,6 @@ public class VideoModule implements CameraModule,
} else {
setCameraParameters();
}
- mRestartPreview = false;
mUI.updateOnScreenIndicators(mParameters, mPreferences);
Storage.setSaveSDCard(
mPreferences.getString(CameraSettings.KEY_CAMERA_SAVEPATH, "0").equals("1"));
@@ -2984,15 +2957,4 @@ public class VideoModule implements CameraModule,
resumeVideoRecording();
}
- private void updatePowerMode() {
- String lpmSupported = mParameters.get("low-power-mode-supported");
- if ((lpmSupported != null) && "true".equals(lpmSupported)) {
- if (!mIsDISEnabled && !mIsFlipEnabled) {
- mParameters.set("low-power-mode", "enable");
- } else {
- mParameters.set("low-power-mode", "disable");
- }
- }
- }
-
}