Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderWrapper.kt +22 −8 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.systemui.statusbar.notification.interruption import com.android.app.tracing.traceSection import com.android.internal.annotations.VisibleForTesting import com.android.systemui.dagger.SysUISingleton import com.android.systemui.flags.RefactorFlagUtils Loading Loading @@ -82,20 +83,33 @@ class NotificationInterruptStateProviderWrapper( } override fun makeUnloggedHeadsUpDecision(entry: NotificationEntry): Decision = traceSection("NotificationInterruptStateProviderWrapper#makeUnloggedHeadsUpDecision") { wrapped.checkHeadsUp(entry, /* log= */ false).let { DecisionImpl.of(it) } } override fun makeAndLogHeadsUpDecision(entry: NotificationEntry): Decision = traceSection("NotificationInterruptStateProviderWrapper#makeAndLogHeadsUpDecision") { wrapped.checkHeadsUp(entry, /* log= */ true).let { DecisionImpl.of(it) } } override fun makeUnloggedFullScreenIntentDecision(entry: NotificationEntry) = wrapped.getFullScreenIntentDecision(entry).let { FullScreenIntentDecisionImpl(entry, it) } traceSection( "NotificationInterruptStateProviderWrapper#makeUnloggedFullScreenIntentDecision" ) { wrapped.getFullScreenIntentDecision(entry).let { FullScreenIntentDecisionImpl(entry, it) } } override fun logFullScreenIntentDecision(decision: FullScreenIntentDecision) { override fun logFullScreenIntentDecision(decision: FullScreenIntentDecision) = traceSection("NotificationInterruptStateProviderWrapper#logFullScreenIntentDecision") { (decision as FullScreenIntentDecisionImpl).let { wrapped.logFullScreenIntentDecision(it.originalEntry, it.originalDecision) } } override fun makeAndLogBubbleDecision(entry: NotificationEntry): Decision = traceSection("NotificationInterruptStateProviderWrapper#makeAndLogBubbleDecision") { wrapped.shouldBubbleUp(entry).let { DecisionImpl.of(it) } } } packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt +56 −46 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import android.hardware.display.AmbientDisplayConfiguration import android.os.Handler import android.os.PowerManager import android.util.Log import com.android.app.tracing.traceSection import com.android.internal.annotations.VisibleForTesting import com.android.internal.logging.UiEventLogger import com.android.internal.logging.UiEventLogger.UiEventEnum Loading Loading @@ -196,7 +197,8 @@ constructor( filters.remove(filter) } override fun makeUnloggedHeadsUpDecision(entry: NotificationEntry): Decision { override fun makeUnloggedHeadsUpDecision(entry: NotificationEntry): Decision = traceSection("VisualInterruptionDecisionProviderImpl#makeUnloggedHeadsUpDecision") { check(started) return if (statusBarStateController.isDozing) { Loading @@ -207,7 +209,8 @@ constructor( .decision } override fun makeAndLogHeadsUpDecision(entry: NotificationEntry): Decision { override fun makeAndLogHeadsUpDecision(entry: NotificationEntry): Decision = traceSection("VisualInterruptionDecisionProviderImpl#makeAndLogHeadsUpDecision") { check(started) return if (statusBarStateController.isDozing) { Loading @@ -229,10 +232,13 @@ constructor( ?: checkFilters(PULSE, entry) ?: checkSuppressInterruptions(entry) ?: LoggableDecision.unsuppressed override fun makeAndLogBubbleDecision(entry: NotificationEntry): Decision { override fun makeAndLogBubbleDecision(entry: NotificationEntry): Decision = traceSection("VisualInterruptionDecisionProviderImpl#makeAndLogBubbleDecision") { check(started) return makeLoggableBubbleDecision(entry).also { logDecision(BUBBLE, entry, it) }.decision return makeLoggableBubbleDecision(entry) .also { logDecision(BUBBLE, entry, it) } .decision } private fun makeLoggableBubbleDecision(entry: NotificationEntry): LoggableDecision = Loading @@ -251,7 +257,10 @@ constructor( override fun makeUnloggedFullScreenIntentDecision( entry: NotificationEntry ): FullScreenIntentDecision { ): FullScreenIntentDecision = traceSection( "VisualInterruptionDecisionProviderImpl#makeUnloggedFullScreenIntentDecision" ) { check(started) val couldHeadsUp = makeUnloggedHeadsUpDecision(entry).shouldInterrupt Loading @@ -260,7 +269,8 @@ constructor( return FullScreenIntentDecisionImpl(entry, fsiDecision) } override fun logFullScreenIntentDecision(decision: FullScreenIntentDecision) { override fun logFullScreenIntentDecision(decision: FullScreenIntentDecision) = traceSection("VisualInterruptionDecisionProviderImpl#logFullScreenIntentDecision") { check(started) if (decision !is FullScreenIntentDecisionImpl) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderWrapper.kt +22 −8 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.systemui.statusbar.notification.interruption import com.android.app.tracing.traceSection import com.android.internal.annotations.VisibleForTesting import com.android.systemui.dagger.SysUISingleton import com.android.systemui.flags.RefactorFlagUtils Loading Loading @@ -82,20 +83,33 @@ class NotificationInterruptStateProviderWrapper( } override fun makeUnloggedHeadsUpDecision(entry: NotificationEntry): Decision = traceSection("NotificationInterruptStateProviderWrapper#makeUnloggedHeadsUpDecision") { wrapped.checkHeadsUp(entry, /* log= */ false).let { DecisionImpl.of(it) } } override fun makeAndLogHeadsUpDecision(entry: NotificationEntry): Decision = traceSection("NotificationInterruptStateProviderWrapper#makeAndLogHeadsUpDecision") { wrapped.checkHeadsUp(entry, /* log= */ true).let { DecisionImpl.of(it) } } override fun makeUnloggedFullScreenIntentDecision(entry: NotificationEntry) = wrapped.getFullScreenIntentDecision(entry).let { FullScreenIntentDecisionImpl(entry, it) } traceSection( "NotificationInterruptStateProviderWrapper#makeUnloggedFullScreenIntentDecision" ) { wrapped.getFullScreenIntentDecision(entry).let { FullScreenIntentDecisionImpl(entry, it) } } override fun logFullScreenIntentDecision(decision: FullScreenIntentDecision) { override fun logFullScreenIntentDecision(decision: FullScreenIntentDecision) = traceSection("NotificationInterruptStateProviderWrapper#logFullScreenIntentDecision") { (decision as FullScreenIntentDecisionImpl).let { wrapped.logFullScreenIntentDecision(it.originalEntry, it.originalDecision) } } override fun makeAndLogBubbleDecision(entry: NotificationEntry): Decision = traceSection("NotificationInterruptStateProviderWrapper#makeAndLogBubbleDecision") { wrapped.shouldBubbleUp(entry).let { DecisionImpl.of(it) } } }
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt +56 −46 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ import android.hardware.display.AmbientDisplayConfiguration import android.os.Handler import android.os.PowerManager import android.util.Log import com.android.app.tracing.traceSection import com.android.internal.annotations.VisibleForTesting import com.android.internal.logging.UiEventLogger import com.android.internal.logging.UiEventLogger.UiEventEnum Loading Loading @@ -196,7 +197,8 @@ constructor( filters.remove(filter) } override fun makeUnloggedHeadsUpDecision(entry: NotificationEntry): Decision { override fun makeUnloggedHeadsUpDecision(entry: NotificationEntry): Decision = traceSection("VisualInterruptionDecisionProviderImpl#makeUnloggedHeadsUpDecision") { check(started) return if (statusBarStateController.isDozing) { Loading @@ -207,7 +209,8 @@ constructor( .decision } override fun makeAndLogHeadsUpDecision(entry: NotificationEntry): Decision { override fun makeAndLogHeadsUpDecision(entry: NotificationEntry): Decision = traceSection("VisualInterruptionDecisionProviderImpl#makeAndLogHeadsUpDecision") { check(started) return if (statusBarStateController.isDozing) { Loading @@ -229,10 +232,13 @@ constructor( ?: checkFilters(PULSE, entry) ?: checkSuppressInterruptions(entry) ?: LoggableDecision.unsuppressed override fun makeAndLogBubbleDecision(entry: NotificationEntry): Decision { override fun makeAndLogBubbleDecision(entry: NotificationEntry): Decision = traceSection("VisualInterruptionDecisionProviderImpl#makeAndLogBubbleDecision") { check(started) return makeLoggableBubbleDecision(entry).also { logDecision(BUBBLE, entry, it) }.decision return makeLoggableBubbleDecision(entry) .also { logDecision(BUBBLE, entry, it) } .decision } private fun makeLoggableBubbleDecision(entry: NotificationEntry): LoggableDecision = Loading @@ -251,7 +257,10 @@ constructor( override fun makeUnloggedFullScreenIntentDecision( entry: NotificationEntry ): FullScreenIntentDecision { ): FullScreenIntentDecision = traceSection( "VisualInterruptionDecisionProviderImpl#makeUnloggedFullScreenIntentDecision" ) { check(started) val couldHeadsUp = makeUnloggedHeadsUpDecision(entry).shouldInterrupt Loading @@ -260,7 +269,8 @@ constructor( return FullScreenIntentDecisionImpl(entry, fsiDecision) } override fun logFullScreenIntentDecision(decision: FullScreenIntentDecision) { override fun logFullScreenIntentDecision(decision: FullScreenIntentDecision) = traceSection("VisualInterruptionDecisionProviderImpl#logFullScreenIntentDecision") { check(started) if (decision !is FullScreenIntentDecisionImpl) { Loading