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

Commit e527c3d7 authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Passthrough animation handoff method for RecentsAnimationControllerCompat.

Also makes flag checking methods visible outside of the Animation
library.

Bug: 323863002
Flag: com.android.systemui.shared.return_animation_framework_library
Flag: com.android.systemui.shared.return_animation_framework_long_lived
Test: manual
Change-Id: I4314c35bcbd307b53d56dc6fecddcf7e81eddea9
parent baec17e1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -114,16 +114,16 @@ class TransitionAnimator(
            )
        }

        internal fun assertReturnAnimations() {
        fun assertReturnAnimations() {
            check(returnAnimationsEnabled()) {
                "isLaunching cannot be false when the returnAnimationFrameworkLibrary flag " +
                    "is disabled"
            }
        }

        internal fun returnAnimationsEnabled() = returnAnimationFrameworkLibrary()
        fun returnAnimationsEnabled() = returnAnimationFrameworkLibrary()

        internal fun assertLongLivedReturnAnimations() {
        fun assertLongLivedReturnAnimations() {
            check(longLivedReturnAnimationsEnabled()) {
                "Long-lived registrations cannot be used when the " +
                    "returnAnimationFrameworkLibrary or the " +
@@ -131,7 +131,7 @@ class TransitionAnimator(
            }
        }

        internal fun longLivedReturnAnimationsEnabled() =
        fun longLivedReturnAnimationsEnabled() =
            returnAnimationFrameworkLibrary() && returnAnimationFrameworkLongLived()

        internal fun WindowAnimationState.toTransitionState() =
+13 −0
Original line number Diff line number Diff line
@@ -18,9 +18,11 @@ package com.android.systemui.shared.system;

import android.os.RemoteException;
import android.util.Log;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
import android.window.PictureInPictureSurfaceTransaction;
import android.window.TaskSnapshot;
import android.window.WindowAnimationState;

import com.android.internal.os.IResultReceiver;
import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -106,6 +108,17 @@ public class RecentsAnimationControllerCompat {
        }
    }

    /**
     * @see IRecentsAnimationController#handOffAnimation
     */
    public void handOffAnimation(RemoteAnimationTarget[] targets, WindowAnimationState[] states) {
        try {
            mAnimationController.handOffAnimation(targets, states);
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to hand off animation", e);
        }
    }

    /**
     * @see IRecentsAnimationController#detachNavigationBarFromApp
     */