<lambda>null1 package com.android.customization.picker.clock.ui
2 
3 import android.content.res.Resources
4 import android.view.View
5 import androidx.lifecycle.LifecycleOwner
6 import com.android.customization.picker.clock.data.repository.FakeClockPickerRepository
7 import com.android.customization.picker.clock.ui.FakeClockViewFactory.Companion.fakeClocks
8 import com.android.customization.picker.clock.ui.view.ClockViewFactory
9 import com.android.systemui.plugins.clocks.ClockConfig
10 import com.android.systemui.plugins.clocks.ClockController
11 import com.android.systemui.plugins.clocks.ClockEvents
12 import com.android.systemui.plugins.clocks.ClockFaceController
13 import java.io.PrintWriter
14 
15 /**
16  * This is a fake [ClockViewFactory]. Only implement the function if it's actually called in a test.
17  */
18 class FakeClockViewFactory(
19     val clockControllers: MutableMap<String, ClockController> = fakeClocks.toMutableMap(),
20 ) : ClockViewFactory {
21 
22     class FakeClockController(
23         override var config: ClockConfig,
24     ) : ClockController {
25         override val smallClock: ClockFaceController
26             get() = TODO("Not yet implemented")
27 
28         override val largeClock: ClockFaceController
29             get() = TODO("Not yet implemented")
30 
31         override val events: ClockEvents
32             get() = TODO("Not yet implemented")
33 
34         override fun initialize(resources: Resources, dozeFraction: Float, foldFraction: Float) =
35             TODO("Not yet implemented")
36 
37         override fun dump(pw: PrintWriter) = TODO("Not yet implemented")
38     }
39 
40     override fun getController(clockId: String): ClockController = clockControllers.get(clockId)!!
41 
42     override fun setReactiveTouchInteractionEnabled(clockId: String, enable: Boolean) {
43         TODO("Not yet implemented")
44     }
45 
46     override fun getLargeView(clockId: String): View {
47         TODO("Not yet implemented")
48     }
49 
50     override fun getSmallView(clockId: String): View {
51         TODO("Not yet implemented")
52     }
53 
54     override fun updateColorForAllClocks(seedColor: Int?) {
55         TODO("Not yet implemented")
56     }
57 
58     override fun updateColor(clockId: String, seedColor: Int?) {
59         TODO("Not yet implemented")
60     }
61 
62     override fun updateRegionDarkness() {
63         TODO("Not yet implemented")
64     }
65 
66     override fun updateTimeFormat(clockId: String) {
67         TODO("Not yet implemented")
68     }
69 
70     override fun registerTimeTicker(owner: LifecycleOwner) {
71         TODO("Not yet implemented")
72     }
73 
74     override fun onDestroy() {
75         TODO("Not yet implemented")
76     }
77 
78     override fun unregisterTimeTicker(owner: LifecycleOwner) {
79         TODO("Not yet implemented")
80     }
81 
82     companion object {
83         val fakeClocks =
84             FakeClockPickerRepository.fakeClocks
85                 .map { clock ->
86                     clock.clockId to
87                         FakeClockController(
88                             ClockConfig(
89                                 id = clock.clockId,
90                                 name = "Name: ${clock.clockId}",
91                                 description = "Desc: ${clock.clockId}"
92                             )
93                         )
94                 }
95                 .toMap()
96     }
97 }
98