Fix a transition issue when entering a dream.
When entering a dream, the transition should be for the visible activity to remain in place while the dream fades in. A bug was causing the current activity to slide out before the dream faded in. Test: Manually by launching setting up the device to show a screen saver, launching an activity (such as Play Store), and then waiting for the device to show the screen saver. The previous activity should remain in place as screen saver fades in. Bug: 279487452 Change-Id: Idccd30cdf26fca9826a80d9705f17217d92034a7
This commit is contained in:
@@ -255,7 +255,7 @@ class ActivityEmbeddingAnimationSpec {
|
||||
private boolean shouldShowBackdrop(@NonNull TransitionInfo info,
|
||||
@NonNull TransitionInfo.Change change) {
|
||||
final Animation a = loadAttributeAnimation(info, change, WALLPAPER_TRANSITION_NONE,
|
||||
mTransitionAnimation);
|
||||
mTransitionAnimation, false);
|
||||
return a != null && a.getShowBackdrop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import static android.app.ActivityOptions.ANIM_SCALE_UP;
|
||||
import static android.app.ActivityOptions.ANIM_SCENE_TRANSITION;
|
||||
import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_DOWN;
|
||||
import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_UP;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_DREAM;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||
import static android.app.admin.DevicePolicyManager.ACTION_DEVICE_POLICY_RESOURCE_UPDATED;
|
||||
import static android.app.admin.DevicePolicyManager.EXTRA_RESOURCE_TYPE;
|
||||
@@ -329,6 +330,8 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
|
||||
@ColorInt int backgroundColorForTransition = 0;
|
||||
final int wallpaperTransit = getWallpaperTransitType(info);
|
||||
boolean isDisplayRotationAnimationStarted = false;
|
||||
final boolean isDreamTransition = isDreamTransition(info);
|
||||
|
||||
for (int i = info.getChanges().size() - 1; i >= 0; --i) {
|
||||
final TransitionInfo.Change change = info.getChanges().get(i);
|
||||
if (change.hasAllFlags(FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY
|
||||
@@ -424,7 +427,7 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
|
||||
// Don't animate anything that isn't independent.
|
||||
if (!TransitionInfo.isIndependent(change, info)) continue;
|
||||
|
||||
Animation a = loadAnimation(info, change, wallpaperTransit);
|
||||
Animation a = loadAnimation(info, change, wallpaperTransit, isDreamTransition);
|
||||
if (a != null) {
|
||||
if (isTask) {
|
||||
final @TransitionType int type = info.getType();
|
||||
@@ -519,6 +522,18 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean isDreamTransition(@NonNull TransitionInfo info) {
|
||||
for (int i = info.getChanges().size() - 1; i >= 0; --i) {
|
||||
final TransitionInfo.Change change = info.getChanges().get(i);
|
||||
if (change.getTaskInfo() != null
|
||||
&& change.getTaskInfo().topActivityType == ACTIVITY_TYPE_DREAM) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mergeAnimation(@NonNull IBinder transition, @NonNull TransitionInfo info,
|
||||
@NonNull SurfaceControl.Transaction t, @NonNull IBinder mergeTarget,
|
||||
@@ -572,7 +587,8 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
|
||||
|
||||
@Nullable
|
||||
private Animation loadAnimation(@NonNull TransitionInfo info,
|
||||
@NonNull TransitionInfo.Change change, int wallpaperTransit) {
|
||||
@NonNull TransitionInfo.Change change, int wallpaperTransit,
|
||||
boolean isDreamTransition) {
|
||||
Animation a;
|
||||
|
||||
final int type = info.getType();
|
||||
@@ -630,7 +646,8 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
|
||||
// If there's a scene-transition, then jump-cut.
|
||||
return null;
|
||||
} else {
|
||||
a = loadAttributeAnimation(info, change, wallpaperTransit, mTransitionAnimation);
|
||||
a = loadAttributeAnimation(
|
||||
info, change, wallpaperTransit, mTransitionAnimation, isDreamTransition);
|
||||
}
|
||||
|
||||
if (a != null) {
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.wm.shell.transition;
|
||||
|
||||
import static android.app.ActivityOptions.ANIM_FROM_STYLE;
|
||||
import static android.app.ActivityOptions.ANIM_NONE;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_DREAM;
|
||||
import static android.view.WindowManager.TRANSIT_CLOSE;
|
||||
import static android.view.WindowManager.TRANSIT_OPEN;
|
||||
import static android.view.WindowManager.TRANSIT_TO_BACK;
|
||||
@@ -63,7 +62,7 @@ public class TransitionAnimationHelper {
|
||||
@Nullable
|
||||
public static Animation loadAttributeAnimation(@NonNull TransitionInfo info,
|
||||
@NonNull TransitionInfo.Change change, int wallpaperTransit,
|
||||
@NonNull TransitionAnimation transitionAnimation) {
|
||||
@NonNull TransitionAnimation transitionAnimation, boolean isDreamTransition) {
|
||||
final int type = info.getType();
|
||||
final int changeMode = change.getMode();
|
||||
final int changeFlags = change.getFlags();
|
||||
@@ -71,11 +70,9 @@ public class TransitionAnimationHelper {
|
||||
final boolean isTask = change.getTaskInfo() != null;
|
||||
final TransitionInfo.AnimationOptions options = info.getAnimationOptions();
|
||||
final int overrideType = options != null ? options.getType() : ANIM_NONE;
|
||||
final boolean isDream =
|
||||
isTask && change.getTaskInfo().topActivityType == ACTIVITY_TYPE_DREAM;
|
||||
int animAttr = 0;
|
||||
boolean translucent = false;
|
||||
if (isDream) {
|
||||
if (isDreamTransition) {
|
||||
if (type == TRANSIT_OPEN) {
|
||||
animAttr = enter
|
||||
? R.styleable.WindowAnimation_dreamActivityOpenEnterAnimation
|
||||
|
||||
Reference in New Issue
Block a user