summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Maryam Dehaini <mdehaini@google.com> 2025-03-13 12:32:41 -0700
committer Maryam Dehaini <mdehaini@google.com> 2025-03-13 12:32:41 -0700
commit541d78c7deaa71a570f59593b01aa28ac13d674d (patch)
treed20df1b3359542a2a7bd70a396ab731446afedfc
parentea570188db97aa76c2cd001db4555a421c9a7c96 (diff)
Add null check for view holder before closing
NullPointerExceptions thrown in tests when attempting to close a null view holder in DesktopModeWindowDecoration#close Bug: 403310239 Flag: com.android.window.flags.enable_desktop_windowing_mode Test: run test Change-Id: If28aa3e0e193efd50d840a5190917e825d264222
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
index bcf9396ff0c1..989550c60c0d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
@@ -1756,8 +1756,10 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
mExclusionRegionListener.onExclusionRegionDismissed(mTaskInfo.taskId);
disposeResizeVeil();
disposeStatusBarInputLayer();
- mWindowDecorViewHolder.close();
- mWindowDecorViewHolder = null;
+ if (mWindowDecorViewHolder != null) {
+ mWindowDecorViewHolder.close();
+ mWindowDecorViewHolder = null;
+ }
if (canEnterDesktopMode(mContext) && isEducationEnabled()) {
notifyNoCaptionHandle();
}