1 /* 2 * Copyright (C) 2024 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.systemui.keyguard.data.repository 18 19 import android.content.applicationContext 20 import android.os.fakeExecutorHandler 21 import com.android.systemui.keyguard.domain.interactor.keyguardBlueprintInteractor 22 import com.android.systemui.keyguard.domain.interactor.keyguardClockInteractor 23 import com.android.systemui.keyguard.ui.view.layout.blueprints.DefaultKeyguardBlueprint 24 import com.android.systemui.keyguard.ui.view.layout.blueprints.SplitShadeKeyguardBlueprint 25 import com.android.systemui.keyguard.ui.view.layout.sections.ClockSection 26 import com.android.systemui.keyguard.ui.view.layout.sections.SmartspaceSection 27 import com.android.systemui.keyguard.ui.viewmodel.aodBurnInViewModel 28 import com.android.systemui.keyguard.ui.viewmodel.keyguardClockViewModel 29 import com.android.systemui.keyguard.ui.viewmodel.keyguardRootViewModel 30 import com.android.systemui.keyguard.ui.viewmodel.keyguardSmartspaceViewModel 31 import com.android.systemui.kosmos.Kosmos 32 import com.android.systemui.log.logcatLogBuffer 33 import com.android.systemui.shade.LargeScreenHeaderHelper 34 import java.util.Optional 35 import org.mockito.Mockito.spy 36 import org.mockito.kotlin.mock 37 38 val Kosmos.keyguardClockSection: ClockSection by <lambda>null39 Kosmos.Fixture { 40 ClockSection( 41 clockInteractor = keyguardClockInteractor, 42 keyguardClockViewModel = keyguardClockViewModel, 43 context = applicationContext, 44 smartspaceViewModel = keyguardSmartspaceViewModel, 45 blueprintInteractor = { keyguardBlueprintInteractor }, 46 rootViewModel = keyguardRootViewModel, 47 aodBurnInViewModel = aodBurnInViewModel, 48 largeScreenHeaderHelperLazy = { mock<LargeScreenHeaderHelper>() }, 49 ) 50 } 51 52 val Kosmos.keyguardSmartspaceSection: SmartspaceSection by <lambda>null53 Kosmos.Fixture { mock<SmartspaceSection>() } 54 55 val Kosmos.defaultKeyguardBlueprint by <lambda>null56 Kosmos.Fixture { 57 DefaultKeyguardBlueprint( 58 defaultIndicationAreaSection = mock(), 59 defaultDeviceEntrySection = mock(), 60 defaultShortcutsSection = mock(), 61 defaultAmbientIndicationAreaSection = Optional.of(mock()), 62 defaultSettingsPopupMenuSection = mock(), 63 defaultStatusBarSection = mock(), 64 defaultNotificationStackScrollLayoutSection = mock(), 65 aodPromotedNotificationSection = mock(), 66 aodNotificationIconsSection = mock(), 67 aodBurnInSection = mock(), 68 clockSection = keyguardClockSection, 69 smartspaceSection = keyguardSmartspaceSection, 70 keyguardSliceViewSection = mock(), 71 udfpsAccessibilityOverlaySection = mock(), 72 accessibilityActionsSection = mock(), 73 ) 74 } 75 76 val Kosmos.splitShadeBlueprint by <lambda>null77 Kosmos.Fixture { 78 SplitShadeKeyguardBlueprint( 79 defaultIndicationAreaSection = mock(), 80 defaultDeviceEntrySection = mock(), 81 defaultShortcutsSection = mock(), 82 defaultAmbientIndicationAreaSection = Optional.of(mock()), 83 defaultSettingsPopupMenuSection = mock(), 84 defaultStatusBarSection = mock(), 85 splitShadeNotificationStackScrollLayoutSection = mock(), 86 splitShadeGuidelines = mock(), 87 aodPromotedNotificationSection = mock(), 88 aodNotificationIconsSection = mock(), 89 aodBurnInSection = mock(), 90 clockSection = keyguardClockSection, 91 smartspaceSection = keyguardSmartspaceSection, 92 mediaSection = mock(), 93 accessibilityActionsSection = mock(), 94 ) 95 } 96 97 val Kosmos.keyguardBlueprintRepository by <lambda>null98 Kosmos.Fixture { 99 spy( 100 KeyguardBlueprintRepository( 101 blueprints = setOf(defaultKeyguardBlueprint, splitShadeBlueprint), 102 handler = fakeExecutorHandler, 103 assert = mock(), 104 log = logcatLogBuffer("blueprints"), 105 ) 106 ) 107 } 108