From 73861e46313112bb14a307943d31ecc040637593 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Tue, 1 Oct 2013 03:17:06 -0700 Subject: camera: Fix camera startup racing with orientation change * When launching the camera via the lock screen widget on some devices, the orientation change shows up late, and we get an onConfigurationChanged in the middle of setting up the textures, causing an infinite wait in the UI thread. * Ignore these events until the preview is up and running, orientation will be checked later. Change-Id: Icf5013e039324d617acd1c1108d37c655776c1c3 --- src/com/android/camera/PhotoModule.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 4152ced39..bd68b0aed 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -1521,13 +1521,9 @@ public class PhotoModule public void onConfigurationChanged(Configuration newConfig) { Log.v(TAG, "onConfigurationChanged"); - // Wait for camera initialization - try { - if (mCameraStartUpThread != null) { - mCameraStartUpThread.join(); - } - } catch (InterruptedException iex) { - // Ignore. + // Ignore until the hardware is started + if (mCameraStartUpThread != null) { + return; } setDisplayOrientation(); -- cgit v1.2.3