Merge "Don't notify animation finished if no animation" into tm-qpr-dev am: 372871be49

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19149189

Change-Id: Ic2129979e024903dc3f623a91df60f3e2c382de2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Riddle Hsu
2022-07-07 12:58:50 +00:00
committed by Automerger Merge Worker
3 changed files with 2 additions and 20 deletions

View File

@@ -5338,11 +5338,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_WINDOW_ANIMATION ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_WINDOW_ANIMATION
| ANIMATION_TYPE_RECENTS); | ANIMATION_TYPE_RECENTS);
if (!delayed) { 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) { if (!usingShellTransitions) {
onAnimationFinished(ANIMATION_TYPE_APP_TRANSITION, null /* AnimationAdapter */);
if (visible) { if (visible) {
// The token was made immediately visible, there will be no entrance animation. // The token was made immediately visible, there will be no entrance animation.
// We need to inform the client the enter animation was finished. // We need to inform the client the enter animation was finished.

View File

@@ -49,7 +49,6 @@ import static android.os.InputConstants.DEFAULT_DISPATCHING_TIMEOUT_MILLIS;
import static android.os.Process.NOBODY_UID; import static android.os.Process.NOBODY_UID;
import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.InsetsState.ITYPE_IME; 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.FIRST_SUB_WINDOW;
import static android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; import static android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD; import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
@@ -2538,21 +2537,6 @@ public class ActivityRecordTests extends WindowTestsBase {
|| activity.containsDismissKeyguardWindow()); || activity.containsDismissKeyguardWindow());
} }
@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 @Test
public void testSetOrientation() { public void testSetOrientation() {
final ActivityRecord activity = new ActivityBuilder(mAtm).setCreateTask(true).build(); final ActivityRecord activity = new ActivityBuilder(mAtm).setCreateTask(true).build();
@@ -3149,6 +3133,7 @@ public class ActivityRecordTests extends WindowTestsBase {
mDisplayContent.mOpeningApps.clear(); mDisplayContent.mOpeningApps.clear();
app.mActivityRecord.commitVisibility(false, false); app.mActivityRecord.commitVisibility(false, false);
app.mActivityRecord.onWindowsGone(); app.mActivityRecord.onWindowsGone();
mDisplayContent.computeImeTargetIfNeeded(app.mActivityRecord);
assertTrue(app.mActivityRecord.mLastImeShown); assertTrue(app.mActivityRecord.mLastImeShown);
assertTrue(app.mActivityRecord.mImeInsetsFrozenUntilStartInput); assertTrue(app.mActivityRecord.mImeInsetsFrozenUntilStartInput);

View File

@@ -1003,6 +1003,7 @@ public class WindowStateTests extends WindowTestsBase {
assertTrue(app.mActivityRecord.mImeInsetsFrozenUntilStartInput); assertTrue(app.mActivityRecord.mImeInsetsFrozenUntilStartInput);
// Verify the IME insets is visible on app, but not for app2 during app task switching. // 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()); assertTrue(app.getInsetsState().getSource(ITYPE_IME).isVisible());
assertFalse(app2.getInsetsState().getSource(ITYPE_IME).isVisible()); assertFalse(app2.getInsetsState().getSource(ITYPE_IME).isVisible());
} }