summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hongwei Wang <hwwang@google.com> 2023-03-10 15:16:33 -0800
committer Hongwei Wang <hwwang@google.com> 2023-03-10 19:58:49 -0800
commitdc02781bef8955585303f5c21a008610fbc9940f (patch)
tree3e7c94aa2a0c5cc05a8d8bb4b96862b3a181136f
parent5e46694365000a57024b99223b929aa9a9263511 (diff)
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
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
index 7234b15bf6d2..e01b406eb4c1 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
@@ -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 {