diff options
author | Craig Mautner <cmautner@google.com> | 2014-11-11 09:03:59 -0800 |
---|---|---|
committer | Craig Mautner <cmautner@google.com> | 2014-11-11 16:22:56 -0800 |
commit | c08eab81f30a3120ec0929d3508b4a78d498e1ff (patch) | |
tree | 67a1fc7bdf7f411909af863958830d27dca33d8d | |
parent | 147de3a9766e205af068d1462beaea7a4a9fb9bc (diff) | |
download | frameworks_base-c08eab81f30a3120ec0929d3508b4a78d498e1ff.zip frameworks_base-c08eab81f30a3120ec0929d3508b4a78d498e1ff.tar.gz frameworks_base-c08eab81f30a3120ec0929d3508b4a78d498e1ff.tar.bz2 |
Show error dialogs over apps that dismiss keyguard
Error dialogs absorb all input to ensure that they are not missed.
This can cause the screen to lock up if they are not displayed but
are still absorbing touches. This was what was happening when there
was an error dialog up at the same time as a phone call came in as
in b/17648830.
This fix recognizes when an app is dismissing the keyguard and
forces any error dialogs to be shown over such an app.
This also removes the private flags from the input system as they
are no longer needed.
Fixes bug 17648830.
Change-Id: I5c98b8265a1448b445fdb2f745fc78892f8656a4
7 files changed, 11 insertions, 21 deletions
diff --git a/services/core/java/com/android/server/input/InputWindowHandle.java b/services/core/java/com/android/server/input/InputWindowHandle.java index 9a70f38..9149fcc 100644 --- a/services/core/java/com/android/server/input/InputWindowHandle.java +++ b/services/core/java/com/android/server/input/InputWindowHandle.java @@ -44,7 +44,6 @@ public final class InputWindowHandle { // Window layout params attributes. (WindowManager.LayoutParams) public int layoutParamsFlags; - public int layoutParamsPrivateFlags; public int layoutParamsType; // Dispatching timeout. diff --git a/services/core/java/com/android/server/wm/DragState.java b/services/core/java/com/android/server/wm/DragState.java index edc7c93..c6951bd 100644 --- a/services/core/java/com/android/server/wm/DragState.java +++ b/services/core/java/com/android/server/wm/DragState.java @@ -114,7 +114,6 @@ class DragState { mDragWindowHandle.inputChannel = mServerChannel; mDragWindowHandle.layer = getDragLayerLw(); mDragWindowHandle.layoutParamsFlags = 0; - mDragWindowHandle.layoutParamsPrivateFlags = 0; mDragWindowHandle.layoutParamsType = WindowManager.LayoutParams.TYPE_DRAG; mDragWindowHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; diff --git a/services/core/java/com/android/server/wm/FakeWindowImpl.java b/services/core/java/com/android/server/wm/FakeWindowImpl.java index c18ea01..1136ced 100644 --- a/services/core/java/com/android/server/wm/FakeWindowImpl.java +++ b/services/core/java/com/android/server/wm/FakeWindowImpl.java @@ -38,7 +38,7 @@ public final class FakeWindowImpl implements WindowManagerPolicy.FakeWindow { public FakeWindowImpl(WindowManagerService service, Looper looper, InputEventReceiver.Factory inputEventReceiverFactory, - String name, int windowType, int layoutParamsFlags, int layoutParamsPrivateFlags, + String name, int windowType, int layoutParamsFlags, boolean canReceiveKeys, boolean hasFocus, boolean touchFullscreen) { mService = service; @@ -61,7 +61,6 @@ public final class FakeWindowImpl implements WindowManagerPolicy.FakeWindow { mWindowLayer = getLayerLw(windowType); mWindowHandle.layer = mWindowLayer; mWindowHandle.layoutParamsFlags = layoutParamsFlags; - mWindowHandle.layoutParamsPrivateFlags = layoutParamsPrivateFlags; mWindowHandle.layoutParamsType = windowType; mWindowHandle.dispatchingTimeoutNanos = WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; diff --git a/services/core/java/com/android/server/wm/InputMonitor.java b/services/core/java/com/android/server/wm/InputMonitor.java index 46aefb6..0327cb3 100644 --- a/services/core/java/com/android/server/wm/InputMonitor.java +++ b/services/core/java/com/android/server/wm/InputMonitor.java @@ -168,8 +168,8 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { } private void addInputWindowHandleLw(final InputWindowHandle inputWindowHandle, - final WindowState child, int flags, int privateFlags, final int type, - final boolean isVisible, final boolean hasFocus, final boolean hasWallpaper) { + final WindowState child, int flags, final int type, final boolean isVisible, + final boolean hasFocus, final boolean hasWallpaper) { // Add a window to our list of input windows. inputWindowHandle.name = child.toString(); final boolean modal = (flags & (WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL @@ -184,7 +184,6 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { child.getTouchableRegion(inputWindowHandle.touchableRegion); } inputWindowHandle.layoutParamsFlags = flags; - inputWindowHandle.layoutParamsPrivateFlags = privateFlags; inputWindowHandle.layoutParamsType = type; inputWindowHandle.dispatchingTimeoutNanos = child.getInputDispatchingTimeoutNanos(); inputWindowHandle.visible = isVisible; @@ -298,15 +297,14 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks { final WindowState u = universeBackground.mWin; if (u.mInputChannel != null && u.mInputWindowHandle != null) { addInputWindowHandleLw(u.mInputWindowHandle, u, u.mAttrs.flags, - u.mAttrs.privateFlags, u.mAttrs.type, - true, u == mInputFocus, false); + u.mAttrs.type, true, u == mInputFocus, false); } addedUniverse = true; } if (child.mWinAnimator != universeBackground) { - addInputWindowHandleLw(inputWindowHandle, child, flags, privateFlags, type, - isVisible, hasFocus, hasWallpaper); + addInputWindowHandleLw(inputWindowHandle, child, flags, type, isVisible, + hasFocus, hasWallpaper); } } } diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java index c002ddf..82e4bb1 100644 --- a/services/core/java/com/android/server/wm/WindowAnimator.java +++ b/services/core/java/com/android/server/wm/WindowAnimator.java @@ -20,6 +20,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD; +import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_SYSTEM_ERROR; import static com.android.server.wm.WindowManagerService.DEBUG_KEYGUARD; import static com.android.server.wm.WindowManagerService.LayoutFields.SET_UPDATE_ROTATION; import static com.android.server.wm.WindowManagerService.LayoutFields.SET_WALLPAPER_MAY_CHANGE; @@ -330,7 +331,9 @@ public class WindowAnimator { + " anim=" + win.mWinAnimator.mAnimation); } else if (mPolicy.canBeForceHidden(win, win.mAttrs)) { final boolean hideWhenLocked = !((win.mIsImWindow && showImeOverKeyguard) || - (appShowWhenLocked != null && appShowWhenLocked == win.mAppToken)); + (appShowWhenLocked != null && (appShowWhenLocked == win.mAppToken || + // Show error dialogs over apps that dismiss keyguard. + (win.mAttrs.privateFlags & PRIVATE_FLAG_SYSTEM_ERROR) != 0))); if (((mForceHiding == KEYGUARD_ANIMATING_IN) && (!winAnimator.isAnimating() || hideWhenLocked)) || ((mForceHiding == KEYGUARD_SHOWN) && hideWhenLocked)) { diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 318ff0e..6cb1e4a 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -10791,9 +10791,7 @@ public class WindowManagerService extends IWindowManager.Stub boolean canReceiveKeys, boolean hasFocus, boolean touchFullscreen) { synchronized (mWindowMap) { FakeWindowImpl fw = new FakeWindowImpl(this, looper, inputEventReceiverFactory, - name, windowType, - layoutParamsFlags, layoutParamsPrivateFlags, canReceiveKeys, - hasFocus, touchFullscreen); + name, windowType, layoutParamsFlags, canReceiveKeys, hasFocus, touchFullscreen); int i=0; while (i<mFakeWindows.size()) { if (mFakeWindows.get(i).mWindowLayer <= fw.mWindowLayer) { diff --git a/services/core/jni/com_android_server_input_InputWindowHandle.cpp b/services/core/jni/com_android_server_input_InputWindowHandle.cpp index 03bf7eb..46ec1f4 100644 --- a/services/core/jni/com_android_server_input_InputWindowHandle.cpp +++ b/services/core/jni/com_android_server_input_InputWindowHandle.cpp @@ -36,7 +36,6 @@ static struct { jfieldID inputChannel; jfieldID name; jfieldID layoutParamsFlags; - jfieldID layoutParamsPrivateFlags; jfieldID layoutParamsType; jfieldID dispatchingTimeoutNanos; jfieldID frameLeft; @@ -113,8 +112,6 @@ bool NativeInputWindowHandle::updateInfo() { mInfo->layoutParamsFlags = env->GetIntField(obj, gInputWindowHandleClassInfo.layoutParamsFlags); - mInfo->layoutParamsPrivateFlags = env->GetIntField(obj, - gInputWindowHandleClassInfo.layoutParamsPrivateFlags); mInfo->layoutParamsType = env->GetIntField(obj, gInputWindowHandleClassInfo.layoutParamsType); mInfo->dispatchingTimeout = env->GetLongField(obj, @@ -251,9 +248,6 @@ int register_android_server_InputWindowHandle(JNIEnv* env) { GET_FIELD_ID(gInputWindowHandleClassInfo.layoutParamsFlags, clazz, "layoutParamsFlags", "I"); - GET_FIELD_ID(gInputWindowHandleClassInfo.layoutParamsPrivateFlags, clazz, - "layoutParamsPrivateFlags", "I"); - GET_FIELD_ID(gInputWindowHandleClassInfo.layoutParamsType, clazz, "layoutParamsType", "I"); |