From f09c1a247af4688729a85af8fba4ba1e404a63d5 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 22 Apr 2010 15:59:21 -0700 Subject: [PATCH] Fix issue #2608292: Fails to launch the video camera preview Need to clear the attached hidden flag on the window, even if it does not yet have an actual surface. Change-Id: I0a90f6b03cd8e347a3eae4d6bea3ab93f7128bf4 --- .../android/server/WindowManagerService.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index 657b6af0b4380..53de7d99e5177 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -7580,15 +7580,17 @@ public class WindowManagerService extends IWindowManager.Stub while (i > 0) { i--; WindowState c = (WindowState)mChildWindows.get(i); - if (c.mSurface != null && c.mAttachedHidden) { + if (c.mAttachedHidden) { c.mAttachedHidden = false; - c.performShowLocked(); - // It hadn't been shown, which means layout not - // performed on it, so now we want to make sure to - // do a layout. If called from within the transaction - // loop, this will cause it to restart with a new - // layout. - mLayoutNeeded = true; + if (c.mSurface != null) { + c.performShowLocked(); + // It hadn't been shown, which means layout not + // performed on it, so now we want to make sure to + // do a layout. If called from within the transaction + // loop, this will cause it to restart with a new + // layout. + mLayoutNeeded = true; + } } }