From 7ca29af28d2e3e2af1e7f02a02ff8ad78cc9af8f Mon Sep 17 00:00:00 2001 From: Likai Ding Date: Wed, 5 Aug 2015 18:35:56 +0800 Subject: SnapdragonCamera: notify focus manager about surface change If device and preview have different aspect ratio, preview doesn't occupy full screen. So SurfaceView's dimensions including margins need to be considered for transformation matrix. Otherwise touch focus area set to HAL won't match with actual user touch point on screen. CRs-Fixed: 885176 Change-Id: I6b7bfa6e3cb831592615dc5dfc45622f106c99d0 --- src/com/android/camera/PhotoUI.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index b31b7314f..837fd0e4f 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -30,6 +30,7 @@ import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Point; +import android.graphics.RectF; import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.ColorDrawable; import android.hardware.Camera; @@ -446,6 +447,9 @@ public class PhotoUI implements PieListener, @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { Log.v(TAG, "surfaceChanged: width =" + width + ", height = " + height); + RectF r = new RectF(mSurfaceView.getLeft(), mSurfaceView.getTop(), + mSurfaceView.getRight(), mSurfaceView.getBottom()); + mController.onPreviewRectChanged(CameraUtil.rectFToRect(r)); } @Override -- cgit v1.2.3