Fix regression with docking from recents transition
Because we move the task to the front in startRecentsActivity, we always overrode the app transition type. Instead, we should remove this logic and keep a flag whether the animation was prolonging was finished already. If it was finished already, don't start the prolonging when starting the transition. Bug: 27154882 Change-Id: I1cd9e323867726ebd4b131ed5c13c3834d0f1107
This commit is contained in:
@@ -39,6 +39,7 @@ import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpe
|
|||||||
import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation;
|
import static com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation;
|
||||||
import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation;
|
import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation;
|
||||||
import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation;
|
import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation;
|
||||||
|
import static com.android.server.wm.AppWindowAnimator.PROLONG_ANIMATION_AT_START;
|
||||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM;
|
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM;
|
||||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
|
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
|
||||||
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
|
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
|
||||||
@@ -228,6 +229,7 @@ public class AppTransition implements Dump {
|
|||||||
|
|
||||||
private int mLastClipRevealMaxTranslation;
|
private int mLastClipRevealMaxTranslation;
|
||||||
private boolean mLastHadClipReveal;
|
private boolean mLastHadClipReveal;
|
||||||
|
private boolean mProlongedAnimationsEnded;
|
||||||
|
|
||||||
AppTransition(Context context, WindowManagerService service) {
|
AppTransition(Context context, WindowManagerService service) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
@@ -371,6 +373,22 @@ public class AppTransition implements Dump {
|
|||||||
topClosingAppAnimator != null ? topClosingAppAnimator.animation : null);
|
topClosingAppAnimator != null ? topClosingAppAnimator.animation : null);
|
||||||
mService.getDefaultDisplayContentLocked().getDockedDividerController()
|
mService.getDefaultDisplayContentLocked().getDockedDividerController()
|
||||||
.notifyAppTransitionStarting(openingApps, closingApps);
|
.notifyAppTransitionStarting(openingApps, closingApps);
|
||||||
|
|
||||||
|
// Prolong the start for the transition when docking a task from recents, unless recents
|
||||||
|
// ended it already then we don't need to wait.
|
||||||
|
if (mNextAppTransition == TRANSIT_DOCK_TASK_FROM_RECENTS && !mProlongedAnimationsEnded) {
|
||||||
|
for (int i = openingApps.size() - 1; i >= 0; i--) {
|
||||||
|
final AppWindowAnimator appAnimator = openingApps.valueAt(i).mAppAnimator;
|
||||||
|
appAnimator.startProlongAnimation(PROLONG_ANIMATION_AT_START);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Let the transitions manager know that the somebody wanted to end the prolonged animations.
|
||||||
|
*/
|
||||||
|
void notifyProlongedAnimationsEnded() {
|
||||||
|
mProlongedAnimationsEnded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear() {
|
void clear() {
|
||||||
@@ -380,6 +398,7 @@ public class AppTransition implements Dump {
|
|||||||
mNextAppTransitionAnimationsSpecsFuture = null;
|
mNextAppTransitionAnimationsSpecsFuture = null;
|
||||||
mDefaultNextAppTransitionAnimationSpec = null;
|
mDefaultNextAppTransitionAnimationSpec = null;
|
||||||
mAnimationFinishedCallback = null;
|
mAnimationFinishedCallback = null;
|
||||||
|
mProlongedAnimationsEnded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void freeze() {
|
void freeze() {
|
||||||
@@ -1914,14 +1933,6 @@ public class AppTransition implements Dump {
|
|||||||
setAppTransition(transit);
|
setAppTransition(transit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (transit != TRANSIT_DOCK_TASK_FROM_RECENTS
|
|
||||||
&& mNextAppTransition == TRANSIT_DOCK_TASK_FROM_RECENTS) {
|
|
||||||
|
|
||||||
// Somebody is trying to start another transition while we are waiting for the docking
|
|
||||||
// window to be drawn. Because TRANSIT_DOCK_TASK_FROM_RECENTS starts prolonged
|
|
||||||
// animations, we need to override it or our prolonged animations will never be ended.
|
|
||||||
setAppTransition(transit);
|
|
||||||
}
|
|
||||||
boolean prepared = prepare();
|
boolean prepared = prepare();
|
||||||
if (isTransitionSet()) {
|
if (isTransitionSet()) {
|
||||||
mService.mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
|
mService.mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
|
||||||
|
|||||||
@@ -3944,6 +3944,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
appToken.mAppAnimator.endProlongedAnimation();
|
appToken.mAppAnimator.endProlongedAnimation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mAppTransition.notifyProlongedAnimationsEnded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1251,10 +1251,6 @@ class WindowSurfacePlacer {
|
|||||||
if (mService.mAppTransition.isNextAppTransitionThumbnailUp()) {
|
if (mService.mAppTransition.isNextAppTransitionThumbnailUp()) {
|
||||||
createThumbnailAppAnimator(transit, wtoken, topOpeningLayer, topClosingLayer);
|
createThumbnailAppAnimator(transit, wtoken, topOpeningLayer, topClosingLayer);
|
||||||
}
|
}
|
||||||
if (mService.mAppTransition.getAppTransition()
|
|
||||||
== AppTransition.TRANSIT_DOCK_TASK_FROM_RECENTS) {
|
|
||||||
appAnimator.startProlongAnimation(PROLONG_ANIMATION_AT_START);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return topOpeningApp;
|
return topOpeningApp;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user