Sync focus stack frame and layer with focus app.
Update focus stack frame/layer when focus app is changed to avoid
focus stack/layer isn't updated synchronously with focus app, it's
due to performLayoutAndPlaceSurfacesLocked() is not necessarily
called on focus app change; it will cause sending mismatching
TAP_OUTSIDE_STACK message if there is effectual incoming pointer
event, hence may also result in focus stack is changed again,
therefore erroneous focus app is set by ActivityManager at final.
Change-Id: Ia0ec9a543be887b51a3b29b3e62fdd471c15edf2
Signed-off-by: tingna_sung <tingna_sung@htc.com>
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 837672a..b535722 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -4000,6 +4000,15 @@
if (changed) {
mFocusedApp = newFocus;
mInputMonitor.setFocusedAppLw(newFocus);
+ setFocusedStackFrame();
+ if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setFocusedApp");
+ SurfaceControl.openTransaction();
+ try {
+ setFocusedStackLayer();
+ } finally {
+ SurfaceControl.closeTransaction();
+ if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> CLOSE TRANSACTION setFocusedApp");
+ }
}
if (moveFocusNow && changed) {