Merge "Skip launcher animation when top window is already animating." into tm-qpr-dev am: e9ff71ec1b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18411178 Change-Id: Idc44de6f2ce31e72755af4c588fa9944368d4c72 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -403,7 +403,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
|
|||||||
private boolean shouldDispatchToLauncher(int backType) {
|
private boolean shouldDispatchToLauncher(int backType) {
|
||||||
return backType == BackNavigationInfo.TYPE_RETURN_TO_HOME
|
return backType == BackNavigationInfo.TYPE_RETURN_TO_HOME
|
||||||
&& mBackToLauncherCallback != null
|
&& mBackToLauncherCallback != null
|
||||||
&& mEnableAnimations.get();
|
&& mEnableAnimations.get()
|
||||||
|
&& mBackNavigationInfo != null
|
||||||
|
&& mBackNavigationInfo.getDepartingAnimationTarget() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void dispatchOnBackStarted(IOnBackInvokedCallback callback) {
|
private static void dispatchOnBackStarted(IOnBackInvokedCallback callback) {
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ class BackNavigationController {
|
|||||||
RemoteAnimationTarget topAppTarget = null;
|
RemoteAnimationTarget topAppTarget = null;
|
||||||
int prevTaskId;
|
int prevTaskId;
|
||||||
int prevUserId;
|
int prevUserId;
|
||||||
|
boolean prepareAnimation;
|
||||||
|
|
||||||
BackNavigationInfo.Builder infoBuilder = new BackNavigationInfo.Builder();
|
BackNavigationInfo.Builder infoBuilder = new BackNavigationInfo.Builder();
|
||||||
synchronized (wmService.mGlobalLock) {
|
synchronized (wmService.mGlobalLock) {
|
||||||
@@ -257,7 +258,8 @@ class BackNavigationController {
|
|||||||
BackNavigationInfo.typeToString(backType));
|
BackNavigationInfo.typeToString(backType));
|
||||||
|
|
||||||
// For now, we only animate when going home.
|
// For now, we only animate when going home.
|
||||||
boolean prepareAnimation = backType == BackNavigationInfo.TYPE_RETURN_TO_HOME
|
prepareAnimation = backType == BackNavigationInfo.TYPE_RETURN_TO_HOME
|
||||||
|
&& requestAnimation
|
||||||
// Only create a new leash if no leash has been created.
|
// Only create a new leash if no leash has been created.
|
||||||
// Otherwise return null for animation target to avoid conflict.
|
// Otherwise return null for animation target to avoid conflict.
|
||||||
&& !removedWindowContainer.hasCommittedReparentToAnimationLeash();
|
&& !removedWindowContainer.hasCommittedReparentToAnimationLeash();
|
||||||
@@ -292,7 +294,7 @@ class BackNavigationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Special handling for back to home animation
|
// Special handling for back to home animation
|
||||||
if (backType == BackNavigationInfo.TYPE_RETURN_TO_HOME && requestAnimation
|
if (backType == BackNavigationInfo.TYPE_RETURN_TO_HOME && prepareAnimation
|
||||||
&& prevTask != null) {
|
&& prevTask != null) {
|
||||||
currentTask.mBackGestureStarted = true;
|
currentTask.mBackGestureStarted = true;
|
||||||
// Make launcher show from behind by marking its top activity as visible and
|
// Make launcher show from behind by marking its top activity as visible and
|
||||||
@@ -347,7 +349,7 @@ class BackNavigationController {
|
|||||||
Task finalTask = currentTask;
|
Task finalTask = currentTask;
|
||||||
RemoteCallback onBackNavigationDone = new RemoteCallback(result -> onBackNavigationDone(
|
RemoteCallback onBackNavigationDone = new RemoteCallback(result -> onBackNavigationDone(
|
||||||
result, finalRemovedWindowContainer, finalBackType, finalTask,
|
result, finalRemovedWindowContainer, finalBackType, finalTask,
|
||||||
finalprevActivity, requestAnimation));
|
finalprevActivity, prepareAnimation));
|
||||||
infoBuilder.setOnBackNavigationDone(onBackNavigationDone);
|
infoBuilder.setOnBackNavigationDone(onBackNavigationDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,14 +383,14 @@ class BackNavigationController {
|
|||||||
|
|
||||||
private void onBackNavigationDone(
|
private void onBackNavigationDone(
|
||||||
Bundle result, WindowContainer<?> windowContainer, int backType,
|
Bundle result, WindowContainer<?> windowContainer, int backType,
|
||||||
Task task, ActivityRecord prevActivity, boolean requestAnimation) {
|
Task task, ActivityRecord prevActivity, boolean prepareAnimation) {
|
||||||
SurfaceControl surfaceControl = windowContainer.getSurfaceControl();
|
SurfaceControl surfaceControl = windowContainer.getSurfaceControl();
|
||||||
boolean triggerBack = result != null && result.getBoolean(
|
boolean triggerBack = result != null && result.getBoolean(
|
||||||
BackNavigationInfo.KEY_TRIGGER_BACK);
|
BackNavigationInfo.KEY_TRIGGER_BACK);
|
||||||
ProtoLog.d(WM_DEBUG_BACK_PREVIEW, "onBackNavigationDone backType=%s, "
|
ProtoLog.d(WM_DEBUG_BACK_PREVIEW, "onBackNavigationDone backType=%s, "
|
||||||
+ "task=%s, prevActivity=%s", backType, task, prevActivity);
|
+ "task=%s, prevActivity=%s", backType, task, prevActivity);
|
||||||
|
|
||||||
if (backType == BackNavigationInfo.TYPE_RETURN_TO_HOME && requestAnimation) {
|
if (backType == BackNavigationInfo.TYPE_RETURN_TO_HOME && prepareAnimation) {
|
||||||
if (triggerBack) {
|
if (triggerBack) {
|
||||||
if (surfaceControl != null && surfaceControl.isValid()) {
|
if (surfaceControl != null && surfaceControl.isValid()) {
|
||||||
// When going back to home, hide the task surface before it is re-parented to
|
// When going back to home, hide the task surface before it is re-parented to
|
||||||
|
|||||||
Reference in New Issue
Block a user