summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-10-01 03:17:06 -0700
committerSteve Kondik <shade@chemlab.org>2013-10-01 03:32:40 -0700
commit73861e46313112bb14a307943d31ecc040637593 (patch)
tree8ddff340ada8ed91d753317c934010879f24b167
parent1a0e156ed8e9fb80e4fdd5160d710fe7775f0516 (diff)
downloadandroid_packages_apps_Gallery2-73861e46313112bb14a307943d31ecc040637593.tar.gz
android_packages_apps_Gallery2-73861e46313112bb14a307943d31ecc040637593.tar.bz2
android_packages_apps_Gallery2-73861e46313112bb14a307943d31ecc040637593.zip
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
-rw-r--r--src/com/android/camera/PhotoModule.java10
1 files 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();