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

Commit 01c534a5 authored by David Saff's avatar David Saff Committed by Android (Google) Code Review
Browse files

Merge "Expose internal APIs relied on by tests" into main

parents 624419af c8b2d15f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.systemui.media.controls.ui.animation

import android.graphics.drawable.Animatable2
import android.graphics.drawable.Drawable
import androidx.annotation.VisibleForTesting
import com.android.systemui.util.annotations.DeprecatedSysuiVisibleForTesting

/**
 * AnimationBindHandler is responsible for tracking the bound animation state and preventing jank
@@ -34,7 +36,9 @@ import android.graphics.drawable.Drawable
 *      rebind id will be totally ignored to prevent the continuous animation from restarting.
 * ```
 */
internal class AnimationBindHandler : Animatable2.AnimationCallback() {
@DeprecatedSysuiVisibleForTesting
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
class AnimationBindHandler : Animatable2.AnimationCallback() {
    private val onAnimationsComplete = mutableListOf<() -> Unit>()
    private val registrations = mutableListOf<Animatable2>()
    private var rebindId: Int? = null
+6 −2
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.systemui.media.controls.ui.animation

import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import androidx.annotation.VisibleForTesting
import com.android.systemui.util.annotations.DeprecatedSysuiVisibleForTesting

/**
 * MetadataAnimationHandler controls the current state of the MediaControlPanel's transition motion.
@@ -26,9 +28,11 @@ import android.animation.AnimatorListenerAdapter
 * animation if necessary. When the motion has fully transitioned the elements out, it runs the
 * update callback to modify the view data, before the enter animation runs.
 */
internal open class MetadataAnimationHandler(
@DeprecatedSysuiVisibleForTesting
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
open class MetadataAnimationHandler(
    private val exitAnimator: Animator,
    private val enterAnimator: Animator
    private val enterAnimator: Animator,
) : AnimatorListenerAdapter() {

    private var postExitUpdate: (() -> Unit)? = null
+7 −2
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package com.android.systemui.notetask

import androidx.annotation.VisibleForTesting
import com.android.systemui.util.annotations.DeprecatedSysuiVisibleForTesting

/**
 * Marks declarations that are **internal** in note task API, which means that should not be used
 * outside of `com.android.systemui.notetask`.
@@ -25,10 +28,12 @@ package com.android.systemui.notetask
    AnnotationTarget.CLASS,
    AnnotationTarget.FUNCTION,
    AnnotationTarget.TYPEALIAS,
    AnnotationTarget.PROPERTY
    AnnotationTarget.PROPERTY,
)
@RequiresOptIn(
    level = RequiresOptIn.Level.ERROR,
    message = "This is an internal API, do not it outside `com.android.systemui.notetask`",
)
internal annotation class InternalNoteTaskApi
@DeprecatedSysuiVisibleForTesting
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
annotation class InternalNoteTaskApi
+5 −2
Original line number Diff line number Diff line
@@ -17,12 +17,15 @@
package com.android.systemui.shade.transition

import android.util.MathUtils
import androidx.annotation.VisibleForTesting
import com.android.systemui.animation.ShadeInterpolation
import com.android.systemui.util.annotations.DeprecatedSysuiVisibleForTesting
import javax.inject.Inject

/** Interpolator responsible for the shade when in portrait on a large screen. */
internal class LargeScreenPortraitShadeInterpolator @Inject internal constructor() :
    LargeScreenShadeInterpolator {
@DeprecatedSysuiVisibleForTesting
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
class LargeScreenPortraitShadeInterpolator @Inject constructor() : LargeScreenShadeInterpolator {

    override fun getBehindScrimAlpha(fraction: Float): Float {
        return MathUtils.constrainedMap(0f, 1f, 0f, 0.3f, fraction)
+6 −2
Original line number Diff line number Diff line
@@ -18,17 +18,21 @@ package com.android.systemui.shade.transition

import android.content.Context
import android.content.res.Configuration
import androidx.annotation.VisibleForTesting
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.shade.ShadeDisplayAware
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.statusbar.policy.SplitShadeStateController
import com.android.systemui.util.annotations.DeprecatedSysuiVisibleForTesting
import javax.inject.Inject

/** Interpolator responsible for the shade when on large screens. */
@SysUISingleton
internal class LargeScreenShadeInterpolatorImpl
@DeprecatedSysuiVisibleForTesting
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
class LargeScreenShadeInterpolatorImpl
@Inject
internal constructor(
constructor(
    @ShadeDisplayAware configurationController: ConfigurationController,
    @ShadeDisplayAware private val context: Context,
    private val splitShadeInterpolator: SplitShadeInterpolator,
Loading