From a9c4127ece9e72093685f33df9617b41d834ba03 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 14 Aug 2017 16:44:20 -0700 Subject: [PATCH] Add fallback to reset the waiting for transition state. - When launching into recents directly in another orientation, it appears that the animation start callback is not made, which then causes the transition-waiting state to persist until Overview is next hidden. As a fallback, if we get onEnterAnimationComplete() on the activity, then the animation has started and completed, so we can reset the state. Bug: 64694148 Test: Launch fixed-portrait app, hold device in landscape and then hit recents button, ensure that recents button still works after. Change-Id: Ibac8554c1f71324838fef1f04db2d88b16ffe219 --- .../src/com/android/systemui/recents/RecentsActivity.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index c0550b5c52e67..387527f95033a 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -69,6 +69,7 @@ import com.android.systemui.recents.events.activity.ToggleRecentsEvent; import com.android.systemui.recents.events.component.ActivityUnpinnedEvent; import com.android.systemui.recents.events.component.RecentsVisibilityChangedEvent; import com.android.systemui.recents.events.component.ScreenPinningRequestEvent; +import com.android.systemui.recents.events.component.SetWaitingForTransitionStartEvent; import com.android.systemui.recents.events.ui.AllTaskViewsDismissedEvent; import com.android.systemui.recents.events.ui.DeleteTaskDataEvent; import com.android.systemui.recents.events.ui.HideIncompatibleAppOverlayEvent; @@ -502,6 +503,11 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD public void onEnterAnimationComplete() { super.onEnterAnimationComplete(); EventBus.getDefault().send(new EnterRecentsWindowAnimationCompletedEvent()); + + // Workaround for b/64694148: The animation started callback is not made (see + // RecentsImpl.getThumbnailTransitionActivityOptions) so reset the transition-waiting state + // once the enter animation has completed. + EventBus.getDefault().send(new SetWaitingForTransitionStartEvent(false)); } @Override