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

Commit b16114e3 authored by Chris Poultney's avatar Chris Poultney
Browse files

Makes fake EffectsController injectable

Bug: 331594637
Flag: NA
Test: picker launches
Change-Id: I52bf54b49443a59fd42dcff74461287e355c5791
parent 7b448641
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import javax.inject.Singleton
/** This class provides the singleton scoped effects controller for wallpaper picker. */
@InstallIn(SingletonComponent::class)
@Module
internal abstract class EffectsModule {
abstract class EffectsModule {

    @Binds
    @Singleton
+11 −1
Original line number Diff line number Diff line
@@ -24,12 +24,15 @@ import com.android.customization.module.logging.TestThemesUserEventLogger
import com.android.customization.module.logging.ThemesUserEventLogger
import com.android.customization.testing.TestCustomizationInjector
import com.android.customization.testing.TestDefaultCustomizationPreferences
import com.android.wallpaper.effects.EffectsController
import com.android.wallpaper.effects.FakeEffectsController
import com.android.wallpaper.module.Injector
import com.android.wallpaper.module.PartnerProvider
import com.android.wallpaper.module.WallpaperPreferences
import com.android.wallpaper.module.logging.TestUserEventLogger
import com.android.wallpaper.module.logging.UserEventLogger
import com.android.wallpaper.modules.ThemePickerAppModule
import com.android.wallpaper.picker.di.modules.EffectsModule
import com.android.wallpaper.picker.preview.data.util.DefaultLiveWallpaperDownloader
import com.android.wallpaper.picker.preview.data.util.LiveWallpaperDownloader
import com.android.wallpaper.picker.preview.ui.util.DefaultImageEffectDialogUtil
@@ -45,7 +48,10 @@ import dagger.hilt.testing.TestInstallIn
import javax.inject.Singleton

@Module
@TestInstallIn(components = [SingletonComponent::class], replaces = [ThemePickerAppModule::class])
@TestInstallIn(
    components = [SingletonComponent::class],
    replaces = [EffectsModule::class, ThemePickerAppModule::class]
)
abstract class ThemePickerTestModule {
    //// WallpaperPicker2 prod

@@ -95,6 +101,10 @@ abstract class ThemePickerTestModule {
        impl: DefaultImageEffectDialogUtil
    ): ImageEffectDialogUtil

    @Binds
    @Singleton
    abstract fun bindEffectsController(impl: FakeEffectsController): EffectsController

    companion object {
        @Provides
        @Singleton