summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/Camera.java
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2011-10-18 12:47:44 +0800
committerChung-yih Wang <cywang@google.com>2011-11-01 15:31:16 +0800
commitd33109730e0ab81230f84e2bd35599e8e24fc4ba (patch)
treedf80db1d6647bf952f495a81d8ab67ee7498880d /src/com/android/camera/Camera.java
parentabf79a3e25e6c631275e9f81424c0aa25ec9191b (diff)
downloadLegacyCamera-d33109730e0ab81230f84e2bd35599e8e24fc4ba.zip
LegacyCamera-d33109730e0ab81230f84e2bd35599e8e24fc4ba.tar.gz
LegacyCamera-d33109730e0ab81230f84e2bd35599e8e24fc4ba.tar.bz2
Change the default orientation to portrait.
bug:5446617 Since the orientation is mainly portrait on phones, the default orientation of an application will decide if the window animation will be played before it starts. In order to reduce the launch time of Camera apps, this change is to skip the window animations by changing the default orientation to portrait. Change-Id: I6682ab408d7e8d1f0580f3c1600b6c9c3d6a7f6e
Diffstat (limited to 'src/com/android/camera/Camera.java')
-rw-r--r--src/com/android/camera/Camera.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index f78d51f..1bd759b 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -33,6 +33,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences.Editor;
+import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.hardware.Camera.CameraInfo;
import android.hardware.Camera.Face;
@@ -823,7 +824,11 @@ public class Camera extends ActivityBase implements FocusManager.Listener,
r.width = width;
r.height = height;
r.dateTaken = System.currentTimeMillis();
- r.previewWidth = mPreviewFrameLayout.getWidth();
+ if (getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
+ r.previewWidth = mPreviewFrameLayout.getHeight();
+ } else {
+ r.previewWidth = mPreviewFrameLayout.getWidth();
+ }
synchronized (this) {
while (mQueue.size() >= QUEUE_LIMIT) {
try {