diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/Task.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 728f739f9f8d..eee282122792 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -2790,11 +2790,15 @@ class Task extends TaskFragment { @Override void onDisplayChanged(DisplayContent dc) { + final int lastDisplayId = getDisplayId(); super.onDisplayChanged(dc); if (isLeafTask()) { final int displayId = (dc != null) ? dc.getDisplayId() : INVALID_DISPLAY; - mWmService.mAtmService.getTaskChangeNotificationController().notifyTaskDisplayChanged( - mTaskId, displayId); + //Send the callback when the task reparented to another display. + if (lastDisplayId != displayId) { + mWmService.mAtmService.getTaskChangeNotificationController() + .notifyTaskDisplayChanged(mTaskId, displayId); + } } if (isRootTask()) { updateSurfaceBounds(); |