From 8f85358fe4bab8ac3ca0b77905d51725a531a436 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Mon, 5 Jun 2017 17:25:59 -0700 Subject: [PATCH] Associate freezing display with a target display id. Currently, start/stop freezing is always associated with the default display. As a result, any animations that result from freezing will occur on the default display. One situation this happens is during a configuration change, where a screen rotation can be triggered. In the case of adding a secondary display, a configuration change is always triggered to apply the override configuration at the display level. As a result, the default display exhibits a rotation animation upon unfreezing during surface placement. This changelist passes down the display id associated with the action so that the animations may be applied to the right display. In the scenario described perviously, the secondary display id is passed down and therefore is the target of the rotation animation during unfreezing. Fixes: 35486733 Test: go/wm-smoke Test: cts-tradefed run singleCommand cts-dev --module CtsViewTestCases --test android.view.cts.SurfaceViewSyncTest#testSmallRect Change-Id: I87e56f5901934327fc50b3c7e543b5e36b8ff34f --- .../com/android/server/wm/AppWindowToken.java | 2 +- .../com/android/server/wm/DisplayContent.java | 2 +- .../server/wm/WindowManagerService.java | 38 ++++++++++++++----- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java index 525e0ff1e8ddb..71ecaf61da485 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -1107,7 +1107,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree mAppAnimator.lastFreezeDuration = 0; mService.mAppsFreezingScreen++; if (mService.mAppsFreezingScreen == 1) { - mService.startFreezingDisplayLocked(false, 0, 0); + mService.startFreezingDisplayLocked(false, 0, 0, getDisplayContent()); mService.mH.removeMessages(H.APP_FREEZE_TIMEOUT); mService.mH.sendEmptyMessageDelayed(H.APP_FREEZE_TIMEOUT, 2000); } diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index eef4c9b0f4a07..a8e0d761afc39 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -987,7 +987,7 @@ class DisplayContent extends WindowContainer