diff options
| author | 2022-05-18 16:04:32 +0000 | |
|---|---|---|
| committer | 2022-06-16 20:14:34 +0000 | |
| commit | 05e9a7bdf95413e5b20ac5f9d6fa67c5e7fb03d7 (patch) | |
| tree | f520b6ccd7c5d82baa0f78763f31780f59d9db86 | |
| parent | d6579ac1b7b3a43a59b4bda4fb35b80959e67d05 (diff) | |
Move interrupt logs from NotifLog to NotifInterruptLog
This reduces the log volume in the NotifLog, which was blocking lots of diagnostics.
Test: dumpsysui NotifInterruptog NotifLog
Bug: 236140753
Change-Id: Iadc0202678ccd2823e97fa4dce0a9db47bdef0e6
3 files changed, 67 insertions, 28 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java b/packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java index 05da4bb4d1ad..90cca15ddf21 100644 --- a/packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +++ b/packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java @@ -52,7 +52,7 @@ public class LogModule { return factory.create("NotifLog", 1000 /* maxSize */, false /* systrace */); } - /** Provides a logging buffer for all logs related to the data layer of notifications. */ + /** Provides a logging buffer for logs related to heads up presentation of notifications. */ @Provides @SysUISingleton @NotificationHeadsUpLog @@ -60,6 +60,14 @@ public class LogModule { return factory.create("NotifHeadsUpLog", 1000); } + /** 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 all logs for lockscreen to shade transition events. */ @Provides @SysUISingleton diff --git a/packages/SystemUI/src/com/android/systemui/log/dagger/NotificationInterruptLog.java b/packages/SystemUI/src/com/android/systemui/log/dagger/NotificationInterruptLog.java new file mode 100644 index 000000000000..760fbf3928b6 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/log/dagger/NotificationInterruptLog.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2022 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.log.dagger; + +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import com.android.systemui.log.LogBuffer; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; + +import javax.inject.Qualifier; + +/** A {@link LogBuffer} for notification interruption logging. */ +@Qualifier +@Documented +@Retention(RUNTIME) +public @interface NotificationInterruptLog { +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptLogger.kt index 6c99e3adb73e..1d18ca3dfade 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptLogger.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptLogger.kt @@ -20,16 +20,14 @@ import android.service.notification.StatusBarNotification import com.android.systemui.log.LogBuffer import com.android.systemui.log.LogLevel.DEBUG import com.android.systemui.log.LogLevel.INFO -import com.android.systemui.log.dagger.NotificationHeadsUpLog -import com.android.systemui.log.dagger.NotificationLog +import com.android.systemui.log.dagger.NotificationInterruptLog import javax.inject.Inject class NotificationInterruptLogger @Inject constructor( - @NotificationLog val notifBuffer: LogBuffer, - @NotificationHeadsUpLog val hunBuffer: LogBuffer + @NotificationInterruptLog val buffer: LogBuffer ) { fun logHeadsUpFeatureChanged(useHeadsUp: Boolean) { - hunBuffer.log(TAG, INFO, { + buffer.log(TAG, INFO, { bool1 = useHeadsUp }, { "heads up is enabled=$bool1" @@ -37,14 +35,14 @@ class NotificationInterruptLogger @Inject constructor( } fun logWillDismissAll() { - hunBuffer.log(TAG, INFO, { + buffer.log(TAG, INFO, { }, { "dismissing any existing heads up notification on disable event" }) } fun logNoBubbleNotAllowed(sbn: StatusBarNotification) { - notifBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No bubble up: not allowed to bubble: $str1" @@ -52,7 +50,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoBubbleNoMetadata(sbn: StatusBarNotification) { - notifBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No bubble up: notification: $str1 doesn't have valid metadata" @@ -60,14 +58,14 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoHeadsUpFeatureDisabled() { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { }, { "No heads up: no huns" }) } fun logNoHeadsUpPackageSnoozed(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No alerting: snoozed package: $str1" @@ -75,7 +73,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoHeadsUpAlreadyBubbled(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No heads up: in unlocked shade where notification is shown as a bubble: $str1" @@ -83,7 +81,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoHeadsUpSuppressedByDnd(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No heads up: suppressed by DND: $str1" @@ -91,7 +89,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoHeadsUpNotImportant(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No heads up: unimportant notification: $str1" @@ -99,7 +97,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoHeadsUpNotInUse(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No heads up: not in use: $str1" @@ -110,7 +108,7 @@ class NotificationInterruptLogger @Inject constructor( sbn: StatusBarNotification, suppressor: NotificationInterruptSuppressor ) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key str2 = suppressor.name }, { @@ -119,7 +117,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logHeadsUp(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "Heads up: $str1" @@ -127,7 +125,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoAlertingFilteredOut(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No alerting: filtered notification: $str1" @@ -135,7 +133,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoAlertingGroupAlertBehavior(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No alerting: suppressed due to group alert behavior: $str1" @@ -147,7 +145,7 @@ class NotificationInterruptLogger @Inject constructor( suppressor: NotificationInterruptSuppressor, awake: Boolean ) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key str2 = suppressor.name bool1 = awake @@ -157,7 +155,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoAlertingRecentFullscreen(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No alerting: recent fullscreen: $str1" @@ -165,7 +163,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoPulsingSettingDisabled(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No pulsing: disabled by setting: $str1" @@ -173,7 +171,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoPulsingBatteryDisabled(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No pulsing: disabled by battery saver: $str1" @@ -181,7 +179,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoPulsingNoAlert(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No pulsing: notification shouldn't alert: $str1" @@ -189,7 +187,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoPulsingNoAmbientEffect(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No pulsing: ambient effect suppressed: $str1" @@ -197,7 +195,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logNoPulsingNotImportant(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "No pulsing: not important enough: $str1" @@ -205,7 +203,7 @@ class NotificationInterruptLogger @Inject constructor( } fun logPulsing(sbn: StatusBarNotification) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = sbn.key }, { "Pulsing: $str1" @@ -213,7 +211,7 @@ class NotificationInterruptLogger @Inject constructor( } fun keyguardHideNotification(key: String) { - hunBuffer.log(TAG, DEBUG, { + buffer.log(TAG, DEBUG, { str1 = key }, { "Keyguard Hide Notification: $str1" |