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

Commit 5a881069 authored by Josh Tsuji's avatar Josh Tsuji
Browse files

Make FlingInfos unique.

Under test, velocities are often identical, which causes StateFlows not to emit duplicate values. Other sources of uniqueness such as SystemUptimeMillis also don't behave as expected under test, so this seems as good a way as any to address that.

Test: atest KeyguardTests
Flag: N/A
Bug: 278086361
Change-Id: I0d67470d894928e47e6489d9101e788c1eab51d5
parent b310a0e0
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -16,11 +16,16 @@

package com.android.systemui.shade.data.repository

import java.util.UUID

/**
 * Information about a fling on the shade: whether we're flinging expanded or collapsed, and the
 * velocity of the touch gesture that started the fling (if applicable).
 */
data class FlingInfo(
data class FlingInfo @JvmOverloads constructor(
    val expand: Boolean,
    val velocity: Float = 0f,

    /** Required to emit duplicate FlingInfo from StateFlow. */
    val id: UUID = UUID.randomUUID()
)