diff options
author | Likai Ding <likaid@codeaurora.org> | 2015-02-06 13:28:34 +0800 |
---|---|---|
committer | Likai Ding <likaid@codeaurora.org> | 2015-02-06 13:53:02 +0800 |
commit | 6c43863efdc8ecaf5915c21d8722305db69fc78a (patch) | |
tree | c4b8b1f5eeade6003f049422a619e314152cde40 /src/com | |
parent | 5e266938aac08975bbe198915adda22cc59ffebe (diff) | |
download | android_packages_apps_Snap-6c43863efdc8ecaf5915c21d8722305db69fc78a.tar.gz android_packages_apps_Snap-6c43863efdc8ecaf5915c21d8722305db69fc78a.tar.bz2 android_packages_apps_Snap-6c43863efdc8ecaf5915c21d8722305db69fc78a.zip |
SnapdragonCamera: fix preview not shown bug
resizeForPreviewAspectRatio() might be called before SurfaceView's
layout process, which causes SurfaceView being set to 0 width and
height. Add check before adjusting SurfaceView's dimensions.
Change-Id: I66bf6dfcef74253429b2c6cd1a80031d8e30f95d
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/PhotoUI.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index bad7073a9..81837f68f 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -390,6 +390,8 @@ public class PhotoUI implements PieListener, } } else { float width = mOriginalPreviewWidth, height = mOriginalPreviewHeight; + if (width == 0 || height == 0) return; + if (mOrientationResize) { scaledTextureWidth = height * mAspectRatio; if (scaledTextureWidth > width) { |