From 1f1926152734eb9508d8cc2c5ed487027a470579 Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Wed, 20 Apr 2016 16:33:36 -0700 Subject: [PATCH] Exclude IME dialogs from tap outside task bounds funcationality We don't want tapping on these windows to cause a change in app focus. Bug: 28184155 Change-Id: Ibd4ca15b2154c2e83a11f4a2a3edb4356cbfbfed --- .../android/server/wm/WindowManagerService.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 38f12a13e3794..a310729ec1171 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -1805,6 +1805,16 @@ public class WindowManagerService extends IWindowManager.Stub return true; } + private static boolean excludeWindowTypeFromTapOutTask(int windowType) { + switch (windowType) { + case TYPE_STATUS_BAR: + case TYPE_NAVIGATION_BAR: + case TYPE_INPUT_METHOD_DIALOG: + return true; + } + return false; + } + public int addWindow(Session session, IWindow client, int seq, WindowManager.LayoutParams attrs, int viewVisibility, int displayId, Rect outContentInsets, Rect outStableInsets, Rect outOutsets, @@ -2003,7 +2013,7 @@ public class WindowManagerService extends IWindowManager.Stub res = WindowManagerGlobal.ADD_OKAY; - if (type == TYPE_STATUS_BAR || type == TYPE_NAVIGATION_BAR) { + if (excludeWindowTypeFromTapOutTask(type)) { displayContent.mTapExcludedWindows.add(win); } @@ -2395,7 +2405,7 @@ public class WindowManagerService extends IWindowManager.Stub } final int type = win.mAttrs.type; - if (type == TYPE_STATUS_BAR || type == TYPE_NAVIGATION_BAR) { + if (excludeWindowTypeFromTapOutTask(type)) { final DisplayContent displaycontent = win.getDisplayContent(); displaycontent.mTapExcludedWindows.remove(win); }