mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 00:36:49 +00:00
Merge "Fix test Dagger initialization deadlock in RecentsDisplayModel" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
e6079bfa01
@@ -25,7 +25,6 @@ import com.android.launcher3.dagger.LauncherAppModule
|
||||
import com.android.launcher3.dagger.LauncherAppSingleton
|
||||
import com.android.launcher3.util.LauncherModelHelper
|
||||
import com.android.launcher3.util.MSDLPlayerWrapper
|
||||
import com.android.quickstep.fallback.window.RecentsDisplayModel
|
||||
import com.android.systemui.contextualeducation.GestureType
|
||||
import com.android.systemui.shared.system.InputConsumerController
|
||||
import dagger.BindsInstance
|
||||
@@ -67,9 +66,7 @@ class LauncherSwipeHandlerV2Test {
|
||||
@Before
|
||||
fun setup() {
|
||||
sandboxContext.initDaggerComponent(
|
||||
DaggerTestComponent.builder()
|
||||
.bindSystemUiProxy(systemUiProxy)
|
||||
.bindRecentsDisplayModel(RecentsDisplayModel(sandboxContext))
|
||||
DaggerTestComponent.builder().bindSystemUiProxy(systemUiProxy)
|
||||
)
|
||||
sandboxContext.putObject(
|
||||
RotationTouchHelper.INSTANCE,
|
||||
@@ -122,8 +119,6 @@ interface TestComponent : LauncherAppComponent {
|
||||
interface Builder : LauncherAppComponent.Builder {
|
||||
@BindsInstance fun bindSystemUiProxy(proxy: SystemUiProxy): Builder
|
||||
|
||||
@BindsInstance fun bindRecentsDisplayModel(model: RecentsDisplayModel): Builder
|
||||
|
||||
override fun build(): TestComponent
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,14 +28,9 @@ import androidx.test.filters.SmallTest
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.launcher3.Flags.FLAG_ENABLE_FALLBACK_OVERVIEW_IN_WINDOW
|
||||
import com.android.launcher3.Flags.FLAG_ENABLE_LAUNCHER_OVERVIEW_IN_WINDOW
|
||||
import com.android.launcher3.dagger.LauncherAppComponent
|
||||
import com.android.launcher3.dagger.LauncherAppModule
|
||||
import com.android.launcher3.dagger.LauncherAppSingleton
|
||||
import com.android.launcher3.util.LauncherModelHelper
|
||||
import com.android.launcher3.util.window.CachedDisplayInfo
|
||||
import com.android.quickstep.fallback.window.RecentsDisplayModel
|
||||
import dagger.BindsInstance
|
||||
import dagger.Component
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
@@ -75,10 +70,6 @@ class RecentsDisplayModelTest {
|
||||
whenever(displayManager.getDisplay(anyInt())).thenReturn(display)
|
||||
|
||||
runOnMainSync { recentsDisplayModel = RecentsDisplayModel.INSTANCE.get(context) }
|
||||
context.initDaggerComponent(
|
||||
DaggerRecentsDisplayModelComponent.builder()
|
||||
.bindRecentsDisplayModel(recentsDisplayModel)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -125,14 +116,3 @@ class RecentsDisplayModelTest {
|
||||
InstrumentationRegistry.getInstrumentation().runOnMainSync { f.run() }
|
||||
}
|
||||
}
|
||||
|
||||
@LauncherAppSingleton
|
||||
@Component(modules = [LauncherAppModule::class])
|
||||
interface RecentsDisplayModelComponent : LauncherAppComponent {
|
||||
@Component.Builder
|
||||
interface Builder : LauncherAppComponent.Builder {
|
||||
@BindsInstance fun bindRecentsDisplayModel(model: RecentsDisplayModel): Builder
|
||||
|
||||
override fun build(): RecentsDisplayModelComponent
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user