summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-12-11 18:19:45 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2024-12-11 18:19:45 -0800
commit34309be52b91facbccffa78eb5890badde894067 (patch)
treec97c1d7c8ec318341aeca748a7cf0ff53aacb8dd
parent069fcdccf540e4dc7b19612ae44391bc6f1a35a2 (diff)
parent623dadf0bc25d619a31dfbd3052027f6b7c53ca0 (diff)
Merge "Remove illegal supertype" into main
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/lifecycle/RepeatWhenAttachedTest.kt10
1 files changed, 4 insertions, 6 deletions
diff --git a/packages/SystemUI/tests/src/com/android/systemui/lifecycle/RepeatWhenAttachedTest.kt b/packages/SystemUI/tests/src/com/android/systemui/lifecycle/RepeatWhenAttachedTest.kt
index d3409c7256fd..e3aeaa85873d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/lifecycle/RepeatWhenAttachedTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/lifecycle/RepeatWhenAttachedTest.kt
@@ -484,14 +484,12 @@ class RepeatWhenAttachedTest : SysuiTestCase() {
private fun CoroutineScope.repeatWhenAttached(): DisposableHandle {
return view.repeatWhenAttached(
coroutineContext = coroutineContext,
- block = block,
+ block = { block.invoke(this) },
)
}
- private class Block : suspend LifecycleOwner.(View) -> Unit {
- data class Invocation(
- val lifecycleOwner: LifecycleOwner,
- ) {
+ private class Block {
+ data class Invocation(val lifecycleOwner: LifecycleOwner) {
val lifecycleState: Lifecycle.State
get() = lifecycleOwner.lifecycle.currentState
}
@@ -504,7 +502,7 @@ class RepeatWhenAttachedTest : SysuiTestCase() {
val latestLifecycleState: Lifecycle.State
get() = _invocations.last().lifecycleState
- override suspend fun invoke(lifecycleOwner: LifecycleOwner, view: View) {
+ fun invoke(lifecycleOwner: LifecycleOwner) {
_invocations.add(Invocation(lifecycleOwner))
}
}