From ec7100fe88a7381f1180c4914d06cdac3778bbb6 Mon Sep 17 00:00:00 2001 From: Chavi Weingarten Date: Mon, 3 Apr 2023 19:47:43 +0000 Subject: [PATCH] Fix tap outside focus for SCVH from different process. When granting embedded window focus due to a tap, send a null WindowSession. This is because it's not necessary for the host and the embedded to be in the same process. So when WMS looks up the host window, it doesn't need to check that the embedded session matches the hsot session. WMS is already providing the correct host window token for the embedded window so the additional check is not needed. Test: SurfaceControlViewHostTests Bug: 230340812 Change-Id: I9bb11a4d5283ee3e3fa5ac9972630dbaefff921f --- .../java/com/android/server/wm/EmbeddedWindowController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/EmbeddedWindowController.java b/services/core/java/com/android/server/wm/EmbeddedWindowController.java index d65f464590c17..44d67687e2604 100644 --- a/services/core/java/com/android/server/wm/EmbeddedWindowController.java +++ b/services/core/java/com/android/server/wm/EmbeddedWindowController.java @@ -292,7 +292,9 @@ class EmbeddedWindowController { private void handleTap(boolean grantFocus) { if (mInputChannel != null) { if (mHostWindowState != null) { - mWmService.grantEmbeddedWindowFocus(mSession, mHostWindowState.mClient, + // Use null session since this is being granted by system server and doesn't + // require the host session to be passed in + mWmService.grantEmbeddedWindowFocus(null, mHostWindowState.mClient, mFocusGrantToken, grantFocus); if (grantFocus) { // If granting focus to the embedded when tapped, we need to ensure the host