Loading packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt +28 −6 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.graphics.Path import android.graphics.Rect import android.graphics.RectF import android.os.Build import android.os.Handler import android.os.Looper import android.os.RemoteException import android.util.Log Loading Loading @@ -58,7 +59,14 @@ class ActivityLaunchAnimator( /** The animator used when animating a Dialog into an app. */ // TODO(b/218989950): Remove this animator and instead set the duration of the dim fade out to // TIMINGS.contentBeforeFadeOutDuration. private val dialogToAppAnimator: LaunchAnimator = DEFAULT_DIALOG_TO_APP_ANIMATOR private val dialogToAppAnimator: LaunchAnimator = DEFAULT_DIALOG_TO_APP_ANIMATOR, /** * Whether we should disable the WindowManager timeout. This should be set to true in tests * only. */ // TODO(b/301385865): Remove this flag. private val disableWmTimeout: Boolean = false, ) { companion object { /** The timings when animating a View into an app. */ Loading Loading @@ -432,7 +440,8 @@ class ActivityLaunchAnimator( internal val delegate: AnimationDelegate init { delegate = AnimationDelegate(controller, callback, listener, launchAnimator) delegate = AnimationDelegate(controller, callback, listener, launchAnimator, disableWmTimeout) } @BinderThread Loading Loading @@ -462,13 +471,26 @@ class ActivityLaunchAnimator( /** Listener for animation lifecycle events. */ private val listener: Listener? = null, /** The animator to use to animate the window launch. */ private val launchAnimator: LaunchAnimator = DEFAULT_LAUNCH_ANIMATOR private val launchAnimator: LaunchAnimator = DEFAULT_LAUNCH_ANIMATOR, /** * Whether we should disable the WindowManager timeout. This should be set to true in tests * only. */ // TODO(b/301385865): Remove this flag. disableWmTimeout: Boolean = false, ) : RemoteAnimationDelegate<IRemoteAnimationFinishedCallback> { private val launchContainer = controller.launchContainer private val context = launchContainer.context private val transactionApplierView = controller.openingWindowSyncView ?: controller.launchContainer private val transactionApplier = SyncRtSurfaceTransactionApplier(transactionApplierView) private val timeoutHandler = if (!disableWmTimeout) { Handler(Looper.getMainLooper()) } else { null } private val matrix = Matrix() private val invertMatrix = Matrix() Loading @@ -488,11 +510,11 @@ class ActivityLaunchAnimator( @UiThread internal fun postTimeout() { launchContainer.postDelayed(onTimeout, LAUNCH_TIMEOUT) timeoutHandler?.postDelayed(onTimeout, LAUNCH_TIMEOUT) } private fun removeTimeout() { launchContainer.removeCallbacks(onTimeout) timeoutHandler?.removeCallbacks(onTimeout) } @UiThread Loading packages/SystemUI/tests/src/com/android/systemui/animation/ActivityLaunchAnimatorTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,8 @@ class ActivityLaunchAnimatorTest : SysuiTestCase() { @Before fun setup() { activityLaunchAnimator = ActivityLaunchAnimator(testLaunchAnimator, testLaunchAnimator) activityLaunchAnimator = ActivityLaunchAnimator(testLaunchAnimator, testLaunchAnimator, disableWmTimeout = true) activityLaunchAnimator.callback = callback activityLaunchAnimator.addListener(listener) } Loading Loading
packages/SystemUI/animation/src/com/android/systemui/animation/ActivityLaunchAnimator.kt +28 −6 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import android.graphics.Path import android.graphics.Rect import android.graphics.RectF import android.os.Build import android.os.Handler import android.os.Looper import android.os.RemoteException import android.util.Log Loading Loading @@ -58,7 +59,14 @@ class ActivityLaunchAnimator( /** The animator used when animating a Dialog into an app. */ // TODO(b/218989950): Remove this animator and instead set the duration of the dim fade out to // TIMINGS.contentBeforeFadeOutDuration. private val dialogToAppAnimator: LaunchAnimator = DEFAULT_DIALOG_TO_APP_ANIMATOR private val dialogToAppAnimator: LaunchAnimator = DEFAULT_DIALOG_TO_APP_ANIMATOR, /** * Whether we should disable the WindowManager timeout. This should be set to true in tests * only. */ // TODO(b/301385865): Remove this flag. private val disableWmTimeout: Boolean = false, ) { companion object { /** The timings when animating a View into an app. */ Loading Loading @@ -432,7 +440,8 @@ class ActivityLaunchAnimator( internal val delegate: AnimationDelegate init { delegate = AnimationDelegate(controller, callback, listener, launchAnimator) delegate = AnimationDelegate(controller, callback, listener, launchAnimator, disableWmTimeout) } @BinderThread Loading Loading @@ -462,13 +471,26 @@ class ActivityLaunchAnimator( /** Listener for animation lifecycle events. */ private val listener: Listener? = null, /** The animator to use to animate the window launch. */ private val launchAnimator: LaunchAnimator = DEFAULT_LAUNCH_ANIMATOR private val launchAnimator: LaunchAnimator = DEFAULT_LAUNCH_ANIMATOR, /** * Whether we should disable the WindowManager timeout. This should be set to true in tests * only. */ // TODO(b/301385865): Remove this flag. disableWmTimeout: Boolean = false, ) : RemoteAnimationDelegate<IRemoteAnimationFinishedCallback> { private val launchContainer = controller.launchContainer private val context = launchContainer.context private val transactionApplierView = controller.openingWindowSyncView ?: controller.launchContainer private val transactionApplier = SyncRtSurfaceTransactionApplier(transactionApplierView) private val timeoutHandler = if (!disableWmTimeout) { Handler(Looper.getMainLooper()) } else { null } private val matrix = Matrix() private val invertMatrix = Matrix() Loading @@ -488,11 +510,11 @@ class ActivityLaunchAnimator( @UiThread internal fun postTimeout() { launchContainer.postDelayed(onTimeout, LAUNCH_TIMEOUT) timeoutHandler?.postDelayed(onTimeout, LAUNCH_TIMEOUT) } private fun removeTimeout() { launchContainer.removeCallbacks(onTimeout) timeoutHandler?.removeCallbacks(onTimeout) } @UiThread Loading
packages/SystemUI/tests/src/com/android/systemui/animation/ActivityLaunchAnimatorTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,8 @@ class ActivityLaunchAnimatorTest : SysuiTestCase() { @Before fun setup() { activityLaunchAnimator = ActivityLaunchAnimator(testLaunchAnimator, testLaunchAnimator) activityLaunchAnimator = ActivityLaunchAnimator(testLaunchAnimator, testLaunchAnimator, disableWmTimeout = true) activityLaunchAnimator.callback = callback activityLaunchAnimator.addListener(listener) } Loading