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

Commit fe22e5b5 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13511273 from 609bcdfa to 25Q3-release

Change-Id: I6ebd587f803288c73517ecc8cc5f8c2f5f7f9c53
parents fef7b2a3 609bcdfa
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@ import com.android.app.displaylib.PerDisplayRepository
import java.util.function.Consumer

/** Fake version of [PerDisplayRepository], to be used in tests. */
class FakePerDisplayRepository<T> : PerDisplayRepository<T> {
class FakePerDisplayRepository<T>(private val defaultIfAbsent: ((Int) -> T)? = null) :
    PerDisplayRepository<T> {

    private val instances = mutableMapOf<Int, T>()

@@ -33,7 +34,11 @@ class FakePerDisplayRepository<T> : PerDisplayRepository<T> {
    }

    override fun get(displayId: Int): T? {
        return instances[displayId]
        return if (defaultIfAbsent != null) {
            instances.getOrPut(displayId) { defaultIfAbsent(displayId) }
        } else {
            instances[displayId]
        }
    }

    override val debugName: String
+2 −2
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ class MotionValueBenchmark {
                    defaultSpring = SpringParameters(stiffness = 300f, dampingRatio = .9f),
                    initialMapping = Mapping.Zero,
                ) {
                    constantValue(breakpoint = 1f, value = 1f)
                    fixedValue(breakpoint = 1f, value = 1f)
                }
            )

@@ -232,7 +232,7 @@ class MotionValueBenchmark {
                    defaultSpring = SpringParameters(stiffness = 300f, dampingRatio = .9f),
                    initialMapping = Mapping.Zero,
                ) {
                    constantValue(
                    fixedValue(
                        breakpoint = 1f,
                        value = 1f,
                        guarantee = Guarantee.GestureDragDelta(1f),
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ class VerticalExpandContainerSpec(
        return with(density) {
            MotionSpec(
                directionalMotionSpec(opacitySpring, initialMapping = Mapping.Zero) {
                    constantValue(breakpoint = visibleHeight.toPx(), value = 1f)
                    fixedValue(breakpoint = visibleHeight.toPx(), value = 1f)
                }
            )
        }
+5 −5
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ internal open class DirectionalBuilderImpl(
        return CanBeLastSegmentImpl
    }

    override fun constantValue(
    override fun fixedValue(
        breakpoint: Float,
        value: Float,
        spring: SpringParameters,
@@ -204,11 +204,11 @@ internal open class DirectionalBuilderImpl(
        applySemantics(semantics)
        toBreakpointImpl(breakpoint, key)
        jumpToImpl(value, spring, guarantee)
        continueWithConstantValueImpl()
        continueWithFixedValueImpl()
        return CanBeLastSegmentImpl
    }

    override fun constantValueFromCurrent(
    override fun fixedValueFromCurrent(
        breakpoint: Float,
        delta: Float,
        spring: SpringParameters,
@@ -219,7 +219,7 @@ internal open class DirectionalBuilderImpl(
        applySemantics(semantics)
        toBreakpointImpl(breakpoint, key)
        jumpByImpl(delta, spring, guarantee)
        continueWithConstantValueImpl()
        continueWithFixedValueImpl()
        return CanBeLastSegmentImpl
    }

@@ -258,7 +258,7 @@ internal open class DirectionalBuilderImpl(
        fractionalMapping = fraction
    }

    private fun continueWithConstantValueImpl() {
    private fun continueWithFixedValueImpl() {
        check(sourceValue.isFinite())

        mappings.add(Mapping.Fixed(sourceValue))
+5 −5
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ interface DirectionalBuilderScope {

    /**
     * Ends the current segment at the [breakpoint] position and defines the next segment to output
     * a constant value ([value]).
     * a fixed value ([value]).
     *
     * Note: This segment can be used as the last segment in the specification.
     *
@@ -169,7 +169,7 @@ interface DirectionalBuilderScope {
     * @param semantics Updated semantics values to be applied. Must be a subset of the
     *   [SemanticKey]s used when first creating this builder.
     */
    fun constantValue(
    fun fixedValue(
        breakpoint: Float,
        value: Float,
        spring: SpringParameters = defaultSpring,
@@ -187,7 +187,7 @@ interface DirectionalBuilderScope {
     *
     * @param breakpoint The breakpoint defining the end of the current segment and the start of the
     *   next.
     * @param delta An optional offset to apply to the mapped value to determine the constant value.
     * @param delta An optional offset to apply to the mapped value to determine the fixed value.
     *   Defaults to 0f.
     * @param spring The [SpringParameters] for the transition to this breakpoint. Defaults to
     *   [defaultSpring].
@@ -196,7 +196,7 @@ interface DirectionalBuilderScope {
     * @param semantics Updated semantics values to be applied. Must be a subset of the
     *   [SemanticKey]s used when first creating this builder.
     */
    fun constantValueFromCurrent(
    fun fixedValueFromCurrent(
        breakpoint: Float,
        delta: Float = 0f,
        spring: SpringParameters = defaultSpring,
@@ -238,7 +238,7 @@ interface DirectionalBuilderScope {
     *
     * @param breakpoint The breakpoint defining the end of the current segment and the start of the
     *   next.
     * @param delta An optional offset to apply to the mapped value to determine the constant value.
     * @param delta An optional offset to apply to the mapped value to determine the fixed value.
     * @param spring The [SpringParameters] for the transition to this breakpoint.
     * @param guarantee The animation guarantee for this transition.
     * @param key A unique [BreakpointKey] for this breakpoint.
Loading