summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mateusz Cicheński <mateuszc@google.com> 2023-04-20 05:27:11 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-04-20 05:27:11 +0000
commit754fb0b4b9416646ad09e08a3c3604a2861ccfb1 (patch)
tree3542f7175cc597bc8187f2e43cc1239c4cadbe7e
parentb7985fbaa5a696e49e93aca118d211e97de7629f (diff)
parent896a91b764150e112a5395323f2deb79f81fa67d (diff)
Merge "Fix NPE when setting icon overlay in PipTaskOrganizer" into udc-dev
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
index b6216b340b38..566c130c7573 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
@@ -1690,8 +1690,17 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
// Similar to auto-enter-pip transition, we use content overlay when there is no
// source rect hint to enter PiP use bounds animation.
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 = mTaskInfo.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, mTaskInfo.topActivityInfo,
mPipBoundsState.getLauncherState().getAppIconSizePx());