Merge "Move interrupt logs from NotifLog to NotifInterruptLog" into tm-qpr-dev

This commit is contained in:
Jeff DeCew
2022-06-16 20:16:00 +00:00
committed by Android (Google) Code Review
3 changed files with 67 additions and 28 deletions

View File

@@ -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

View File

@@ -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 {
}

View File

@@ -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"