From 73c3fcf576e3df3fc503788fc118d82d39e89f02 Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Thu, 5 Nov 2015 13:18:33 -0800 Subject: [PATCH] Exclude system decor area from tap detection. If we have system decor (status bar/ navigation bar), we want to exclude that from the tap detection. Otherwise, if the app is partially placed under some system button (eg. Recents, Home), pressing that button would cause a full series of unwanted transfer focus/resume/pause, before we could go home. Change-Id: Idd408bd69f5064f906bb9f8e2b2385c26a6a6929 --- services/core/java/com/android/server/wm/DisplayContent.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 53f8bbd9084b..8482c29e5eda 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -373,6 +373,12 @@ class DisplayContent { */ if (isFreeformed) { mTmpRect.inset(-delta, -delta); + // Intersect with display content rect. If we have system decor (status bar/ + // navigation bar), we want to exclude that from the tap detection. + // Otherwise, if the app is partially placed under some system button (eg. + // Recents, Home), pressing that button would cause a full series of + // unwanted transfer focus/resume/pause, before we could go home. + mTmpRect.intersect(mContentRect); } mTouchExcludeRegion.op(mTmpRect, Region.Op.DIFFERENCE); } -- 2.11.0