summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/PhotoModule.java19
-rw-r--r--src/com/android/camera/PhotoUI.java2
-rw-r--r--src/com/android/camera/VideoModule.java18
-rw-r--r--src/com/android/camera/VideoUI.java2
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java14
-rw-r--r--src/com/android/camera/ui/CameraControls.java42
-rw-r--r--src/com/android/camera/util/CameraUtil.java33
7 files changed, 115 insertions, 15 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index cdeb490ed..f95d40564 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -915,6 +915,10 @@ public class PhotoModule
// TODO: need to check cached background apps memory and longshot ION memory
private boolean isLongshotNeedCancel() {
+ if (Storage.getAvailableSpace() <= Storage.LOW_STORAGE_THRESHOLD_BYTES) {
+ Log.w(TAG, "current storage is full");
+ return true;
+ }
if (SECONDARY_SERVER_MEM == 0) {
ActivityManager am = (ActivityManager) mActivity.getSystemService(
Context.ACTIVITY_SERVICE);
@@ -1765,6 +1769,17 @@ public class PhotoModule
String whiteBalance = Parameters.WHITE_BALANCE_AUTO;
focusMode = mFocusManager.getFocusMode();
colorEffect = mParameters.getColorEffect();
+ String defaultEffect = mActivity.getString(R.string.pref_camera_coloreffect_default);
+ if (CameraUtil.SCENE_MODE_HDR.equals(mSceneMode)
+ && colorEffect != null & !colorEffect.equals(defaultEffect)) {
+ disableLongShot = true;
+ // Change the colorEffect to default(None effect) when HDR ON.
+ colorEffect = defaultEffect;
+ mUI.setPreference(CameraSettings.KEY_COLOR_EFFECT, colorEffect);
+ mParameters.setColorEffect(colorEffect);
+ mCameraDevice.setParameters(mParameters);
+ mParameters = mCameraDevice.getParameters();
+ }
exposureCompensation =
Integer.toString(mParameters.getExposureCompensation());
touchAfAec = mCurrTouchAfAec;
@@ -1777,9 +1792,6 @@ public class PhotoModule
Integer.toString(mParameters.getSharpness()),
colorEffect,
sceneMode, redeyeReduction, aeBracketing);
- if (CameraUtil.SCENE_MODE_HDR.equals(mSceneMode)) {
- disableLongShot = true;
- }
} else if (mFocusManager.isZslEnabled()) {
focusMode = mParameters.getFocusMode();
overrideCameraSettings(flashMode, null, focusMode,
@@ -2193,6 +2205,7 @@ public class PhotoModule
@Override
public void onResumeAfterSuper() {
+ mLastPhotoTakenWithRefocus = false;
// Add delay on resume from lock screen only, in order to to speed up
// the onResume --> onPause --> onResume cycle from lock screen.
// Don't do always because letting go of thread can cause delay.
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index e8dd948c3..276a78db2 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -1005,6 +1005,7 @@ public class PhotoUI implements PieListener,
}
protected void showCapturedImageForReview(byte[] jpegData, int orientation, boolean mirror) {
+ mCameraControls.hideCameraSettings();
mDecodeTaskForReview = new DecodeImageForReview(jpegData, orientation, mirror);
mDecodeTaskForReview.execute();
mOnScreenIndicators.setVisibility(View.GONE);
@@ -1017,6 +1018,7 @@ public class PhotoUI implements PieListener,
}
protected void hidePostCaptureAlert() {
+ mCameraControls.showCameraSettings();
if (mDecodeTaskForReview != null) {
mDecodeTaskForReview.cancel(true);
}
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 4aa686c51..ffbbc0ed4 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -2028,8 +2028,6 @@ public class VideoModule implements CameraModule,
mActivity.getString(R.string.pref_camera_dis_value_disable));
mUI.overrideSettings(CameraSettings.KEY_DIS,
mActivity.getString(R.string.pref_camera_dis_value_disable));
- RotateTextToast.makeText(mActivity, R.string.video_quality_4k_disable_IS,
- Toast.LENGTH_LONG).show();
} else {
Log.e(TAG, "Not supported IS mode = " +
mActivity.getString(R.string.pref_camera_dis_value_disable));
@@ -2446,6 +2444,22 @@ public class VideoModule implements CameraModule,
@Override
public void onSharedPreferenceChanged(ListPreference pref) {
+ if (pref != null && CameraSettings.KEY_VIDEO_QUALITY.equals(pref.getKey())) {
+ String videoQuality = pref.getValue();
+ if (CameraSettings.VIDEO_QUALITY_TABLE.containsKey(videoQuality)) {
+ int quality = CameraSettings.VIDEO_QUALITY_TABLE.get(videoQuality);
+ if ((quality == CamcorderProfile.QUALITY_2160P
+ || quality == CamcorderProfile.QUALITY_4kDCI)
+ && mPreferences != null) {
+ String disDisable = mActivity.getString(R.string.pref_camera_dis_value_disable);
+ if (!disDisable.equals(
+ mPreferences.getString(CameraSettings.KEY_DIS, disDisable))) {
+ RotateTextToast.makeText(mActivity, R.string.video_quality_4k_disable_IS,
+ Toast.LENGTH_LONG).show();
+ }
+ }
+ }
+ }
onSharedPreferenceChanged();
}
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index ebe5b1105..bac1e3c11 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -887,7 +887,7 @@ public class VideoUI implements PieRenderer.PieListener,
hideSwitcher();
mRecordingTimeView.setText("");
mRecordingTimeView.setVisibility(View.VISIBLE);
- mPauseButton.setVisibility(mIsTimeLapse ? View.GONE : View.VISIBLE);
+ mPauseButton.setVisibility(View.VISIBLE);
} else {
mShutterButton.setImageResource(R.drawable.btn_new_shutter_video);
if (!mController.isVideoCaptureIntent()) {
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index cd8f6fe65..26a8cb972 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -495,9 +495,6 @@ public class WideAnglePanoramaModule
mMosaicPreviewRenderer = renderer;
mCameraTexture = mMosaicPreviewRenderer.getInputSurfaceTexture();
- if (!mPaused && !mThreadRunning && mWaitProcessorTask == null) {
- mMainHandler.sendEmptyMessage(MSG_RESET_TO_PREVIEW);
- }
mRendererLock.notifyAll();
}
mMosaicPreviewConfigured = true;
@@ -515,9 +512,14 @@ public class WideAnglePanoramaModule
if (mCaptureState == CAPTURE_STATE_MOSAIC){
capturePending = true;
}
- mPreviewUIWidth = r - l;
- mPreviewUIHeight = b - t;
- configMosaicPreview();
+ int width = r -l;
+ int height = b - t;
+ if (mPreviewUIWidth != width || mPreviewUIHeight != height
+ || mCameraState != PREVIEW_ACTIVE) {
+ mPreviewUIWidth = r - l;
+ mPreviewUIHeight = b - t;
+ configMosaicPreview();
+ }
if (capturePending == true){
mMainHandler.post(new Runnable() {
@Override
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index c0defea06..fe6de5351 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -41,6 +41,7 @@ import org.codeaurora.snapcam.R;
import com.android.camera.ui.ModuleSwitcher;
import com.android.camera.ui.RotateImageView;
import com.android.camera.ShutterButton;
+import com.android.camera.Storage;
import com.android.camera.util.CameraUtil;
import com.android.camera.TsMakeupManager;
@@ -84,6 +85,7 @@ public class CameraControls extends RotatableLayout {
private LinearLayout mRemainingPhotos;
private TextView mRemainingPhotosText;
+ private int mCurrentRemaining = -1;
private int mOrientation;
private int mPreviewRatio;
@@ -92,6 +94,8 @@ public class CameraControls extends RotatableLayout {
private Paint mPaint;
+ private static final int LOW_REMAINING_PHOTOS = 20;
+
AnimatorListener outlistener = new AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
@@ -868,14 +872,20 @@ public class CameraControls extends RotatableLayout {
}
public void updateRemainingPhotos(int remaining) {
- if (remaining < 0) {
+ long remainingStorage = Storage.getAvailableSpace() - Storage.LOW_STORAGE_THRESHOLD_BYTES;
+ if (remaining < 0 && remainingStorage <= 0) {
mRemainingPhotos.setVisibility(View.GONE);
} else {
for (int i = mRemainingPhotos.getChildCount() - 1; i >= 0; --i) {
mRemainingPhotos.getChildAt(i).setVisibility(View.VISIBLE);
}
- mRemainingPhotosText.setText(remaining + " ");
+ if (remaining < LOW_REMAINING_PHOTOS) {
+ mRemainingPhotosText.setText("<" + LOW_REMAINING_PHOTOS + " ");
+ } else {
+ mRemainingPhotosText.setText(remaining + " ");
+ }
}
+ mCurrentRemaining = remaining;
}
public void setMargins(int top, int bottom) {
@@ -900,7 +910,9 @@ public class CameraControls extends RotatableLayout {
public void showRefocusToast(boolean show) {
mRefocusToast.setVisibility(show ? View.VISIBLE : View.GONE);
- mRemainingPhotos.setVisibility(show ? View.GONE : View.VISIBLE);
+ if (mCurrentRemaining > 0 ) {
+ mRemainingPhotos.setVisibility(show ? View.GONE : View.VISIBLE);
+ }
}
public void setOrientation(int orientation, boolean animation) {
@@ -916,6 +928,30 @@ public class CameraControls extends RotatableLayout {
layoutRemaingPhotos();
}
+ public void hideCameraSettings() {
+ mFrontBackSwitcher.setVisibility(View.INVISIBLE);
+ if(TsMakeupManager.HAS_TS_MAKEUP) {
+ mTsMakeupSwitcher.setVisibility(View.INVISIBLE);
+ } else {
+ mHdrSwitcher.setVisibility(View.INVISIBLE);
+ }
+ mSceneModeSwitcher.setVisibility(View.INVISIBLE);
+ mFilterModeSwitcher.setVisibility(View.INVISIBLE);
+ mMenu.setVisibility(View.INVISIBLE);
+ }
+
+ public void showCameraSettings() {
+ mFrontBackSwitcher.setVisibility(View.VISIBLE);
+ if(TsMakeupManager.HAS_TS_MAKEUP) {
+ mTsMakeupSwitcher.setVisibility(View.VISIBLE);
+ } else {
+ mHdrSwitcher.setVisibility(View.VISIBLE);
+ }
+ mSceneModeSwitcher.setVisibility(View.VISIBLE);
+ mFilterModeSwitcher.setVisibility(View.VISIBLE);
+ mMenu.setVisibility(View.VISIBLE);
+ }
+
private class ArrowTextView extends TextView {
private static final int TEXT_SIZE = 14;
private static final int PADDING_SIZE = 18;
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index 7201a7f8c..5fb00ca65 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -51,6 +51,7 @@ import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.Toast;
+import android.os.SystemProperties;
import com.android.camera.CameraActivity;
import com.android.camera.CameraDisabledException;
@@ -483,6 +484,38 @@ public class CameraUtil {
private static Point getDefaultDisplaySize(Activity activity, Point size) {
activity.getWindowManager().getDefaultDisplay().getSize(size);
+ //cap the display resolution given to getOptimalPreviewSize if the below properties
+ //are set. For example if the properties are set as below :
+ //adb shell setprop camera.display.umax 1920x1080
+ //adb shell setprop camera.display.lmax 1280x720
+ //Then, in devices having display panel size >1080p, panel size will be seen as 1080p.
+ //If its 1080p or lesser (but >=720p), limit it to next allowed max which is 720p.
+ //For < 720p, there is no need to do any capping.
+ //By capping the panel size, we are indirectly controlling the preview size being
+ //chosen in getOptimalPreviewSize().
+ String uMax = SystemProperties.get("camera.display.umax", "");
+ String lMax = SystemProperties.get("camera.display.lmax", "");
+ if ((uMax.length() > 0) && (lMax.length() > 0)) {
+ Log.v(TAG,"display uMax "+ uMax + " lMax " + lMax);
+ String uMaxArr[] = uMax.split("x", 2);
+ String lMaxArr[] = lMax.split("x", 2);
+ try {
+ int uMaxWidth = Integer.parseInt(uMaxArr[0]);
+ int uMaxHeight = Integer.parseInt(uMaxArr[1]);
+ int lMaxWidth = Integer.parseInt(lMaxArr[0]);
+ int lMaxHeight = Integer.parseInt(lMaxArr[1]);
+ int defaultDisplaySize = (size.x * size.y);
+ if (defaultDisplaySize > (uMaxWidth*uMaxHeight)) {
+ size.set(uMaxWidth,uMaxHeight);
+ } else if (defaultDisplaySize >= (lMaxWidth*lMaxHeight)) {
+ size.set(lMaxWidth,lMaxHeight);
+ } else {
+ Log.v(TAG,"No need to cap display size");
+ }
+ } catch (Exception e) {
+ Log.e(TAG,"Invalid display properties");
+ }
+ }
return size;
}