From 602d232a69055bd6d11b147621c23e724ac39235 Mon Sep 17 00:00:00 2001 From: "jorgegil@google.com" Date: Mon, 29 Mar 2021 17:20:21 -0700 Subject: [PATCH] Check that the PiPParams are not null before getting seamless flag Fixes NPE when the PIP params are not specified by the app Bug: 183140098 Test: Enter PIP and resize without PIP params Change-Id: I1c38586fbcea0a3141ef6cdfc3881f62dbc9148f --- .../Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java | 1 + 1 file changed, 1 insertion(+) 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 fa31a0a4e5162..186e335189f3e 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 @@ -946,6 +946,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener, || direction == TRANSITION_DIRECTION_EXPAND_OR_UNEXPAND; // Animate with a cross-fade if enabled and seamless resize is disables by the app. final boolean animateCrossFadeResize = mayAnimateFinishResize + && mPictureInPictureParams != null && !mPictureInPictureParams.isSeamlessResizeEnabled(); if (animateCrossFadeResize) { // Take a snapshot of the PIP task and hide it. We'll show it and fade it out after