Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbb63a99 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov Committed by Android (Google) Code Review
Browse files

Merge "[SB][Sat] Add verbose log buffer for satellite logs." into 24D1-dev

parents 801803c1 5bfa21f6
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
/*
 * 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
+10 −3
Original line number Diff line number Diff line
@@ -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 =
+7 −4
Original line number Diff line number Diff line
@@ -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
+5 −3
Original line number Diff line number Diff line
@@ -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)
+2 −2
Original line number Diff line number Diff line
@@ -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 =
Loading