Loading core/java/android/window/TransitionFilter.java +2 −2 Original line number Diff line number Diff line Loading @@ -139,8 +139,8 @@ public final class TransitionFilter implements Parcelable { boolean matches(@NonNull TransitionInfo info) { for (int i = info.getChanges().size() - 1; i >= 0; --i) { final TransitionInfo.Change change = info.getChanges().get(i); if (change.getParent() != null) { // Only look at the top animating windows. if (!TransitionInfo.isIndependent(change, info)) { // Only look at independent animating windows. continue; } if (mActivityType != ACTIVITY_TYPE_UNDEFINED) { Loading core/java/android/window/TransitionInfo.java +27 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,33 @@ public final class TransitionInfo implements Parcelable { return sb.toString(); } /** * Indication that `change` is independent of parents (ie. it has a different type of * transition vs. "going along for the ride") */ public static boolean isIndependent(TransitionInfo.Change change, TransitionInfo info) { // If the change has no parent (it is root), then it is independent if (change.getParent() == null) return true; // non-visibility changes will just be folded into the parent change, so they aren't // independent either. if (change.getMode() == TRANSIT_CHANGE) return false; TransitionInfo.Change parentChg = info.getChange(change.getParent()); while (parentChg != null) { // If the parent is a visibility change, it will include the results of all child // changes into itself, so none of its children can be independent. if (parentChg.getMode() != TRANSIT_CHANGE) return false; // If there are no more parents left, then all the parents, so far, have not been // visibility changes which means this change is indpendent. if (parentChg.getParent() == null) return true; parentChg = info.getChange(parentChg.getParent()); } return false; } /** Represents the change a WindowContainer undergoes during a transition */ public static final class Change implements Parcelable { private final WindowContainerToken mContainer; Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java +2 −2 Original line number Diff line number Diff line Loading @@ -97,8 +97,8 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { for (int i = info.getChanges().size() - 1; i >= 0; --i) { final TransitionInfo.Change change = info.getChanges().get(i); // Don't animate anything with an animating parent if (change.getParent() != null) continue; // Don't animate anything that isn't independent. if (!TransitionInfo.isIndependent(change, info)) continue; Animation a = loadAnimation(info.getType(), change); if (a != null) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +9 −5 Original line number Diff line number Diff line Loading @@ -214,8 +214,8 @@ public class Transitions { final SurfaceControl leash = change.getLeash(); final int mode = info.getChanges().get(i).getMode(); // Don't move anything with an animating parent if (change.getParent() != null) { // Don't move anything that isn't independent within its parents if (!TransitionInfo.isIndependent(change, info)) { if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT || mode == TRANSIT_CHANGE) { t.show(leash); t.setMatrix(leash, 1, 0, 0, 1); Loading @@ -225,9 +225,13 @@ public class Transitions { continue; } boolean hasParent = change.getParent() != null; if (!hasParent) { t.reparent(leash, info.getRootLeash()); t.setPosition(leash, change.getStartAbsBounds().left - info.getRootOffset().x, change.getStartAbsBounds().top - info.getRootOffset().y); } // Put all the OPEN/SHOW on top if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) { t.show(leash); Loading packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationAdapterCompat.java +14 −13 Original line number Diff line number Diff line Loading @@ -113,17 +113,6 @@ public class RemoteAnimationAdapterCompat { // TODO(bc-unlock): Build wrapped object for non-apps target. final RemoteAnimationTargetCompat[] nonAppsCompat = new RemoteAnimationTargetCompat[0]; final Runnable animationFinishedCallback = new Runnable() { @Override public void run() { try { finishCallback.onTransitionFinished(null /* wct */); } catch (RemoteException e) { Log.e("ActivityOptionsCompat", "Failed to call app controlled animation" + " finished callback", e); } } }; // TODO(b/177438007): Move this set-up logic into launcher's animation impl. boolean isReturnToHome = false; Loading @@ -143,8 +132,8 @@ public class RemoteAnimationAdapterCompat { final TransitionInfo.Change change = info.getChanges().get(i); final SurfaceControl leash = change.getLeash(); final int mode = info.getChanges().get(i).getMode(); // Only deal with roots if (change.getParent() != null) continue; // Only deal with independent layers if (!TransitionInfo.isIndependent(change, info)) continue; if (mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK) { t.setLayer(leash, info.getChanges().size() * 3 - i); } Loading @@ -156,6 +145,18 @@ public class RemoteAnimationAdapterCompat { } } t.apply(); final Runnable animationFinishedCallback = new Runnable() { @Override public void run() { try { finishCallback.onTransitionFinished(null /* wct */); } catch (RemoteException e) { Log.e("ActivityOptionsCompat", "Failed to call app controlled animation" + " finished callback", e); } } }; // TODO(bc-unlcok): Pass correct transit type. remoteAnimationAdapter.onAnimationStart( TRANSIT_OLD_NONE, Loading Loading
core/java/android/window/TransitionFilter.java +2 −2 Original line number Diff line number Diff line Loading @@ -139,8 +139,8 @@ public final class TransitionFilter implements Parcelable { boolean matches(@NonNull TransitionInfo info) { for (int i = info.getChanges().size() - 1; i >= 0; --i) { final TransitionInfo.Change change = info.getChanges().get(i); if (change.getParent() != null) { // Only look at the top animating windows. if (!TransitionInfo.isIndependent(change, info)) { // Only look at independent animating windows. continue; } if (mActivityType != ACTIVITY_TYPE_UNDEFINED) { Loading
core/java/android/window/TransitionInfo.java +27 −0 Original line number Diff line number Diff line Loading @@ -246,6 +246,33 @@ public final class TransitionInfo implements Parcelable { return sb.toString(); } /** * Indication that `change` is independent of parents (ie. it has a different type of * transition vs. "going along for the ride") */ public static boolean isIndependent(TransitionInfo.Change change, TransitionInfo info) { // If the change has no parent (it is root), then it is independent if (change.getParent() == null) return true; // non-visibility changes will just be folded into the parent change, so they aren't // independent either. if (change.getMode() == TRANSIT_CHANGE) return false; TransitionInfo.Change parentChg = info.getChange(change.getParent()); while (parentChg != null) { // If the parent is a visibility change, it will include the results of all child // changes into itself, so none of its children can be independent. if (parentChg.getMode() != TRANSIT_CHANGE) return false; // If there are no more parents left, then all the parents, so far, have not been // visibility changes which means this change is indpendent. if (parentChg.getParent() == null) return true; parentChg = info.getChange(parentChg.getParent()); } return false; } /** Represents the change a WindowContainer undergoes during a transition */ public static final class Change implements Parcelable { private final WindowContainerToken mContainer; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultTransitionHandler.java +2 −2 Original line number Diff line number Diff line Loading @@ -97,8 +97,8 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler { for (int i = info.getChanges().size() - 1; i >= 0; --i) { final TransitionInfo.Change change = info.getChanges().get(i); // Don't animate anything with an animating parent if (change.getParent() != null) continue; // Don't animate anything that isn't independent. if (!TransitionInfo.isIndependent(change, info)) continue; Animation a = loadAnimation(info.getType(), change); if (a != null) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +9 −5 Original line number Diff line number Diff line Loading @@ -214,8 +214,8 @@ public class Transitions { final SurfaceControl leash = change.getLeash(); final int mode = info.getChanges().get(i).getMode(); // Don't move anything with an animating parent if (change.getParent() != null) { // Don't move anything that isn't independent within its parents if (!TransitionInfo.isIndependent(change, info)) { if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT || mode == TRANSIT_CHANGE) { t.show(leash); t.setMatrix(leash, 1, 0, 0, 1); Loading @@ -225,9 +225,13 @@ public class Transitions { continue; } boolean hasParent = change.getParent() != null; if (!hasParent) { t.reparent(leash, info.getRootLeash()); t.setPosition(leash, change.getStartAbsBounds().left - info.getRootOffset().x, change.getStartAbsBounds().top - info.getRootOffset().y); } // Put all the OPEN/SHOW on top if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) { t.show(leash); Loading
packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationAdapterCompat.java +14 −13 Original line number Diff line number Diff line Loading @@ -113,17 +113,6 @@ public class RemoteAnimationAdapterCompat { // TODO(bc-unlock): Build wrapped object for non-apps target. final RemoteAnimationTargetCompat[] nonAppsCompat = new RemoteAnimationTargetCompat[0]; final Runnable animationFinishedCallback = new Runnable() { @Override public void run() { try { finishCallback.onTransitionFinished(null /* wct */); } catch (RemoteException e) { Log.e("ActivityOptionsCompat", "Failed to call app controlled animation" + " finished callback", e); } } }; // TODO(b/177438007): Move this set-up logic into launcher's animation impl. boolean isReturnToHome = false; Loading @@ -143,8 +132,8 @@ public class RemoteAnimationAdapterCompat { final TransitionInfo.Change change = info.getChanges().get(i); final SurfaceControl leash = change.getLeash(); final int mode = info.getChanges().get(i).getMode(); // Only deal with roots if (change.getParent() != null) continue; // Only deal with independent layers if (!TransitionInfo.isIndependent(change, info)) continue; if (mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK) { t.setLayer(leash, info.getChanges().size() * 3 - i); } Loading @@ -156,6 +145,18 @@ public class RemoteAnimationAdapterCompat { } } t.apply(); final Runnable animationFinishedCallback = new Runnable() { @Override public void run() { try { finishCallback.onTransitionFinished(null /* wct */); } catch (RemoteException e) { Log.e("ActivityOptionsCompat", "Failed to call app controlled animation" + " finished callback", e); } } }; // TODO(bc-unlcok): Pass correct transit type. remoteAnimationAdapter.onAnimationStart( TRANSIT_OLD_NONE, Loading