1 package com.android.customization.testing 2 3 import android.app.WallpaperColors 4 import android.content.Context 5 import android.content.res.Resources 6 import androidx.activity.ComponentActivity 7 import com.android.customization.model.color.WallpaperColorResources 8 import com.android.customization.module.CustomizationInjector 9 import com.android.customization.module.CustomizationPreferences 10 import com.android.customization.module.logging.ThemesUserEventLogger 11 import com.android.customization.picker.clock.domain.interactor.ClockPickerInteractor 12 import com.android.customization.picker.clock.ui.view.ClockViewFactory 13 import com.android.customization.picker.clock.ui.viewmodel.ClockCarouselViewModel 14 import com.android.customization.picker.clock.ui.viewmodel.ClockSettingsViewModel 15 import com.android.customization.picker.color.domain.interactor.ColorPickerInteractor 16 import com.android.customization.picker.color.ui.viewmodel.ColorPickerViewModel 17 import com.android.customization.picker.quickaffordance.domain.interactor.KeyguardQuickAffordancePickerInteractor 18 import com.android.systemui.shared.clocks.ClockRegistry 19 import com.android.wallpaper.module.logging.UserEventLogger 20 import com.android.wallpaper.picker.customization.data.repository.WallpaperColorsRepository 21 import com.android.wallpaper.testing.TestInjector 22 import javax.inject.Inject 23 import javax.inject.Singleton 24 25 @Singleton 26 open class TestCustomizationInjector 27 @Inject 28 constructor( 29 private val customPrefs: TestDefaultCustomizationPreferences, 30 private val themesUserEventLogger: ThemesUserEventLogger 31 ) : TestInjector(themesUserEventLogger), CustomizationInjector { 32 ///////////////// 33 // CustomizationInjector implementations 34 ///////////////// 35 getCustomizationPreferencesnull36 override fun getCustomizationPreferences(context: Context): CustomizationPreferences { 37 return customPrefs 38 } 39 getKeyguardQuickAffordancePickerInteractornull40 override fun getKeyguardQuickAffordancePickerInteractor( 41 context: Context 42 ): KeyguardQuickAffordancePickerInteractor { 43 throw UnsupportedOperationException("not implemented") 44 } 45 getClockRegistrynull46 override fun getClockRegistry(context: Context): ClockRegistry? { 47 throw UnsupportedOperationException("not implemented") 48 } 49 getClockPickerInteractornull50 override fun getClockPickerInteractor(context: Context): ClockPickerInteractor { 51 throw UnsupportedOperationException("not implemented") 52 } 53 getWallpaperColorResourcesnull54 override fun getWallpaperColorResources( 55 wallpaperColors: WallpaperColors, 56 context: Context 57 ): WallpaperColorResources { 58 throw UnsupportedOperationException("not implemented") 59 } 60 getColorPickerInteractornull61 override fun getColorPickerInteractor( 62 context: Context, 63 wallpaperColorsRepository: WallpaperColorsRepository, 64 ): ColorPickerInteractor { 65 throw UnsupportedOperationException("not implemented") 66 } 67 getColorPickerViewModelFactorynull68 override fun getColorPickerViewModelFactory( 69 context: Context, 70 wallpaperColorsRepository: WallpaperColorsRepository, 71 ): ColorPickerViewModel.Factory { 72 throw UnsupportedOperationException("not implemented") 73 } 74 getClockCarouselViewModelFactorynull75 override fun getClockCarouselViewModelFactory( 76 interactor: ClockPickerInteractor, 77 clockViewFactory: ClockViewFactory, 78 resources: Resources, 79 ): ClockCarouselViewModel.Factory { 80 throw UnsupportedOperationException("not implemented") 81 } 82 getClockViewFactorynull83 override fun getClockViewFactory(activity: ComponentActivity): ClockViewFactory { 84 throw UnsupportedOperationException("not implemented") 85 } 86 getClockSettingsViewModelFactorynull87 override fun getClockSettingsViewModelFactory( 88 context: Context, 89 wallpaperColorsRepository: WallpaperColorsRepository, 90 clockViewFactory: ClockViewFactory, 91 ): ClockSettingsViewModel.Factory { 92 throw UnsupportedOperationException("not implemented") 93 } 94 95 ///////////////// 96 // TestInjector overrides 97 ///////////////// 98 getUserEventLoggernull99 override fun getUserEventLogger(): UserEventLogger { 100 return themesUserEventLogger 101 } 102 } 103