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

Commit 3a4245bb authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB Refactor] Remove non-mobile usages of MobileInputLogger.

Also removes the `logInputChange` and `logOutputChange` methods, since
now all logs to this logger are, by definition, input changes.

Also lints the ConnectivityRepository(Test) files, since they apparently
were incorrectly linted before.

Bug: 238425913
Test: atest MobileInputLoggerTest
Test: `adb shell dumpsys activity service
com.android.systemui/.SystemUIService MobileInputLog` -> verify logs
appear

Change-Id: I469cd3aaa7205694229c6f8cb08480f37af6fe80
parent 77a386eb
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -265,16 +265,6 @@ public class LogModule {
        return factory.create("MediaCarouselCtlrLog", 20);
    }

    /**
     * Provides a {@link LogBuffer} for use in the status bar connectivity pipeline
     */
    @Provides
    @SysUISingleton
    @StatusBarConnectivityLog
    public static LogBuffer provideStatusBarConnectivityBuffer(LogBufferFactory factory) {
        return factory.create("SbConnectivity", 64);
    }

    /** Allows logging buffers to be tweaked via adb on debug builds but not on prod builds. */
    @Provides
    @SysUISingleton
+7 −17
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 The Android Open Source Project
 * 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.
@@ -14,22 +14,12 @@
 * limitations under the License.
 */

package com.android.systemui.log.dagger;
package com.android.systemui.statusbar.pipeline.dagger

import static java.lang.annotation.RetentionPolicy.RUNTIME;
import javax.inject.Qualifier

import com.android.systemui.plugins.log.LogBuffer;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;

import javax.inject.Qualifier;

/**
 * A {@link LogBuffer} for status bar connectivity events.
 */
/** Logs for inputs into the mobile pipeline. */
@Qualifier
@Documented
@Retention(RUNTIME)
public @interface StatusBarConnectivityLog {
}
@MustBeDocumented
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
annotation class MobileInputLog
+7 −0
Original line number Diff line number Diff line
@@ -141,5 +141,12 @@ abstract class StatusBarPipelineModule {
        fun provideMobileSummaryLogBuffer(factory: TableLogBufferFactory): TableLogBuffer {
            return factory.create("MobileSummaryLog", 100)
        }

        @Provides
        @SysUISingleton
        @MobileInputLog
        fun provideMobileInputLogBuffer(factory: LogBufferFactory): LogBuffer {
            return factory.create("MobileInputLog", 100)
        }
    }
}
+4 −5
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ import com.android.systemui.statusbar.pipeline.mobile.data.model.NetworkNameMode
import com.android.systemui.statusbar.pipeline.mobile.data.model.SubscriptionModel
import com.android.systemui.statusbar.pipeline.mobile.data.repository.MobileConnectionsRepository
import com.android.systemui.statusbar.pipeline.mobile.shared.MobileInputLogger
import com.android.systemui.statusbar.pipeline.mobile.shared.MobileInputLogger.Companion.logInputChange
import com.android.systemui.statusbar.pipeline.mobile.util.MobileMappingsProxy
import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepository
import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkModel
@@ -222,13 +221,13 @@ constructor(
    private val carrierConfigChangedEvent =
        broadcastDispatcher
            .broadcastFlow(IntentFilter(CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED))
            .logInputChange(logger, "ACTION_CARRIER_CONFIG_CHANGED")
            .onEach { logger.logActionCarrierConfigChanged() }

    override val defaultDataSubRatConfig: StateFlow<Config> =
        merge(defaultDataSubIdChangeEvent, carrierConfigChangedEvent)
            .mapLatest { Config.readConfig(context) }
            .distinctUntilChanged()
            .logInputChange(logger, "defaultDataSubRatConfig")
            .onEach { logger.logDefaultDataSubRatConfig(it) }
            .stateIn(
                scope,
                SharingStarted.WhileSubscribed(),
@@ -239,13 +238,13 @@ constructor(
        defaultDataSubRatConfig
            .map { mobileMappingsProxy.mapIconSets(it) }
            .distinctUntilChanged()
            .logInputChange(logger, "defaultMobileIconMapping")
            .onEach { logger.logDefaultMobileIconMapping(it) }

    override val defaultMobileIconGroup: Flow<MobileIconGroup> =
        defaultDataSubRatConfig
            .map { mobileMappingsProxy.getDefaultIcons(it) }
            .distinctUntilChanged()
            .logInputChange(logger, "defaultMobileIconGroup")
            .onEach { logger.logDefaultMobileIconGroup(it) }

    override fun getRepoForSubId(subId: Int): FullMobileConnectionRepository {
        if (!isValidSubId(subId)) {
+0 −2
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import com.android.systemui.statusbar.pipeline.mobile.data.model.SubscriptionMod
import com.android.systemui.statusbar.pipeline.mobile.data.repository.MobileConnectionRepository
import com.android.systemui.statusbar.pipeline.mobile.data.repository.MobileConnectionsRepository
import com.android.systemui.statusbar.pipeline.mobile.data.repository.UserSetupRepository
import com.android.systemui.statusbar.pipeline.mobile.shared.MobileInputLogger
import com.android.systemui.statusbar.pipeline.shared.data.model.ConnectivitySlot
import com.android.systemui.statusbar.pipeline.shared.data.repository.ConnectivityRepository
import com.android.systemui.util.CarrierConfigTracker
@@ -111,7 +110,6 @@ class MobileIconsInteractorImpl
constructor(
    private val mobileConnectionsRepo: MobileConnectionsRepository,
    private val carrierConfigTracker: CarrierConfigTracker,
    private val logger: MobileInputLogger,
    @MobileSummaryLog private val tableLogger: TableLogBuffer,
    connectivityRepository: ConnectivityRepository,
    userSetupRepo: UserSetupRepository,
Loading