Work around for NPE with shell transition

From the stack trace in the bug, the ActivityInfo for some reason is
null when it's passed to PipAppIconOverlay, work around the issue by
checking the variable to unblock the tests while we investigating the
underlying issue.

Bug: 272509531
Test: atest CtsAccessibilityServiceTestCases
Change-Id: I1536a2159aee47afe760908de3fb90c5882feff7
This commit is contained in:
Hongwei Wang
2023-03-10 15:16:33 -08:00
parent 5e46694365
commit dc02781bef

View File

@@ -803,8 +803,15 @@ public class PipTransition extends PipTransitionController {
if (sourceHintRect == null) {
// We use content overlay when there is no source rect hint to enter PiP use bounds
// animation.
// TODO(b/272819817): cleanup the null-check and extra logging.
final boolean hasTopActivityInfo = taskInfo.topActivityInfo != null;
if (!hasTopActivityInfo) {
ProtoLog.w(ShellProtoLogGroup.WM_SHELL_TRANSITIONS,
"%s: TaskInfo.topActivityInfo is null", TAG);
}
if (SystemProperties.getBoolean(
"persist.wm.debug.enable_pip_app_icon_overlay", true)) {
"persist.wm.debug.enable_pip_app_icon_overlay", true)
&& hasTopActivityInfo) {
animator.setAppIconContentOverlay(
mContext, currentBounds, taskInfo.topActivityInfo);
} else {