Merge "Allow nullable in LogBuffers in ClockEventController" into tm-qpr-dev

This commit is contained in:
Hawkwood Glazier
2022-10-31 15:17:02 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 3 deletions

View File

@@ -69,14 +69,17 @@ open class ClockEventController @Inject constructor(
private val context: Context, private val context: Context,
@Main private val mainExecutor: Executor, @Main private val mainExecutor: Executor,
@Background private val bgExecutor: Executor, @Background private val bgExecutor: Executor,
@KeyguardClockLog private val logBuffer: LogBuffer, @KeyguardClockLog private val logBuffer: LogBuffer?,
private val featureFlags: FeatureFlags private val featureFlags: FeatureFlags
) { ) {
var clock: ClockController? = null var clock: ClockController? = null
set(value) { set(value) {
field = value field = value
if (value != null) { if (value != null) {
value.setLogBuffer(logBuffer) if (logBuffer != null) {
value.setLogBuffer(logBuffer)
}
value.initialize(resources, dozeAmount, 0f) value.initialize(resources, dozeAmount, 0f)
updateRegionSamplers(value) updateRegionSamplers(value)
} }

View File

@@ -65,7 +65,6 @@ import org.mockito.junit.MockitoJUnit
class ClockEventControllerTest : SysuiTestCase() { class ClockEventControllerTest : SysuiTestCase() {
@JvmField @Rule val mockito = MockitoJUnit.rule() @JvmField @Rule val mockito = MockitoJUnit.rule()
@Mock private lateinit var keyguardInteractor: KeyguardInteractor
@Mock private lateinit var broadcastDispatcher: BroadcastDispatcher @Mock private lateinit var broadcastDispatcher: BroadcastDispatcher
@Mock private lateinit var batteryController: BatteryController @Mock private lateinit var batteryController: BatteryController
@Mock private lateinit var keyguardUpdateMonitor: KeyguardUpdateMonitor @Mock private lateinit var keyguardUpdateMonitor: KeyguardUpdateMonitor