• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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.pipeline.mobile.ui
18 
19 import android.view.View
20 import com.android.systemui.common.shared.model.Icon
21 import com.android.systemui.dagger.SysUISingleton
22 import com.android.systemui.plugins.log.LogBuffer
23 import com.android.systemui.plugins.log.LogLevel
24 import com.android.systemui.statusbar.pipeline.dagger.VerboseMobileViewLog
25 import com.android.systemui.statusbar.pipeline.mobile.ui.MobileViewLogger.Companion.getIdForLogging
26 import com.android.systemui.statusbar.pipeline.mobile.ui.model.SignalIconModel
27 import javax.inject.Inject
28 
29 /**
30  * Logs for **verbose** changes with the new mobile views.
31  *
32  * This is a hopefully temporary log until we resolve some open bugs (b/267236367, b/269565345,
33  * b/270300839).
34  */
35 @SysUISingleton
36 class VerboseMobileViewLogger
37 @Inject
38 constructor(
39     @VerboseMobileViewLog private val buffer: LogBuffer,
40 ) {
logBinderReceivedSignalIconnull41     fun logBinderReceivedSignalIcon(parentView: View, subId: Int, icon: SignalIconModel) {
42         buffer.log(
43             TAG,
44             LogLevel.VERBOSE,
45             {
46                 str1 = parentView.getIdForLogging()
47                 int1 = subId
48                 int2 = icon.level
49                 bool1 = icon.showExclamationMark
50             },
51             {
52                 "Binder[subId=$int1, viewId=$str1] received new signal icon: " +
53                     "level=$int2 showExclamation=$bool1"
54             },
55         )
56     }
57 
logBinderReceivedNetworkTypeIconnull58     fun logBinderReceivedNetworkTypeIcon(parentView: View, subId: Int, icon: Icon.Resource?) {
59         buffer.log(
60             TAG,
61             LogLevel.VERBOSE,
62             {
63                 str1 = parentView.getIdForLogging()
64                 int1 = subId
65                 bool1 = icon != null
66                 int2 = icon?.res ?: -1
67             },
68             {
69                 "Binder[subId=$int1, viewId=$str1] received new network type icon: " +
70                     if (bool1) "resId=$int2" else "null"
71             },
72         )
73     }
74 }
75 
76 private const val TAG = "VerboseMobileViewLogger"
77