From 80f80dbbdd394a2a1103d89a6b081261c0907274 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 30 May 2018 21:13:25 -0700 Subject: [PATCH] Skip task overlay in calcuating task description - When a PiP task is dismissed with the PiP menu activity showing, we use the wrong task description (belonging to the menu activity) to draw the app theme snapshot. The task overlay is only used from SysUI to overlay an activity on top of the task, and should not be considered in the calculation for the task description for the task. Bug: 77964409 Test: Manual, launch Maps in PiP, dismiss and then open overview Change-Id: I2d537b9fdd19eb69a8dc20f15ac5b263584d2fad --- services/core/java/com/android/server/am/TaskRecord.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java index 9a5b1a60219ea..d3ac7cb158244 100644 --- a/services/core/java/com/android/server/am/TaskRecord.java +++ b/services/core/java/com/android/server/am/TaskRecord.java @@ -1606,6 +1606,9 @@ class TaskRecord extends ConfigurationContainer implements TaskWindowContainerLi boolean topActivity = true; for (--activityNdx; activityNdx >= 0; --activityNdx) { final ActivityRecord r = mActivities.get(activityNdx); + if (r.mTaskOverlay) { + continue; + } if (r.taskDescription != null) { if (label == null) { label = r.taskDescription.getLabel();