diff options
5 files changed, 74 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/SharedConnectivityInputLog.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/SharedConnectivityInputLog.kt new file mode 100644 index 000000000000..5face22e505f --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/SharedConnectivityInputLog.kt @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.systemui.statusbar.pipeline.dagger + +import javax.inject.Qualifier + +/** Logs for connectivity-related inputs that are shared across wifi, mobile, etc. */ +@Qualifier +@MustBeDocumented +@kotlin.annotation.Retention(AnnotationRetention.RUNTIME) +annotation class SharedConnectivityInputLog diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt index 38a97752a5b4..0b9903de70d3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt @@ -130,6 +130,13 @@ abstract class StatusBarPipelineModule { @Provides @SysUISingleton + @SharedConnectivityInputLog + fun provideSharedConnectivityTableLogBuffer(factory: LogBufferFactory): LogBuffer { + return factory.create("SharedConnectivityInputLog", 30) + } + + @Provides + @SysUISingleton @MobileSummaryLog fun provideMobileSummaryLogBuffer(factory: TableLogBufferFactory): TableLogBuffer { return factory.create("MobileSummaryLog", 100) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ConnectivityInputLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ConnectivityInputLogger.kt new file mode 100644 index 000000000000..95548b84f769 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ConnectivityInputLogger.kt @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.systemui.statusbar.pipeline.shared + +import com.android.systemui.dagger.SysUISingleton +import com.android.systemui.plugins.log.LogBuffer +import com.android.systemui.plugins.log.LogLevel +import com.android.systemui.statusbar.pipeline.dagger.SharedConnectivityInputLog +import javax.inject.Inject + +/** Logs for connectivity-related inputs that are shared across wifi, mobile, etc. */ +@SysUISingleton +class ConnectivityInputLogger +@Inject +constructor( + @SharedConnectivityInputLog private val buffer: LogBuffer, +) { + fun logTuningChanged(tuningList: String?) { + buffer.log(TAG, LogLevel.DEBUG, { str1 = tuningList }, { "onTuningChanged: $str1" }) + } +} + +private const val TAG = "ConnectivityInputLogger" diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/data/repository/ConnectivityRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/data/repository/ConnectivityRepository.kt index 45c6d466f7e0..b8761584c64d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/data/repository/ConnectivityRepository.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/data/repository/ConnectivityRepository.kt @@ -26,7 +26,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dump.DumpManager import com.android.systemui.statusbar.phone.StatusBarIconController -import com.android.systemui.statusbar.pipeline.shared.ConnectivityPipelineLogger +import com.android.systemui.statusbar.pipeline.shared.ConnectivityInputLogger import com.android.systemui.statusbar.pipeline.shared.ConnectivityPipelineLogger.Companion.SB_LOGGING_TAG import com.android.systemui.statusbar.pipeline.shared.data.model.ConnectivitySlot import com.android.systemui.statusbar.pipeline.shared.data.model.ConnectivitySlots @@ -57,7 +57,7 @@ class ConnectivityRepositoryImpl @Inject constructor( private val connectivitySlots: ConnectivitySlots, context: Context, dumpManager: DumpManager, - logger: ConnectivityPipelineLogger, + logger: ConnectivityInputLogger, @Application scope: CoroutineScope, tunerService: TunerService, ) : ConnectivityRepository, Dumpable { @@ -77,7 +77,7 @@ class ConnectivityRepositoryImpl @Inject constructor( if (key != HIDDEN_ICONS_TUNABLE_KEY) { return } - logger.logInputChange("onTuningChanged", newHideList) + logger.logTuningChanged(newHideList) val outputList = newHideList?.split(",")?.toSlotSet(connectivitySlots) ?: defaultHiddenIcons diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/data/repository/ConnectivityRepositoryImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/data/repository/ConnectivityRepositoryImplTest.kt index 6dbee2f26ff9..b0a41ce2d349 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/data/repository/ConnectivityRepositoryImplTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/shared/data/repository/ConnectivityRepositoryImplTest.kt @@ -19,7 +19,7 @@ package com.android.systemui.statusbar.pipeline.shared.data.repository import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.dump.DumpManager -import com.android.systemui.statusbar.pipeline.shared.ConnectivityPipelineLogger +import com.android.systemui.statusbar.pipeline.shared.ConnectivityInputLogger import com.android.systemui.statusbar.pipeline.shared.data.model.ConnectivitySlot import com.android.systemui.statusbar.pipeline.shared.data.model.ConnectivitySlots import com.android.systemui.statusbar.pipeline.shared.data.repository.ConnectivityRepositoryImpl.Companion.DEFAULT_HIDDEN_ICONS_RESOURCE @@ -52,7 +52,7 @@ class ConnectivityRepositoryImplTest : SysuiTestCase() { @Mock private lateinit var connectivitySlots: ConnectivitySlots @Mock private lateinit var dumpManager: DumpManager - @Mock private lateinit var logger: ConnectivityPipelineLogger + @Mock private lateinit var logger: ConnectivityInputLogger private lateinit var scope: CoroutineScope @Mock private lateinit var tunerService: TunerService |