From 9cefdd495332719d987ffb942742ec602793d8d4 Mon Sep 17 00:00:00 2001 From: Jiawen Chen Date: Tue, 9 Sep 2014 14:14:39 -0700 Subject: [PATCH] Changed double to float. viewFinder -> viewfinder. Change-Id: I5f10a5e8dae40f56457b863d5e8c703e7bf68e49 --- src/com/android/camera/one/OneCamera.java | 4 ++-- src/com/android/camera/one/v2/OneCameraImpl.java | 10 +++++----- src/com/android/camera/one/v2/OneCameraZslImpl.java | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/com/android/camera/one/OneCamera.java b/src/com/android/camera/one/OneCamera.java index 1b7eccac1..4e95f7fac 100644 --- a/src/com/android/camera/one/OneCamera.java +++ b/src/com/android/camera/one/OneCamera.java @@ -310,7 +310,7 @@ public interface OneCamera { * The preview size requested from the camera device will depend on this as * well as the requested photo/video aspect ratio. */ - public void setViewFinderSize(int width, int height); + public void setViewfinderSize(int width, int height); /** * @return Whether this camera supports flash. @@ -341,7 +341,7 @@ public interface OneCamera { * @return The aspect ratio of the full size capture (usually the native * resolution of the camera). */ - public double getFullSizeAspectRatio(); + public float getFullSizeAspectRatio(); /** * @return Whether this camera is facing to the back. diff --git a/src/com/android/camera/one/v2/OneCameraImpl.java b/src/com/android/camera/one/v2/OneCameraImpl.java index e1f3469d9..258eaddeb 100644 --- a/src/com/android/camera/one/v2/OneCameraImpl.java +++ b/src/com/android/camera/one/v2/OneCameraImpl.java @@ -202,7 +202,7 @@ public class OneCameraImpl extends AbstractOneCamera { * The aspect ratio (width/height) of the full resolution for this camera. * Usually the native aspect ratio of this camera. */ - private final double mFullSizeAspectRatio; + private final float mFullSizeAspectRatio; /** The Camera2 API capture session currently active. */ private CameraCaptureSession mCaptureSession; /** The surface onto which to render the preview. */ @@ -344,7 +344,7 @@ public class OneCameraImpl extends AbstractOneCamera { } @Override - public void setViewFinderSize(int width, int height) { + public void setViewfinderSize(int width, int height) { throw new RuntimeException("Not implemented yet."); } @@ -383,7 +383,7 @@ public class OneCameraImpl extends AbstractOneCamera { } @Override - public double getFullSizeAspectRatio() { + public float getFullSizeAspectRatio() { return mFullSizeAspectRatio; } @@ -662,10 +662,10 @@ public class OneCameraImpl extends AbstractOneCamera { * @return The aspect ration, in terms of width/height of the full capture * size. */ - private static double calculateFullSizeAspectRatio(CameraCharacteristics characteristics) { + private static float calculateFullSizeAspectRatio(CameraCharacteristics characteristics) { Rect activeArraySize = characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE); - return (double) activeArraySize.width() / activeArraySize.height(); + return ((float)(activeArraySize.width())) / activeArraySize.height(); } /** diff --git a/src/com/android/camera/one/v2/OneCameraZslImpl.java b/src/com/android/camera/one/v2/OneCameraZslImpl.java index 34284ddc9..4d6f632e3 100644 --- a/src/com/android/camera/one/v2/OneCameraZslImpl.java +++ b/src/com/android/camera/one/v2/OneCameraZslImpl.java @@ -120,8 +120,9 @@ public class OneCameraZslImpl extends AbstractOneCamera { * continuous AF. */ private static final String FOCUS_RESUME_CALLBACK_TOKEN = "RESUME_CONTINUOUS_AF"; + /** Zero weight 3A region, to reset regions per API. */ - MeteringRectangle[] ZERO_WEIGHT_3A_REGION = AutoFocusHelper.getZeroWeightRegion(); + /*package*/ MeteringRectangle[] ZERO_WEIGHT_3A_REGION = AutoFocusHelper.getZeroWeightRegion(); /** * Thread on which high-priority camera operations, such as grabbing preview @@ -144,7 +145,7 @@ public class OneCameraZslImpl extends AbstractOneCamera { * The aspect ratio (width/height) of the full resolution for this camera. * Usually the native aspect ratio of this camera. */ - private final double mFullSizeAspectRatio; + private final float mFullSizeAspectRatio; /** The Camera2 API capture session currently active. */ private CameraCaptureSession mCaptureSession; /** The surface onto which to render the preview. */ @@ -349,7 +350,6 @@ public class OneCameraZslImpl extends AbstractOneCamera { largestSupportedSize.getHeight()); } - private void onShutterInvokeUI(final PhotoCaptureParameters params) { // Tell CaptureModule shutter has occurred so it can flash the screen. params.callback.onQuickExpose(); @@ -518,7 +518,7 @@ public class OneCameraZslImpl extends AbstractOneCamera { } @Override - public void setViewFinderSize(int width, int height) { + public void setViewfinderSize(int width, int height) { throw new RuntimeException("Not implemented yet."); } @@ -558,7 +558,7 @@ public class OneCameraZslImpl extends AbstractOneCamera { } @Override - public double getFullSizeAspectRatio() { + public float getFullSizeAspectRatio() { return mFullSizeAspectRatio; } @@ -917,10 +917,10 @@ public class OneCameraZslImpl extends AbstractOneCamera { * @return The aspect ration, in terms of width/height of the full capture * size. */ - private static double calculateFullSizeAspectRatio(CameraCharacteristics characteristics) { + private static float calculateFullSizeAspectRatio(CameraCharacteristics characteristics) { Rect activeArraySize = characteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE); - return (double) activeArraySize.width() / activeArraySize.height(); + return ((float) activeArraySize.width()) / activeArraySize.height(); } /** -- 2.11.0