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

Commit 54906b5d authored by Austin Wang's avatar Austin Wang
Browse files

Make WallpaperModelFactory injectable (2/3)

Flag: com.android.wallpaper.multi_crop_preview_ui_flag
Bug: 303457890
Test: build, presubmit
Change-Id: I2f656a9adb54759b444f8e5648c19a338098724c
parent 0421eb5e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import com.android.customization.module.ThemePickerInjector
import com.android.customization.module.logging.ThemesUserEventLogger
import com.android.customization.module.logging.ThemesUserEventLoggerImpl
import com.android.wallpaper.module.logging.UserEventLogger
import com.android.wallpaper.util.converter.DefaultWallpaperModelFactory
import dagger.Binds
import dagger.Module
import dagger.Provides
@@ -51,5 +52,11 @@ abstract class AppModule {
        ): WallpaperPreferences {
            return DefaultCustomizationPreferences(context)
        }

        @Provides
        @Singleton
        fun provideDefaultWallpaperModelFactory(): DefaultWallpaperModelFactory {
            return DefaultWallpaperModelFactory()
        }
    }
}
+10 −0
Original line number Diff line number Diff line
@@ -13,8 +13,10 @@ import com.android.wallpaper.module.logging.TestUserEventLogger
import com.android.wallpaper.module.logging.UserEventLogger
import com.android.wallpaper.testing.TestInjector
import com.android.wallpaper.testing.TestWallpaperPreferences
import com.android.wallpaper.util.converter.DefaultWallpaperModelFactory
import dagger.Binds
import dagger.Module
import dagger.Provides
import dagger.hilt.components.SingletonComponent
import dagger.hilt.testing.TestInstallIn
import javax.inject.Singleton
@@ -57,4 +59,12 @@ abstract class TestModule {
    abstract fun bindCustomizationPrefs(
        impl: TestDefaultCustomizationPreferences
    ): CustomizationPreferences

    companion object {
        @Provides
        @Singleton
        fun provideDefaultWallpaperModelFactory(): DefaultWallpaperModelFactory {
            return DefaultWallpaperModelFactory()
        }
    }
}