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

Commit 29fdded9 authored by Julia Tuttle's avatar Julia Tuttle Committed by Android (Google) Code Review
Browse files

Merge "Move notif LogBuffers to new NotificationsLogModule" into main

parents 15205033 950dd059
Loading
Loading
Loading
Loading
+0 −107
Original line number Diff line number Diff line
@@ -32,8 +32,6 @@ import com.android.systemui.plugins.clocks.ClockMessageBuffers;
import com.android.systemui.qs.QSFragmentLegacy;
import com.android.systemui.qs.pipeline.shared.QSPipelineFlagsRepository;
import com.android.systemui.qs.pipeline.shared.TileSpec;
import com.android.systemui.statusbar.notification.NotifPipelineFlags;
import com.android.systemui.util.Compile;
import com.android.systemui.util.wakelock.WakeLockLog;

import dagger.Lazy;
@@ -56,61 +54,6 @@ public class LogModule {
        return factory.create("DozeLog", 150);
    }

    /** Provides a logging buffer for all logs related to the data layer of notifications. */
    @Provides
    @SysUISingleton
    @NotificationLog
    public static LogBuffer provideNotificationsLogBuffer(
            LogBufferFactory factory,
            NotifPipelineFlags notifPipelineFlags) {
        int maxSize = 1000;
        if (Compile.IS_DEBUG && notifPipelineFlags.isDevLoggingEnabled()) {
            maxSize *= 10;
        }
        return factory.create("NotifLog", maxSize, Compile.IS_DEBUG /* systrace */);
    }

    /** Provides a logging buffer for all logs related to notifications on the lockscreen. */
    @Provides
    @SysUISingleton
    @NotificationLockscreenLog
    public static LogBuffer provideNotificationLockScreenLogBuffer(
            LogBufferFactory factory) {
        return factory.create("NotifLockscreenLog", 50, false /* systrace */);
    }

    /** Provides a logging buffer for logs related to heads up presentation of notifications. */
    @Provides
    @SysUISingleton
    @NotificationHeadsUpLog
    public static LogBuffer provideNotificationHeadsUpLogBuffer(LogBufferFactory factory) {
        return factory.create("NotifHeadsUpLog", 1000);
    }

    /** Provides a logging buffer for logs related to inflation of notifications. */
    @Provides
    @SysUISingleton
    @NotifInflationLog
    public static LogBuffer provideNotifInflationLogBuffer(LogBufferFactory factory) {
        return factory.create("NotifInflationLog", 250);
    }

    /** Provides a logging buffer for notification interruption calculations. */
    @Provides
    @SysUISingleton
    @NotificationInterruptLog
    public static LogBuffer provideNotificationInterruptLogBuffer(LogBufferFactory factory) {
        return factory.create("NotifInterruptLog", 100);
    }

    /** Provides a logging buffer for notification rendering events. */
    @Provides
    @SysUISingleton
    @NotificationRenderLog
    public static LogBuffer provideNotificationRenderLogBuffer(LogBufferFactory factory) {
        return factory.create("NotifRenderLog", 100);
    }

    /** Provides a logging buffer for all logs for lockscreen to shade transition events. */
    @Provides
    @SysUISingleton
@@ -119,16 +62,6 @@ public class LogModule {
        return factory.create("LSShadeTransitionLog", 50);
    }

    /** */
    @Provides
    @SysUISingleton
    @SensitiveNotificationProtectionLog
    public static LogBuffer provideSensitiveNotificationProtectionLogBuffer(
            LogBufferFactory factory
    ) {
        return factory.create("SensitiveNotificationProtectionLog", 10);
    }

    /** Provides a logging buffer for shade window messages. */
    @Provides
    @SysUISingleton
@@ -153,30 +86,6 @@ public class LogModule {
        return factory.create("ShadeTouchLog", 500, false);
    }

    /** Provides a logging buffer for all logs related to managing notification sections. */
    @Provides
    @SysUISingleton
    @NotificationSectionLog
    public static LogBuffer provideNotificationSectionLogBuffer(LogBufferFactory factory) {
        return factory.create("NotifSectionLog", 1000 /* maxSize */, false /* systrace */);
    }

    /** Provides a logging buffer for all logs related to remote input controller. */
    @Provides
    @SysUISingleton
    @NotificationRemoteInputLog
    public static LogBuffer provideNotificationRemoteInputLogBuffer(LogBufferFactory factory) {
        return factory.create("NotifRemoteInputLog", 50 /* maxSize */, false /* systrace */);
    }

    /** Provides a logging buffer for all logs related to notification visual stability. */
    @Provides
    @SysUISingleton
    @VisualStabilityLog
    public static LogBuffer provideVisualStabilityLogBuffer(LogBufferFactory factory) {
        return factory.create("VisualStabilityLog", 50 /* maxSize */, false /* systrace */);
    }

    /** Provides a logging buffer for all logs related to keyguard media controller. */
    @Provides
    @SysUISingleton
@@ -185,22 +94,6 @@ public class LogModule {
        return factory.create("KeyguardMediaControllerLog", 50 /* maxSize */, false /* systrace */);
    }

    /** Provides a logging buffer for all logs related to unseen notifications. */
    @Provides
    @SysUISingleton
    @UnseenNotificationLog
    public static LogBuffer provideUnseenNotificationLogBuffer(LogBufferFactory factory) {
        return factory.create("UnseenNotifLog", 20 /* maxSize */, false /* systrace */);
    }

    /** Provides a logging buffer for all logs related to the data layer of notifications. */
    @Provides
    @SysUISingleton
    @NotifInteractionLog
    public static LogBuffer provideNotifInteractionLogBuffer(LogBufferFactory factory) {
        return factory.create("NotifInteractionLog", 50);
    }

    /** Provides a logging buffer for all logs related to Quick Settings. */
    @Provides
    @SysUISingleton
+2 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ import com.android.systemui.statusbar.notification.interruption.VisualInterrupti
import com.android.systemui.statusbar.notification.interruption.VisualInterruptionRefactor;
import com.android.systemui.statusbar.notification.logging.NotificationPanelLogger;
import com.android.systemui.statusbar.notification.logging.NotificationPanelLoggerImpl;
import com.android.systemui.statusbar.notification.logging.dagger.NotificationsLogModule;
import com.android.systemui.statusbar.notification.row.NotificationEntryProcessorFactory;
import com.android.systemui.statusbar.notification.row.NotificationEntryProcessorFactoryLooperImpl;
import com.android.systemui.statusbar.notification.row.NotificationGutsManager;
@@ -116,6 +117,7 @@ import javax.inject.Provider;
        ActivatableNotificationViewModelModule.class,
        NotificationMemoryModule.class,
        NotificationStatsLoggerModule.class,
        NotificationsLogModule.class,
})
public interface NotificationsModule {
    @Binds
+143 −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.notification.logging.dagger

import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.LogBufferFactory
import com.android.systemui.log.dagger.NotifInflationLog
import com.android.systemui.log.dagger.NotifInteractionLog
import com.android.systemui.log.dagger.NotificationHeadsUpLog
import com.android.systemui.log.dagger.NotificationInterruptLog
import com.android.systemui.log.dagger.NotificationLockscreenLog
import com.android.systemui.log.dagger.NotificationLog
import com.android.systemui.log.dagger.NotificationRemoteInputLog
import com.android.systemui.log.dagger.NotificationRenderLog
import com.android.systemui.log.dagger.NotificationSectionLog
import com.android.systemui.log.dagger.SensitiveNotificationProtectionLog
import com.android.systemui.log.dagger.UnseenNotificationLog
import com.android.systemui.log.dagger.VisualStabilityLog
import com.android.systemui.statusbar.notification.NotifPipelineFlags
import com.android.systemui.util.Compile
import dagger.Module
import dagger.Provides

@Module
object NotificationsLogModule {
    /** Provides a logging buffer for logs related to heads up presentation of notifications. */
    @Provides
    @SysUISingleton
    @NotificationHeadsUpLog
    fun provideNotificationHeadsUpLogBuffer(factory: LogBufferFactory): LogBuffer {
        return factory.create("NotifHeadsUpLog", 1000)
    }

    /** Provides a logging buffer for logs related to inflation of notifications. */
    @Provides
    @SysUISingleton
    @NotifInflationLog
    fun provideNotifInflationLogBuffer(factory: LogBufferFactory): LogBuffer {
        return factory.create("NotifInflationLog", 250)
    }

    /** Provides a logging buffer for all logs related to the data layer of notifications. */
    @Provides
    @SysUISingleton
    @NotifInteractionLog
    fun provideNotifInteractionLogBuffer(factory: LogBufferFactory): LogBuffer {
        return factory.create("NotifInteractionLog", 50)
    }

    /** Provides a logging buffer for notification interruption calculations. */
    @Provides
    @SysUISingleton
    @NotificationInterruptLog
    fun provideNotificationInterruptLogBuffer(factory: LogBufferFactory): LogBuffer {
        return factory.create("NotifInterruptLog", 100)
    }

    /** Provides a logging buffer for all logs related to notifications on the lockscreen. */
    @Provides
    @SysUISingleton
    @NotificationLockscreenLog
    fun provideNotificationLockScreenLogBuffer(factory: LogBufferFactory): LogBuffer {
        return factory.create("NotifLockscreenLog", 50, false /* systrace */)
    }

    /** Provides a logging buffer for all logs related to the data layer of notifications. */
    @Provides
    @SysUISingleton
    @NotificationLog
    fun provideNotificationsLogBuffer(
        factory: LogBufferFactory,
        notifPipelineFlags: NotifPipelineFlags,
    ): LogBuffer {
        var maxSize = 1000
        if (Compile.IS_DEBUG && notifPipelineFlags.isDevLoggingEnabled()) {
            maxSize *= 10
        }
        return factory.create("NotifLog", maxSize, Compile.IS_DEBUG /* systrace */)
    }

    /** Provides a logging buffer for all logs related to remote input controller. */
    @Provides
    @SysUISingleton
    @NotificationRemoteInputLog
    fun provideNotificationRemoteInputLogBuffer(factory: LogBufferFactory): LogBuffer {
        return factory.create("NotifRemoteInputLog", 50, /* maxSize */ false /* systrace */)
    }

    /** Provides a logging buffer for notification rendering events. */
    @Provides
    @SysUISingleton
    @NotificationRenderLog
    fun provideNotificationRenderLogBuffer(factory: LogBufferFactory): LogBuffer {
        return factory.create("NotifRenderLog", 100)
    }

    /** Provides a logging buffer for all logs related to managing notification sections. */
    @Provides
    @SysUISingleton
    @NotificationSectionLog
    fun provideNotificationSectionLogBuffer(factory: LogBufferFactory): LogBuffer {
        return factory.create("NotifSectionLog", 1000, /* maxSize */ false /* systrace */)
    }

    /**  */
    @Provides
    @SysUISingleton
    @SensitiveNotificationProtectionLog
    fun provideSensitiveNotificationProtectionLogBuffer(factory: LogBufferFactory): LogBuffer {
        return factory.create("SensitiveNotificationProtectionLog", 10)
    }

    /** Provides a logging buffer for all logs related to unseen notifications. */
    @Provides
    @SysUISingleton
    @UnseenNotificationLog
    fun provideUnseenNotificationLogBuffer(factory: LogBufferFactory): LogBuffer {
        return factory.create("UnseenNotifLog", 20, /* maxSize */ false /* systrace */)
    }

    /** Provides a logging buffer for all logs related to notification visual stability. */
    @Provides
    @SysUISingleton
    @VisualStabilityLog
    fun provideVisualStabilityLogBuffer(factory: LogBufferFactory): LogBuffer {
        return factory.create("VisualStabilityLog", 50, /* maxSize */ false /* systrace */)
    }
}