diff options
| author | 2022-07-28 10:33:46 +0000 | |
|---|---|---|
| committer | 2022-07-28 10:33:46 +0000 | |
| commit | b14c95da7a753497e4419c96b2bb3dc42a4d3562 (patch) | |
| tree | 1293ff9da1d24622abf4eb26c21572813b33a76d | |
| parent | 224306180e788662468a226f4ae4633d489a7444 (diff) | |
| parent | 36c5f0c16ca9b4ad37eaccf454ef158a4bbf73ef (diff) | |
Merge "Revert "Don't notify animation finished if no animation"" into tm-qpr-dev
3 files changed, 20 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index a044e60b40ae..ed32a7d7f778 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -5343,7 +5343,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_WINDOW_ANIMATION | ANIMATION_TYPE_RECENTS); if (!delayed) { + // We aren't delayed anything, but exiting windows rely on the animation finished + // callback being called in case the ActivityRecord was pretending to be delayed, + // which we might have done because we were in closing/opening apps list. if (!usingShellTransitions) { + onAnimationFinished(ANIMATION_TYPE_APP_TRANSITION, null /* AnimationAdapter */); if (visible) { // The token was made immediately visible, there will be no entrance animation. // We need to inform the client the enter animation was finished. diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java index 3f3d01a14f80..0c3b270518cf 100644 --- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java @@ -49,6 +49,7 @@ import static android.os.InputConstants.DEFAULT_DISPATCHING_TIMEOUT_MILLIS; import static android.os.Process.NOBODY_UID; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.InsetsState.ITYPE_IME; +import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW; import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW; import static android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD; @@ -2538,6 +2539,21 @@ public class ActivityRecordTests extends WindowTestsBase { } @Test + public void testStuckExitingWindow() { + final WindowState closingWindow = createWindow(null, FIRST_APPLICATION_WINDOW, + "closingWindow"); + closingWindow.mAnimatingExit = true; + closingWindow.mRemoveOnExit = true; + closingWindow.mActivityRecord.commitVisibility( + false /* visible */, true /* performLayout */); + + // We pretended that we were running an exit animation, but that should have been cleared up + // by changing visibility of ActivityRecord + closingWindow.removeIfPossible(); + assertTrue(closingWindow.mRemoved); + } + + @Test public void testSetOrientation() { final ActivityRecord activity = new ActivityBuilder(mAtm).setCreateTask(true).build(); activity.setVisible(true); @@ -3133,7 +3149,6 @@ public class ActivityRecordTests extends WindowTestsBase { mDisplayContent.mOpeningApps.clear(); app.mActivityRecord.commitVisibility(false, false); app.mActivityRecord.onWindowsGone(); - mDisplayContent.computeImeTargetIfNeeded(app.mActivityRecord); assertTrue(app.mActivityRecord.mLastImeShown); assertTrue(app.mActivityRecord.mImeInsetsFrozenUntilStartInput); diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java index 446ec8b2680b..cfc0da7a4a15 100644 --- a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java @@ -1003,7 +1003,6 @@ public class WindowStateTests extends WindowTestsBase { assertTrue(app.mActivityRecord.mImeInsetsFrozenUntilStartInput); // Verify the IME insets is visible on app, but not for app2 during app task switching. - mDisplayContent.computeImeTargetIfNeeded(app.mActivityRecord); assertTrue(app.getInsetsState().getSource(ITYPE_IME).isVisible()); assertFalse(app2.getInsetsState().getSource(ITYPE_IME).isVisible()); } |