summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoModule.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/PhotoModule.java')
-rw-r--r--src/com/android/camera/PhotoModule.java70
1 files changed, 40 insertions, 30 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 589f55152..4d2ec6ad8 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -696,6 +696,7 @@ public class PhotoModule
private void switchCamera() {
if (mPaused) return;
+ mUI.applySurfaceChange(PhotoUI.SURFACE_STATUS.HIDE);
Log.v(TAG, "Start to switch camera. id=" + mPendingSwitchCameraId);
mCameraId = mPendingSwitchCameraId;
mPendingSwitchCameraId = -1;
@@ -735,6 +736,7 @@ public class PhotoModule
mFocusManager.setParameters(mInitialParams);
setupPreview();
+ mUI.applySurfaceChange(PhotoUI.SURFACE_STATUS.SURFACE_VIEW);
// reset zoom value index
mZoomValue = 0;
resizeForPreviewAspectRatio();
@@ -1126,23 +1128,26 @@ public class PhotoModule
for (int i =0;i<3;i++) {
metadata[i] = byteToInt( (byte []) data, i*4);
}
- if (metadata[2] == 1) {
- mAutoHdrEnable = true;
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- if (mDrawAutoHDR != null)
- mDrawAutoHDR.AutoHDR();
- }
- });
- }
- else {
- mAutoHdrEnable = false;
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- if (mDrawAutoHDR != null)
- mDrawAutoHDR.AutoHDR();
- }
- });
+ /* Checking if the meta data is for auto HDR */
+ if (metadata[0] == 3) {
+ if (metadata[2] == 1) {
+ mAutoHdrEnable = true;
+ mActivity.runOnUiThread(new Runnable() {
+ public void run() {
+ if (mDrawAutoHDR != null)
+ mDrawAutoHDR.AutoHDR();
+ }
+ });
+ }
+ else {
+ mAutoHdrEnable = false;
+ mActivity.runOnUiThread(new Runnable() {
+ public void run() {
+ if (mDrawAutoHDR != null)
+ mDrawAutoHDR.AutoHDR();
+ }
+ });
+ }
}
}
}
@@ -2364,6 +2369,7 @@ public class PhotoModule
@Override
public void onResumeAfterSuper() {
mLastPhotoTakenWithRefocus = false;
+ mUI.showSurfaceView();
// 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.
@@ -2372,17 +2378,17 @@ public class PhotoModule
|| MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action)) {
Log.v(TAG, "On resume, from lock screen.");
+ // Check if there is a need to take a snapshot without
+ // waiting for the shutter click
+ if (isInstantCaptureEnabled()) {
+ mInstantCaptureSnapShot = true;
+ }
+
// Note: onPauseAfterSuper() will delete this runnable, so we will
// at most have 1 copy queued up.
mHandler.postDelayed(new Runnable() {
public void run() {
onResumeTasks();
-
- // Check if there is a need to take a snapshot without
- // waiting for the shutter click
- if (isInstantCaptureEnabled()) {
- mInstantCaptureSnapShot = true;
- }
}
}, ON_RESUME_TASKS_DELAY_MSEC);
} else {
@@ -2425,6 +2431,8 @@ public class PhotoModule
mOpenCameraThread.start();
}
+ mUI.applySurfaceChange(PhotoUI.SURFACE_STATUS.SURFACE_VIEW);
+
mJpegPictureCallbackTime = 0;
mZoomValue = 0;
@@ -2463,6 +2471,8 @@ public class PhotoModule
@Override
public void onPauseBeforeSuper() {
mPaused = true;
+ mUI.applySurfaceChange(PhotoUI.SURFACE_STATUS.HIDE);
+
Sensor gsensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
if (gsensor != null) {
mSensorManager.unregisterListener(this, gsensor);
@@ -2491,6 +2501,7 @@ public class PhotoModule
public void onPauseAfterSuper() {
Log.v(TAG, "On pause.");
mUI.showPreviewCover();
+ mUI.hideSurfaceView();
try {
if (mOpenCameraThread != null) {
@@ -2564,12 +2575,6 @@ public class PhotoModule
// we will update focus manager with proper UI.
if (mFocusManager != null && mUI != null) {
mFocusManager.setPhotoUI(mUI);
-
- View root = mUI.getRootView();
- // These depend on camera parameters.
- int width = root.getWidth();
- int height = root.getHeight();
- mFocusManager.setPreviewSize(width, height);
}
}
@@ -4657,6 +4662,11 @@ public class PhotoModule
}
@Override
+ public void onZoomChanged(float requestedZoom) {
+
+ }
+
+ @Override
public int getCameraState() {
return mCameraState;
}
@@ -4976,7 +4986,7 @@ class DrawAutoHDR extends View{
AutoHDRPaint.setStyle(Paint.Style.STROKE);
AutoHDRPaint.setColor(Color.MAGENTA);
AutoHDRPaint.setStrokeWidth(1);
- AutoHDRPaint.setTextSize(16);
+ AutoHDRPaint.setTextSize(32);
AutoHDRPaint.setAlpha (255);
canvas.drawText("HDR On",200,100,AutoHDRPaint);
}