• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.wallpaper.testing
18 
19 import com.android.wallpaper.picker.category.domain.interactor.OnDeviceWallpapersInteractor
20 import com.android.wallpaper.picker.data.WallpaperModel
21 import javax.inject.Inject
22 import javax.inject.Singleton
23 import kotlinx.coroutines.flow.Flow
24 import kotlinx.coroutines.flow.MutableStateFlow
25 
26 @Singleton
27 class FakeOnDeviceWallpapersInteractor @Inject constructor() : OnDeviceWallpapersInteractor {
28     private val _defaultWallpapers = MutableStateFlow(fakeOnDeviceWallpapers)
29 
30     override val defaultWallpapers: Flow<List<WallpaperModel>>
31         get() = _defaultWallpapers
32 
setDefaultWallpapersnull33     fun setDefaultWallpapers(newWallpapers: List<WallpaperModel.StaticWallpaperModel>) {
34         _defaultWallpapers.value = newWallpapers
35     }
36 
37     companion object {
38         val fakeOnDeviceWallpapers =
39             listOf(
40                 WallpaperModelUtils.getStaticWallpaperModel(
41                     wallpaperId = "testId1",
42                     collectionId = "testCollection1",
43                     title = "onDeviceTitle1",
44                 ),
45                 WallpaperModelUtils.getStaticWallpaperModel(
46                     wallpaperId = "testId2",
47                     collectionId = "testCollection3",
48                     title = "onDeviceTitle2",
49                 ),
50                 WallpaperModelUtils.getStaticWallpaperModel(
51                     wallpaperId = "testId3",
52                     collectionId = "testCollection3",
53                     title = "onDeviceTitle3",
54                 ),
55             )
56     }
57 }
58