Merge "Remove Activity if it enters PiP without window" into rvc-dev am: 81224e6f76 am: d6a9b8078a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21564420

Change-Id: I208a16f400a8e34c28fb9d9805c1cf6646e6d973
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Hongwei Wang
2023-03-04 06:31:41 +00:00
committed by Automerger Merge Worker

View File

@@ -1294,6 +1294,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
ensureActivityConfiguration(0 /* globalChanges */, PRESERVE_WINDOWS,
true /* ignoreVisibility */);
if (inPictureInPictureMode && findMainWindow() == null) {
// Prevent malicious app entering PiP without valid WindowState, which can in turn
// result a non-touchable PiP window since the InputConsumer for PiP requires it.
EventLog.writeEvent(0x534e4554, "265293293", -1, "");
removeImmediately();
}
}
}