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
This commit is contained in:
Chavi Weingarten
2023-04-03 19:47:43 +00:00
parent d765772c00
commit ec7100fe88

View File

@@ -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