1 /*
2  * Copyright (C) 2021 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.statusbar.gesture
18 
19 import com.android.systemui.dagger.SysUISingleton
20 import com.android.systemui.log.dagger.SwipeUpLog
21 import com.android.systemui.log.LogBuffer
22 import com.android.systemui.log.core.LogLevel
23 import javax.inject.Inject
24 
25 /** Log messages for [SwipeUpGestureHandler]. */
26 @SysUISingleton
27 class SwipeUpGestureLogger @Inject constructor(
28     @SwipeUpLog private val buffer: LogBuffer,
29 ) {
logGestureDetectionStartednull30     fun logGestureDetectionStarted(tag: String, y: Int) {
31         buffer.log(
32             tag,
33             LogLevel.DEBUG,
34             { int1 = y },
35             { "Beginning gesture detection. y=$int1" }
36         )
37     }
38 
logGestureDetectionEndedWithoutTriggeringnull39     fun logGestureDetectionEndedWithoutTriggering(tag: String, y: Int) {
40         buffer.log(
41             tag,
42             LogLevel.DEBUG,
43             { int1 = y },
44             { "Gesture finished; no swipe up gesture detected. Final y=$int1" }
45         )
46     }
47 
logGestureDetectednull48     fun logGestureDetected(tag: String, y: Int) {
49         buffer.log(
50             tag,
51             LogLevel.INFO,
52             { int1 = y },
53             { "Gesture detected; notifying callbacks. y=$int1" }
54         )
55     }
56 
logInputListeningStartednull57     fun logInputListeningStarted(tag: String) {
58         buffer.log(tag, LogLevel.VERBOSE, {}, { "Input listening started "})
59     }
60 
logInputListeningStoppednull61     fun logInputListeningStopped(tag: String) {
62         buffer.log(tag, LogLevel.VERBOSE, {}, { "Input listening stopped "})
63     }
64 }
65