1 /*
2  * Copyright (C) 2019 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 package com.android.customization.module.logging
17 
18 import android.stats.style.StyleEnums
19 import com.android.customization.model.grid.GridOption
20 import com.android.customization.module.logging.ThemesUserEventLogger.ClockSize
21 import com.android.customization.module.logging.ThemesUserEventLogger.ColorSource
22 import com.android.wallpaper.module.logging.TestUserEventLogger
23 import javax.inject.Inject
24 import javax.inject.Singleton
25 
26 /** Test implementation of [ThemesUserEventLogger]. */
27 @Singleton
28 class TestThemesUserEventLogger @Inject constructor() :
29     TestUserEventLogger(), ThemesUserEventLogger {
30     @ClockSize private var clockSize: Int = StyleEnums.CLOCK_SIZE_UNSPECIFIED
31     @ColorSource
32     var themeColorSource: Int = StyleEnums.COLOR_SOURCE_UNSPECIFIED
33         private set
34     var themeColorStyle: Int = -1
35         private set
36     var themeSeedColor: Int = -1
37         private set
38 
logThemeColorAppliednull39     override fun logThemeColorApplied(@ColorSource source: Int, style: Int, seedColor: Int) {
40         this.themeColorSource = source
41         this.themeColorStyle = style
42         this.themeSeedColor = seedColor
43     }
44 
logGridAppliednull45     override fun logGridApplied(grid: GridOption) {}
46 
logClockAppliednull47     override fun logClockApplied(clockId: String) {}
48 
logClockColorAppliednull49     override fun logClockColorApplied(seedColor: Int) {}
50 
logClockSizeAppliednull51     override fun logClockSizeApplied(@ClockSize clockSize: Int) {
52         this.clockSize = clockSize
53     }
54 
logThemedIconAppliednull55     override fun logThemedIconApplied(useThemeIcon: Boolean) {}
56 
logLockScreenNotificationAppliednull57     override fun logLockScreenNotificationApplied(showLockScreenNotifications: Boolean) {}
58 
logShortcutAppliednull59     override fun logShortcutApplied(shortcut: String, shortcutSlotId: String) {}
60 
logDarkThemeAppliednull61     override fun logDarkThemeApplied(useDarkTheme: Boolean) {}
62 
63     @ClockSize
getLoggedClockSizenull64     fun getLoggedClockSize(): Int {
65         return clockSize
66     }
67 }
68