diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java index d9835722130f1..02e796904b16a 100644 --- a/services/core/java/com/android/server/wm/TaskDisplayArea.java +++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java @@ -438,6 +438,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; }