commit | 4c4b7ef959aebf91871bb006c2605664de86c7fb | [log] [tgz] |
---|---|---|
author | Hongwei Wang <hwwang@google.com> | Mon May 30 17:29:55 2022 -0700 |
committer | Jinfeng Du <jinfengdu@google.com> | Tue May 31 10:40:53 2022 +0000 |
tree | 1383b4e3b74e0f5aeddc3d61290b0862c0842fc3 | |
parent | d59d17d74a8fe4addaedd2fe31bf2329bc0136c3 [diff] |
Validate content overlay before removal Bug: 234158920 Test: atest --iteration 20 --no-bazel-mode \ PinnedStackTests#testLaunchTaskByAffinityMatchSingleTask Change-Id: I1ed848fcd742443a23ecaa17ba6b4fb8cdb061e2
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 c05654a..e624de6 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
@@ -1600,6 +1600,11 @@ // Avoid double removal, which is fatal. return; } + if (surface == null || !surface.isValid()) { + ProtoLog.w(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE, + "%s: trying to remove invalid content overlay (%s)", TAG, surface); + return; + } final SurfaceControl.Transaction tx = mSurfaceControlTransactionFactory.getTransaction(); tx.remove(surface); tx.apply();