From 0a9a5dc466b236ae1838bb903c4b6bd77cadfbc7 Mon Sep 17 00:00:00 2001 From: Federico Baron Date: Tue, 21 Jan 2025 21:39:05 +0000 Subject: [PATCH] Fix failing tests that are blocking OOM investigation Flag: TEST_ONLY Bug: 388258969 Test: InstallSessionTrackerTest InstallSessionHelperTest Change-Id: I539c51c6a253ff0b64113e73764979c5e188bbbb --- quickstep/src/com/android/quickstep/SystemUiProxy.kt | 3 ++- .../src/com/android/launcher3/pm/InstallSessionHelperTest.kt | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.kt b/quickstep/src/com/android/quickstep/SystemUiProxy.kt index 0459da03af..495215a4b9 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.kt +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.kt @@ -169,7 +169,7 @@ class SystemUiProxy @Inject constructor(@ApplicationContext private val context: * different process). It is bare-bones, so it's expected that the component and options will be * provided via fill-in intent. */ - private val recentsPendingIntent = + private val recentsPendingIntent by lazy { PendingIntent.getActivity( context, 0, @@ -183,6 +183,7 @@ class SystemUiProxy @Inject constructor(@ApplicationContext private val context: ) .toBundle(), ) + } val unfoldTransitionProvider: ProxyUnfoldTransitionProvider? = if ((Flags.enableUnfoldStateAnimation() && ResourceUnfoldTransitionConfig().isEnabled)) diff --git a/tests/src/com/android/launcher3/pm/InstallSessionHelperTest.kt b/tests/src/com/android/launcher3/pm/InstallSessionHelperTest.kt index c7db7414ef..707c2c1976 100644 --- a/tests/src/com/android/launcher3/pm/InstallSessionHelperTest.kt +++ b/tests/src/com/android/launcher3/pm/InstallSessionHelperTest.kt @@ -35,7 +35,6 @@ import com.android.launcher3.util.LauncherModelHelper import com.android.launcher3.util.TestUtil import com.google.common.truth.Truth.assertThat import org.junit.Before -import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.kotlin.any @@ -53,7 +52,7 @@ class InstallSessionHelperTest { private val sandboxContext = spy(launcherModelHelper.sandboxContext) private val packageManager = sandboxContext.packageManager private val expectedAppPackage = "expectedAppPackage" - private val expectedInstallerPackage = "expectedInstallerPackage" + private val expectedInstallerPackage = sandboxContext.packageName private val mockPackageInstaller: PackageInstaller = mock() private lateinit var installSessionHelper: InstallSessionHelper @@ -62,7 +61,6 @@ class InstallSessionHelperTest { @Before fun setup() { whenever(packageManager.packageInstaller).thenReturn(mockPackageInstaller) - whenever(sandboxContext.packageName).thenReturn(expectedInstallerPackage) launcherApps = sandboxContext.spyService(LauncherApps::class.java) installSessionHelper = InstallSessionHelper(sandboxContext) } @@ -167,7 +165,6 @@ class InstallSessionHelperTest { } @Test - @Ignore("b/388258969") fun `promiseIconAddedForId returns true if there is a promiseIcon with the session id`() { // Given val expectedIdString = IntArray().apply { add(1) }.toConcatString()