From 558947c9899627067d632e8a6365f77a35f433e1 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Fri, 18 Dec 2009 16:02:50 -0800 Subject: [PATCH] Issue #2335763: Cant dial emergency number on my device This may fix the issue, but we have no repro steps so no way to make sure. What appeared to be going on was that the emergency dialer was created, but still had the starting preview window above it. We were stuck in this state because the preview window didn't have the "hide lock screen" flag set, so the lock screen would never be removed, and thus we would never take care of finishing the show of the emergency dialer (because it was not visible) and thus not remove the starting window. The solution here is to simply propagate the lock flags up to the starting window. Change-Id: I6da9f6494537f0661d9d230664ebf745c293ea7d --- .../com/android/server/WindowManagerService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index 3180a17e2db54..e312df6cca20a 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -2378,6 +2378,18 @@ public class WindowManagerService extends IWindowManager.Stub mInputMethodWindow = win; imMayMove = true; } + if (win.mAttrs.type == TYPE_BASE_APPLICATION + && win.mAppToken != null + && win.mAppToken.startingWindow != null) { + // Special handling of starting window over the base + // window of the app: propagate lock screen flags to it, + // to provide the correct semantics while starting. + final int mask = + WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED + | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD; + WindowManager.LayoutParams sa = win.mAppToken.startingWindow.mAttrs; + sa.flags = (sa.flags&~mask) | (win.mAttrs.flags&mask); + } } else { win.mEnterAnimationPending = false; if (win.mSurface != null) {