diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java index dd1b50fc5e0bc..ca91a742786a0 100644 --- a/services/core/java/com/android/server/wm/TaskDisplayArea.java +++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java @@ -451,6 +451,14 @@ final class TaskDisplayArea extends DisplayArea { if (!toTop) { if (t.mTaskId == mLastLeafTaskToFrontId) { mLastLeafTaskToFrontId = INVALID_TASK_ID; + + // If the previous front-most task is moved to the back, then notify of the new + // front-most task. + final ActivityRecord topMost = getTopMostActivity(); + if (topMost != null) { + mAtmService.getTaskChangeNotificationController().notifyTaskMovedToFront( + topMost.getTask().getTaskInfo()); + } } return; }