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

Commit c7d6d505 authored by William Xiao's avatar William Xiao Committed by Android (Google) Code Review
Browse files

Merge "Fix ScrimControllerTest memory leak" into main

parents 56f7f402 513e18c3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.test.UnconfinedTestDispatcher
import org.junit.After
import org.junit.Assert.assertThrows
import org.junit.Assume.assumeTrue
import org.junit.Before
@@ -118,6 +119,11 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
        initAndAttachContainerView()
    }

    @After
    fun tearDown() {
        ViewUtils.detachView(parentView)
    }

    @Test
    fun isEnabled_communalEnabled_returnsTrue() {
        communalRepository.setIsCommunalEnabled(true)
+2 −0
Original line number Diff line number Diff line
@@ -315,6 +315,8 @@ public class ScrimControllerTest extends SysuiTestCase {

    @After
    public void tearDown() {
        // Detaching view stops flow collection and prevents memory leak.
        ViewUtils.detachView(mScrimBehind);
        finishAnimationsImmediately();
        Arrays.stream(ScrimState.values()).forEach((scrim) -> {
            scrim.setAodFrontScrimAlpha(0f);