Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3dc46d7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Minor cleanup for animateEnterBubblesFromBubble" into main

parents 3fbfac64 81a5be6e
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1761,13 +1761,11 @@ public class BubbleController implements ConfigurationChangeListener,
     *
     * @param taskInfo the task.
     */
    @Nullable
    public Transitions.TransitionHandler expandStackAndSelectBubbleForExistingTransition(
    @NonNull
    Transitions.TransitionHandler expandStackAndSelectBubbleForExistingTransition(
            @NonNull ActivityManager.RunningTaskInfo taskInfo,
            @NonNull IBinder transition,
            Consumer<Transitions.TransitionHandler> onInflatedCallback) {
        if (!BubbleAnythingFlagHelper.enableCreateAnyBubble()) return null;

        Bubble b = mBubbleData.getBubbleInStackWithTaskId(taskInfo.taskId);
        if (b != null) {
            // Reuse the existing bubble; pass null for location to use existing location.
+3 −8
Original line number Diff line number Diff line
@@ -241,20 +241,15 @@ public class BubbleTransitions {

    /**
     * Initiates axed bubble-to-bubble launch/existing bubble convert for the given transition.
     *
     * @return whether a new transition was started for the launch
     */
    public boolean startBubbleToBubbleLaunchOrExistingBubbleConvert(@NonNull IBinder transition,
    public void startBubbleToBubbleLaunchOrExistingBubbleConvert(@NonNull IBinder transition,
            @NonNull ActivityManager.RunningTaskInfo launchingTask,
            @NonNull Consumer<TransitionHandler> onInflatedCallback) {
        TransitionHandler handler =
        final TransitionHandler handler =
                mBubbleController.expandStackAndSelectBubbleForExistingTransition(
                        launchingTask, transition, onInflatedCallback);
        if (handler != null) {
        mEnterTransitions.put(transition, handler);
    }
        return handler != null;
    }

    /**
     * Starts a new launch or convert transition to show the given bubble.
+1 −5
Original line number Diff line number Diff line
@@ -437,7 +437,7 @@ class DefaultMixedTransition extends DefaultMixedHandler.MixedTransition {
        // 3. Switch the expanded bubble for notification launch
        ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " Animating a mixed transition for "
                + "entering bubble from another bubbled task or for an existing bubble");
        final boolean started = bubbleTransitions.startBubbleToBubbleLaunchOrExistingBubbleConvert(
        bubbleTransitions.startBubbleToBubbleLaunchOrExistingBubbleConvert(
                transition, change.getTaskInfo(), handler -> {
                    final Transitions.TransitionHandler h = bubbleTransitions
                            .getRunningEnterTransition(transition);
@@ -446,10 +446,6 @@ class DefaultMixedTransition extends DefaultMixedHandler.MixedTransition {
                    h.startAnimation(
                            transition, info, startTransaction, finishTransaction, finishCallback);
                });
        if (!started) {
            // If nothing started, we are still consuming it since nothing else should handle it
            finishCallback.onTransitionFinished(null);
        }
        return true;
    }