diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/DeviceBasedSatelliteInputLog.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/DeviceBasedSatelliteInputLog.kt new file mode 100644 index 0000000000000000000000000000000000000000..73c015d234f564063cc823e131e4f72b6d8d93e4 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/DeviceBasedSatelliteInputLog.kt @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2024 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 device-based satellite events that are **not** that frequent/chatty. + * + * For chatty logs, use [VerboseDeviceBasedSatelliteInputLog] instead. + */ +@Qualifier +@MustBeDocumented +@Retention(AnnotationRetention.RUNTIME) +annotation class DeviceBasedSatelliteInputLog 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 3811d6b91a52f9ae0065a048eed82750e8972c5c..9810af75fa254f391593ca82c5c81af0f0194a7b 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 @@ -274,9 +274,16 @@ abstract class StatusBarPipelineModule { @Provides @SysUISingleton - @OemSatelliteInputLog - fun provideOemSatelliteInputLog(factory: LogBufferFactory): LogBuffer { - return factory.create("DeviceBasedSatelliteInputLog", 150) + @DeviceBasedSatelliteInputLog + fun provideDeviceBasedSatelliteInputLog(factory: LogBufferFactory): LogBuffer { + return factory.create("DeviceBasedSatelliteInputLog", 200) + } + + @Provides + @SysUISingleton + @VerboseDeviceBasedSatelliteInputLog + fun provideVerboseDeviceBasedSatelliteInputLog(factory: LogBufferFactory): LogBuffer { + return factory.create("VerboseDeviceBasedSatelliteInputLog", 200) } const val FIRST_MOBILE_SUB_SHOWING_NETWORK_TYPE_ICON = diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/OemSatelliteInputLog.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/VerboseDeviceBasedSatelliteInputLog.kt similarity index 75% rename from packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/OemSatelliteInputLog.kt rename to packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/VerboseDeviceBasedSatelliteInputLog.kt index 252945f1ed6af62c9f4ed6f6eb9d929493cd79ff..af6805513c892ff33970e8ca201b85afb425b988 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/OemSatelliteInputLog.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/VerboseDeviceBasedSatelliteInputLog.kt @@ -16,11 +16,14 @@ package com.android.systemui.statusbar.pipeline.dagger -import com.android.systemui.statusbar.pipeline.satellite.data.DeviceBasedSatelliteRepository import javax.inject.Qualifier -/** Detailed [DeviceBasedSatelliteRepository] logs */ +/** + * Logs for device-based satellite events that are frequent/chatty. + * + * For non-chatty logs, use [DeviceBasedSatelliteInputLog] instead. + */ @Qualifier @MustBeDocumented -@kotlin.annotation.Retention(AnnotationRetention.RUNTIME) -annotation class OemSatelliteInputLog +@Retention(AnnotationRetention.RUNTIME) +annotation class VerboseDeviceBasedSatelliteInputLog diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt index 788375d7bdd2427c54a67997330cefe3850e8123..879aa1d5a956bbe319bae9bbf2b7f96b7cac9b67 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt @@ -30,7 +30,8 @@ import com.android.systemui.log.LogBuffer import com.android.systemui.log.core.LogLevel import com.android.systemui.log.core.MessageInitializer import com.android.systemui.log.core.MessagePrinter -import com.android.systemui.statusbar.pipeline.dagger.OemSatelliteInputLog +import com.android.systemui.statusbar.pipeline.dagger.DeviceBasedSatelliteInputLog +import com.android.systemui.statusbar.pipeline.dagger.VerboseDeviceBasedSatelliteInputLog import com.android.systemui.statusbar.pipeline.satellite.data.DeviceBasedSatelliteRepository import com.android.systemui.statusbar.pipeline.satellite.data.prod.SatelliteSupport.Companion.whenSupported import com.android.systemui.statusbar.pipeline.satellite.data.prod.SatelliteSupport.NotSupported @@ -132,7 +133,8 @@ constructor( satelliteManagerOpt: Optional<SatelliteManager>, @Background private val bgDispatcher: CoroutineDispatcher, @Application private val scope: CoroutineScope, - @OemSatelliteInputLog private val logBuffer: LogBuffer, + @DeviceBasedSatelliteInputLog private val logBuffer: LogBuffer, + @VerboseDeviceBasedSatelliteInputLog private val verboseLogBuffer: LogBuffer, private val systemClock: SystemClock, ) : DeviceBasedSatelliteRepository { @@ -233,7 +235,7 @@ constructor( private fun signalStrengthFlow(sm: SupportedSatelliteManager) = conflatedCallbackFlow { val cb = NtnSignalStrengthCallback { signalStrength -> - logBuffer.i({ int1 = signalStrength.level }) { + verboseLogBuffer.i({ int1 = signalStrength.level }) { "onNtnSignalStrengthChanged: level=$int1" } trySend(signalStrength.level) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/domain/interactor/DeviceBasedSatelliteInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/domain/interactor/DeviceBasedSatelliteInteractor.kt index 5b954b272044ce6ae551b397a06961ad79f58e7d..b66ace6b0fe3386090c2d132f3b7e33674be20b3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/domain/interactor/DeviceBasedSatelliteInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/domain/interactor/DeviceBasedSatelliteInteractor.kt @@ -21,7 +21,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.log.LogBuffer import com.android.systemui.log.core.LogLevel -import com.android.systemui.statusbar.pipeline.dagger.OemSatelliteInputLog +import com.android.systemui.statusbar.pipeline.dagger.DeviceBasedSatelliteInputLog import com.android.systemui.statusbar.pipeline.mobile.domain.interactor.MobileIconsInteractor import com.android.systemui.statusbar.pipeline.satellite.data.DeviceBasedSatelliteRepository import com.android.systemui.statusbar.pipeline.satellite.shared.model.SatelliteConnectionState @@ -48,7 +48,7 @@ constructor( deviceProvisioningInteractor: DeviceProvisioningInteractor, wifiInteractor: WifiInteractor, @Application scope: CoroutineScope, - @OemSatelliteInputLog private val logBuffer: LogBuffer, + @DeviceBasedSatelliteInputLog private val logBuffer: LogBuffer, ) { /** Must be observed by any UI showing Satellite iconography */ val isSatelliteAllowed = diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModel.kt index d76fd40522e43147797c1372a35850b5c794fe63..0ed1b9b0f77a040daf1132a88ef283424fe0316a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/ui/viewmodel/DeviceBasedSatelliteViewModel.kt @@ -24,7 +24,7 @@ import com.android.systemui.log.LogBuffer import com.android.systemui.log.core.LogLevel import com.android.systemui.res.R import com.android.systemui.statusbar.pipeline.airplane.data.repository.AirplaneModeRepository -import com.android.systemui.statusbar.pipeline.dagger.OemSatelliteInputLog +import com.android.systemui.statusbar.pipeline.dagger.DeviceBasedSatelliteInputLog import com.android.systemui.statusbar.pipeline.satellite.domain.interactor.DeviceBasedSatelliteInteractor import com.android.systemui.statusbar.pipeline.satellite.shared.model.SatelliteConnectionState import com.android.systemui.statusbar.pipeline.satellite.ui.model.SatelliteIconModel @@ -70,7 +70,7 @@ constructor( interactor: DeviceBasedSatelliteInteractor, @Application scope: CoroutineScope, airplaneModeRepository: AirplaneModeRepository, - @OemSatelliteInputLog logBuffer: LogBuffer, + @DeviceBasedSatelliteInputLog logBuffer: LogBuffer, ) : DeviceBasedSatelliteViewModel { private val shouldShowIcon: Flow<Boolean> = interactor.areAllConnectionsOutOfService.flatMapLatest { allOos -> diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImplTest.kt index 77e48bff04de4909d2db229c6db9e869ebc5085f..8debe29d2493c768342722ec84959dfe10a0af86 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImplTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImplTest.kt @@ -88,7 +88,8 @@ class DeviceBasedSatelliteRepositoryImplTest : SysuiTestCase() { Optional.empty(), dispatcher, testScope.backgroundScope, - FakeLogBuffer.Factory.create(), + logBuffer = FakeLogBuffer.Factory.create(), + verboseLogBuffer = FakeLogBuffer.Factory.create(), systemClock, ) @@ -382,7 +383,8 @@ class DeviceBasedSatelliteRepositoryImplTest : SysuiTestCase() { if (satMan != null) Optional.of(satMan) else Optional.empty(), dispatcher, testScope.backgroundScope, - FakeLogBuffer.Factory.create(), + logBuffer = FakeLogBuffer.Factory.create(), + verboseLogBuffer = FakeLogBuffer.Factory.create(), systemClock, ) }