Loading packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +9 −1 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading packages/SystemUI/src/com/android/systemui/log/dagger/NotificationInterruptLog.java 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * 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 { } packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptLogger.kt +25 −27 Original line number Diff line number Diff line Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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 }, { Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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 Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading Loading
packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +9 −1 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading
packages/SystemUI/src/com/android/systemui/log/dagger/NotificationInterruptLog.java 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * 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 { }
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptLogger.kt +25 −27 Original line number Diff line number Diff line Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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 }, { Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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 Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading @@ -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" Loading